skillfed

BabelDOC

Yet Another Document Translator

babeldoc v0.6.4 74.3K downloads/30d#14,852 on PyPI9,349
AGPL license AGPL-3.0 Active released

What it is and what it does

BabelDOC is a PDF translation and bilingual comparison library designed primarily to translate scientific papers from English to Chinese while preserving layout and formatting. It can produce side-by-side or alternating-page dual PDFs showing original and translated text. The package is built on a large stack of ML and computer vision dependencies (onnxruntime, opencv, scikit-learn, etc.) to handle PDF parsing, text extraction, layout analysis, and rendering. It exposes both a command-line interface for simple translation tasks and a Python API for embedding into other programs.

The package is actively maintained and young (first release February 2025), with an AGPL-3.0 license that requires source disclosure for any modifications. It integrates with external translation services (primarily OpenAI's API) and supports multiple language pairs, though English-to-Chinese is the primary focus and other directions are noted as untested. The 33 runtime dependencies mean a substantial first install, but the wheel distribution keeps setup friction low.

Use it for:

  • Translate a batch of research papers from English to Chinese for reading alongside the original.
  • Embed PDF translation into a reference management tool like Zotero via the Python API.
  • Self-host a document translation service with custom translation backends using the library's modular design.
  • Extract and translate text from scanned PDFs using OCR workaround modes for documents with poor text layers.
  • Generate dual-language PDFs for academic collaboration where both original and translated versions are needed.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

BabelDOC translates PDF documents between languages, primarily English to Chinese, producing bilingual comparison PDFs with original and translated pages.

Yes, if you need to translate PDFs and can accept the AGPL-3.0 license terms and the large dependency footprint. The package is actively maintained, has no known vulnerabilities, and offers both CLI and library modes. No, if you require a permissive license, need production-ready support for non-English-to-Chinese pairs, or want to avoid the 33-dependency install. Yes-with-conditions if you plan to embed it: verify that the Python API is stable for your use case, as the CLI is noted as primarily for debugging.

Install

babeldoc on PyPI

pip

pip install babeldoc

uv

uv add babeldoc

poetry

poetry add babeldoc

Installing BabelDOC

Before you install

Low install friction with a pure Python wheel. Active maintenance—last commit 2026-08-05, first release 2025-02-11. Carries 33 runtime dependencies including heavy ML/CV stacks (onnxruntime, opencv-python-headless, scikit-learn), which will pull in substantial binary artifacts on first install.

License in practice

Licensed under AGPL-3.0. Any modifications or derivative works must be released under the same license and source made available; using this in a proprietary product without disclosure is not permitted.

Quickstart

pip install BabelDOC
babeldoc --openai --openai-model "gpt-4o-mini" --openai-base-url "https://api.openai.com/v1" --openai-api-key "your-api-key-here" --files example.pdf

Requires Python 3.10 or later (and <3.14). An OpenAI API key or alternative translation service configuration is needed to actually translate documents.

Verify before relying

  • Whether non-English-to-Chinese translation pairs are production-ready or experimental.
  • Performance characteristics and typical translation latency for multi-page documents.
  • Whether the 1000 free pages/month quota mentioned for the online service applies to self-hosted deployments.
  • Stability and compatibility of the CLI versus embedding the package as a library in other applications.

Package facts

License AGPL-3.0 (agpl)
Python support supports the current Python release (<3.14,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 33 — bitstring, chardet, charset-normalizer, configargparse, cryptography, freetype-py, httpx, huggingface-hub, hyperscan, levenshtein, msgpack, numpy, onnx, onnxruntime, openai, opencv-python-headless, orjson, peewee, psutil, pydantic, pymupdf, pyzstd, rich, rtree, scikit-image, scikit-learn, scipy, tenacity, tiktoken, toml
Maintenance actively maintained — 29 days since the last release
Last repo commit
First released
Downloads 74,296/month — #14,852 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: babeldoc-0.6.4-py3-none-any.whl

Keywords: PDF

Operating System :: OS IndependentProgramming Language :: Python :: 3

Tags

PDF translationdocument translatorbilingual PDFscientific paper translationmultilingual document processingPDF language conversionbatch PDF translation
pdf-translationmultilingualdocument-processing

More Linguistic packages