Registry / ai-ml / babeldoc

babeldoc

JSON →
library0.6.3pypypi✓ verified 80d ago

Yet Another Document Translator. Current version 0.5.24. Supports Python >=3.10 <3.14. Released roughly weekly.

pip install babeldoc[ocr]
INSTALL
IMPORT
SIG · BABELDOC
B
babeldoc
ai-mlpythonv0.6.3
Install
35.6s avg
Import
Disk
921MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 42.9s
py 3.11
✕ build_error
✓ 35.3s
py 3.12
✕ build_error
✓ 31.1s
py 3.13
✕ build_error
✓ 32.95s
py 3.9
✕ build_error
✕ build_error
921MB installed
● package 921MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DocumentTranslator
import babeldoc
from babeldoc import DocumentTranslator

Basic usage: instantiate DocumentTranslator with API key and model, then call translate with a TranslationConfig.

from babeldoc import DocumentTranslator, TranslationConfig translator = DocumentTranslator( api_key=os.environ.get('OPENAI_API_KEY', ''), model='gpt-4o', source_lang='en', target_lang='zh' ) config = TranslationConfig( input_file='input.pdf', output_file='output.pdf' ) translator.translate(config)
babeldoc --version
Debug
Known issues
breakingPython 3.13 is not supported; requires Python >=3.10 <3.14.
fix
Use Python 3.10, 3.11, or 3.12.
affects: >=0.5.0
gotchaThe 'ocr' extra is required for OCR-based translation; otherwise, text extraction only.
fix
Install with 'pip install babeldoc[ocr]' and ensure you have Tesseract installed separately.
affects: all
gotchaAPI key must be passed explicitly or set via environment variable; no default.
fix
Set OPENAI_API_KEY environment variable or pass api_key parameter.
affects: all
Upgrade
Version history
0.6.3latest on PyPI · released Jun 3, 2026
Audit
Dependencies
PillowrequiredImage processing for OCR and rendering
pypdfium2requiredPDF rendering and manipulation
opencv-python-headlessoptionalComputer vision for layout analysis
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
babeldoc — pip install babeldoc · libregistry