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
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
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