Pip install freeai-convert – universal file converter, one HANDLERS table

nadermx1 pts0 comments

GitHub - freeaigit/free-convert: Universal file format converter — one HANDLERS dispatch table covering ~80 format pairs (image/audio/video/pdf/office/ebook/csv/srt/archive/3d). · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

freeaigit

free-convert

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>1 Commit<br>1 Commit

.github/workflows

.github/workflows

freeconvert

freeconvert

tests

tests

.gitignore

.gitignore

LICENSE

LICENSE

README.md

README.md

pyproject.toml

pyproject.toml

View all files

Repository files navigation

freeai-convert

Universal file format converter. One dispatch table, ~80 format pairs across image / audio / video / pdf / office / ebook / csv / srt / archive / 3d.

pip install freeai-convert<br>freeconvert resume.pdf resume.docx<br>freeconvert song.flac song.mp3<br>freeconvert photo.heic photo.jpg<br>freeconvert deck.pptx deck.pdf

Same converter that backs every /convert// page on free.ai, extracted into a standalone CLI + Python library.

Why this exists

Most "universal converters" are either thin wrappers around pandoc (great for text, useless for images) or trillion-dependency monsters that take a pip install over a coffee break. freeai-convert is a dispatch table : one (src_ext, dst_ext) → handler map. Each handler is a 5–30 line wrapper around the right tool for the job — Pillow for images, ffmpeg for media, libreoffice for office, pdf2docx / pdfplumber for PDF, calibre for e-books, trimesh for 3D meshes, stdlib for csv/json/srt/vtt.

Adding a new format pair = one function + one line in HANDLERS. No abstraction, no plugin system, no class hierarchy.

What's supported

Run freeconvert --list to see the full set. Highlights:

From<br>To<br>Tool

jpg/png/webp/heic/bmp/tiff/ico/gif<br>any image format<br>Pillow (+ pillow-heif for HEIC)

any image<br>pdf<br>Pillow

svg<br>png/jpg<br>cairosvg

mp3/wav/flac/m4a/aac/ogg/opus/wma<br>any audio<br>ffmpeg

mp4/webm/mov/avi/mkv/flv<br>any video<br>ffmpeg

any video<br>any audio<br>ffmpeg (strip + re-encode)

any video<br>gif<br>ffmpeg (palette-gen, 2-pass)

pdf<br>docx / xlsx / pptx / txt / png / jpg<br>pdf2docx / pdfplumber / pdf2image

docx/xlsx/pptx/odt/ods/rtf/html<br>pdf<br>libreoffice --headless

docx ↔ odt / rtf / html / txt, xlsx ↔ ods, pptx ↔ odp

libreoffice

md → html / pdf / docx

stdlib regex / libreoffice

txt → pdf / docx

reportlab / python-docx

csv ↔ json, xlsx ↔ csv / json, csv ↔ xlsx

stdlib + openpyxl

srt ↔ vtt, srt → txt

stdlib

epub/mobi/azw3/fb2/lit ↔ each other ↔ pdf/docx/html/md/txt/rtf

calibre + pandoc

zip ↔ tar/tar.gz/7z

stdlib + py7zr

obj ↔ stl ↔ ply ↔ glb ↔ gltf

trimesh

Install

# Minimal install — CLI + dispatch table + stdlib-only handlers (csv/json/srt/vtt):<br>pip install freeai-convert

# Plus pure-Python image/PDF/office support:<br>pip install 'freeai-convert[image,pdf,office]'

# Everything pip-installable:<br>pip install 'freeai-convert[all]'

Several handlers shell out to system tools — install them via your OS package manager:

Handler<br>System dep<br>Debian/Ubuntu<br>macOS (brew)

audio / video / gif<br>ffmpeg<br>apt install ffmpeg<br>brew install ffmpeg

pdf → pptx, pdf → png/jpg<br>poppler-utils<br>apt install poppler-utils<br>brew install poppler

office ↔ office, office → pdf<br>libreoffice<br>apt install libreoffice<br>brew install --cask libreoffice

ebook (mobi/azw3/fb2/lit)<br>calibre<br>apt install calibre<br>brew install --cask calibre

ebook (epub fast-path)<br>pandoc<br>apt install pandoc<br>brew install pandoc

If you call a handler whose system tool is missing, you'll get a clear RuntimeError naming what failed.

Python API

from freeconvert import convert, lookup, supported_pairs, UnsupportedConversionError

# Easiest — formats inferred from extensions:<br>info = convert("/tmp/in.pdf", "/tmp/out.docx")<br># {'src': 'pdf', 'dst': 'docx', 'category': 'pdf_to_word', 'cost': 1000}

# Explicit src/dst when extensions are wrong or missing:<br>convert("/tmp/blob", "/tmp/out.png", src="jpg", dst="png")

# Probe before running:<br>resolved = lookup("heic", "jpg")<br>if resolved is None:<br>raise...

install convert docx office freeconvert ffmpeg

Related Articles