Convert Any file Into Anything - one command to convert files between formats, a dispatcher over Docling, Calibre, MarkItDown, faster-whisper, FFmpeg and ImageMagick.
Project description
caia
Convert Any file Into Anything. One command to convert files between formats. You run it, you get the output.
All the actual tool commands live in one editable registry, so you never have to
remember another ffmpeg/docling/calibre incantation.
caia file.pdf --to md # PDF -> Markdown
caia file.pdf # no target? lists everything .pdf can become, then pick
caia --list # the whole capability matrix + which tools are installed
caia book.epub --to pdf
caia talk.mp3 --to txt # audio -> transcript (faster-whisper)
caia clip.mp4 --to gif
caia photo.png --to jpg --out thumb.jpg
caia itself is a tiny pure-Python dispatcher (no dependencies). It doesn't convert
anything - it finds the real tool for input -> target, runs it, and prints the exact
command so you passively re-learn the incantations. The conversions it drives:
| Engine | Used for |
|---|---|
| Docling | PDF -> md / json / txt / html / yaml / docx; image OCR -> md |
Calibre (ebook-convert) |
EPUB -> pdf / docx / txt / htmlz / azw3 / mobi / md |
| MarkItDown | docx / pptx / xlsx / html -> md |
faster-whisper (via uvx) |
audio & video -> txt / srt / vtt / json |
| FFmpeg | video/audio -> mp3 / wav / gif / mp4 |
| ImageMagick | image -> jpg / png / webp / pdf |
The converters are external programs, not pip dependencies - install the ones you need
(see Requirements). caia --list shows what's found and what's missing,
and caia setup installs the missing ones for you (see Getting the engines).
Install
For yourself, globally (recommended) — editable so recipe edits apply live:
uv tool install --editable . # global `caia` command, on PATH
# or: pipx install --editable .
As an ordinary package (what others do):
pip install caia-convert # from PyPI (the command is still `caia`)
uv tool install caia-convert
pip install . # from a clone of this folder
pip install "git+https://github.com/yhigorrr/caia.git" # straight from GitHub
Either way you get a caia command. The PyPI/distribution name is caia-convert
(the short name was too close to existing packages); what you type is always caia.
(Requires Python >= 3.11 for stdlib tomllib.)
Getting the engines
caia drives external programs - it doesn't bundle them (they're large and most people want a subset). After installing caia, run:
caia doctor # report which engines are present / missing
caia setup # install the missing ones, with confirmation
caia setup uses uv tool install for the Python engines (Docling, MarkItDown), winget
for the native ones (FFmpeg, ImageMagick, Calibre) on Windows, and automatically wires
Calibre's off-PATH ebook-convert into your config. Flags: --yes (no prompt),
--dry-run (show the plan only). On non-Windows it prints the manual install hints.
You only need the engines for the conversions you actually use.
Configuration
The package ships with no machine-specific paths. Tools are found on your PATH.
Anything off-PATH (commonly Calibre on Windows) or any custom recipe goes in your user
config - run caia --config to see its location and a template:
Windows: %APPDATA%\caia\config.toml
else: ~/.config/caia/config.toml
[tools]
# Only list tools NOT on your PATH:
ebook-convert = "C:/Program Files/Calibre2/ebook-convert.exe"
# markitdown = ["C:/path/.venv/Scripts/python.exe", "-m", "markitdown"]
# pandoc = "pandoc" # add an entirely new tool
[[recipes]] # extra/override recipes (yours win on ties)
src = "pdf"
dst = "md"
tool = "docling"
cmd = "{docling} convert {in} --to md --output {outdir}"
produces = "{stem}.md"
desc = "PDF -> Markdown (Docling)"
Usage
caia <file> --to <fmt> convert
caia <file> list valid targets for that file and pick one
caia --list show every conversion and tool status
caia --config show the user config path + a template
caia --version | -h
--to <fmt> target format (md, pdf, txt, jpg, mp3, ...)
--tool <name> force a specific tool when several can do the job
--out <path> exact output file path
--outdir <dir> output directory (filename keeps the input's name)
-- <args...> everything after -- is passed straight to the underlying tool
Output lands next to the input by default. Ad-hoc tool flags via --:
caia clip.mp4 --to mp4 -- -crf 20 # tighter compression
caia talk.mp3 --to txt -- --model medium # bigger whisper model for accuracy
Adding a conversion
Two ways, same schema:
- Editable install: edit src/caia/recipes.py - changes apply live.
- No source edit: add a
[[recipes]]block to your config (caia --config).
{
"src": "pdf", # input extension, or a list of extensions
"dst": "md", # what you type after --to
"tool": "docling", # primary tool (drives the --list availability check)
"cmd": "{docling} convert {in} --to md --output {outdir}",
"produces": "{stem}.md", # filename the tool writes into {outdir} (omit if cmd uses {out})
"desc": "PDF -> Markdown (Docling)",
}
Placeholders: {in} {out} {outdir} {stem} {tmpdir} and tool names like
{docling} {ebook-convert} {ffmpeg} (plus any tool you define in config [tools]).
Multi-step jobs use "steps": ["...", "..."] with {tmpdir} for intermediates - see
the epub -> md and video -> txt recipes.
Requirements
External tools, installed however you like (caia just needs them on PATH or in config):
- Docling -
pip install docling - MarkItDown -
uv tool install 'markitdown[all]' - Calibre - provides
ebook-convert(off-PATH on Windows -> add to config) - FFmpeg, ImageMagick - via your package manager / winget
- uv - so
caiacan run faster-whisper throughuvx(no whisper install needed)
Layout
pyproject.toml # packaging (hatchling, console-script entry point `caia`)
src/caia/
cli.py # the dispatcher: resolve tools, pick recipe, run it
recipes.py # the built-in registry (BUILTIN_RECIPES)
config.py # user config loading + tool resolution
__main__.py # `python -m caia`
Notes
- FFmpeg conversions default to high quality, not small files: MP4
crf 18(visually lossless), MP3320k, WAV lossless at the source rate, GIF via a 2-pass palette. Want a smaller file? Override per run, e.g.caia clip.mp4 --to mp4 -- -crf 28. (Recipes put{args}before the output so ffmpeg actually honours the override.) - Whisper runs on CPU with int8 (
--device cpu --compute_type int8) by default, since GPU needs a CUDAcublaslibrary. First run downloads thebasemodel (~145 MB), then it's cached. Override per run:-- --model medium. - Child Python tools run with
PYTHONUTF8=1so non-Latin output doesn't crash the Windows cp1252 console. - Web -> Markdown (Jina / Firecrawl) is sketched as commented stubs in recipes.py but not wired up yet (URLs aren't files).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file caia_convert-0.1.1.tar.gz.
File metadata
- Download URL: caia_convert-0.1.1.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b71f484064a9e70a4aaf93f9237cc78cf38d585c8af051095e7b2092fa9e0a23
|
|
| MD5 |
2b84f5e6d961f7cd1c1e7ea29db4e812
|
|
| BLAKE2b-256 |
cf9c06b06e0a39242587a7b0187d7cbb0ee59f7a3c60af9752acace82c4f7a99
|
Provenance
The following attestation bundles were made for caia_convert-0.1.1.tar.gz:
Publisher:
publish.yml on yhigorrr/caia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
caia_convert-0.1.1.tar.gz -
Subject digest:
b71f484064a9e70a4aaf93f9237cc78cf38d585c8af051095e7b2092fa9e0a23 - Sigstore transparency entry: 1853885278
- Sigstore integration time:
-
Permalink:
yhigorrr/caia@553c957070a77c4235e67b0ecce4287193b98569 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yhigorrr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@553c957070a77c4235e67b0ecce4287193b98569 -
Trigger Event:
push
-
Statement type:
File details
Details for the file caia_convert-0.1.1-py3-none-any.whl.
File metadata
- Download URL: caia_convert-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3e582cc9f3de3e00c34147021605d32bc6a98da376cc2f840290221f8831002
|
|
| MD5 |
a4fb5f3d9df69a7906080ff506248a0b
|
|
| BLAKE2b-256 |
a9a005f4b89083e4faf868c1dd93f7b839833823e5fd85c32dcfc9608b8f4265
|
Provenance
The following attestation bundles were made for caia_convert-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on yhigorrr/caia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
caia_convert-0.1.1-py3-none-any.whl -
Subject digest:
b3e582cc9f3de3e00c34147021605d32bc6a98da376cc2f840290221f8831002 - Sigstore transparency entry: 1853885290
- Sigstore integration time:
-
Permalink:
yhigorrr/caia@553c957070a77c4235e67b0ecce4287193b98569 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yhigorrr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@553c957070a77c4235e67b0ecce4287193b98569 -
Trigger Event:
push
-
Statement type: