{"id":23336,"library":"babeldoc","title":"BabelDOC","description":"Yet Another Document Translator. Current version 0.5.24. Supports Python >=3.10 <3.14. Released roughly weekly.","status":"active","version":"0.5.24","language":"python","source_language":"en","source_url":"https://github.com/funstory-ai/BabelDOC","tags":["document-translation","pdf","ocr","ai"],"install":[{"cmd":"pip install babeldoc[ocr]","lang":"bash","label":"Recommended with OCR support"},{"cmd":"pip install babeldoc","lang":"bash","label":"Minimal installation"}],"dependencies":[{"reason":"Image processing for OCR and rendering","package":"Pillow","optional":false},{"reason":"PDF rendering and manipulation","package":"pypdfium2","optional":false},{"reason":"Computer vision for layout analysis","package":"opencv-python-headless","optional":true}],"imports":[{"note":"Main class for translating documents","symbol":"DocumentTranslator","correct":"from babeldoc import DocumentTranslator"},{"note":"Configuration object for translation settings","symbol":"TranslationConfig","correct":"from babeldoc import TranslationConfig"}],"quickstart":{"code":"from babeldoc import DocumentTranslator, TranslationConfig\n\ntranslator = DocumentTranslator(\n    api_key=os.environ.get('OPENAI_API_KEY', ''),\n    model='gpt-4o',\n    source_lang='en',\n    target_lang='zh'\n)\nconfig = TranslationConfig(\n    input_file='input.pdf',\n    output_file='output.pdf'\n)\ntranslator.translate(config)","lang":"python","description":"Basic usage: instantiate DocumentTranslator with API key and model, then call translate with a TranslationConfig."},"warnings":[{"fix":"Use Python 3.10, 3.11, or 3.12.","message":"Python 3.13 is not supported; requires Python >=3.10 <3.14.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Install with 'pip install babeldoc[ocr]' and ensure you have Tesseract installed separately.","message":"The 'ocr' extra is required for OCR-based translation; otherwise, text extraction only.","severity":"gotcha","affected_versions":"all"},{"fix":"Set OPENAI_API_KEY environment variable or pass api_key parameter.","message":"API key must be passed explicitly or set via environment variable; no default.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install babeldoc' in the correct Python environment.","cause":"The package is not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'babeldoc'"},{"fix":"Upgrade to latest: 'pip install --upgrade babeldoc'. Use 'from babeldoc import DocumentTranslator'.","cause":"Old version of babeldoc or incorrect import path. The class was renamed in v0.5.","error":"ImportError: cannot import name 'DocumentTranslator' from 'babeldoc'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}