opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

A Python library for translating scientific PDFs into bilingual comparisons
GitHub RepoViews5

Project Description

View on GitHub

Translating Scientific PDFs Without Losing the Layout (or Your Sanity)

If you've ever tried to read a dense academic paper in a language you don't speak, you know the pain. You paste text into a translator, and suddenly all the equations, figures, and multi-column layouts turn into a mess. You lose the context that made the paper readable in the first place. BabelDOC is a Python library built to fix exactly that—it translates scientific PDFs and produces bilingual comparisons so you can read the original and the translation side by side.

What It Does

BabelDOC is a PDF scientific paper translation and bilingual comparison library. It's mainly designed to be embedded into other programs, but it also ships with a simple command-line interface and a Python API, so you can use it directly for straightforward translation tasks.

Under the hood, it's a Python package installable from PyPI. The project provides an online service (in beta, with a free usage quota) and notes that self-deployment is supported through PDFMathTranslate-next, which pairs BabelDOC with a WebUI and additional translation services. There's also integration guidance for Zotero users via a couple of community plugins. The README points to a supported languages page, so coverage extends beyond a single language pair.

Why It's Cool

  • It's built for scientific papers specifically. That's a narrower target than a general PDF translator, and it matters. Academic PDFs are layout-heavy—figures, tables, references—and a tool that keeps the bilingual comparison intact is solving a real problem for researchers and students.

  • The CLI is refreshingly direct. You point it at a file (or several files at once) and pass your model credentials. No config files to wrestle with, no web dashboard required. For a quick translation job, that's exactly what you want.

  • It's designed to be embedded. The README is upfront that BabelDOC is mainly meant to live inside other programs. If you're building a reading tool, a research assistant, or anything that needs PDF translation, you get a library rather than a walled garden.

  • Multiple paths to use it. You can run it as a CLI tool, call it from Python, use the hosted online service, or self-deploy via PDFMathTranslate-next. That flexibility means you're not locked into one workflow.

  • The Zotero angle is practical. If you manage papers in Zotero, there are two documented plugin routes—one for Immersive Translate Pro members and one for PDFMathTranslate self-deployers. It slots into where a lot of people already do their reading.

How to Try It

The README recommends installing with uv, and it's worth following that advice.

  1. Install uv and set up your PATH as described in its installation docs.

  2. Install BabelDOC as a tool:

uv tool install --python 3.12 BabelDOC

babeldoc --help
  1. Run a translation. Here's the example from the README, using OpenAI as the translation backend:
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

You can also pass multiple files:

babeldoc --openai --openai-model "gpt-4o-mini" --openai-base-url "https://api.openai.com/v1" --openai-api-key "your-api-key-here" --files example1.pdf --files example2.pdf

If you'd rather not manage an install yourself, the online service has a free quota (check the FAQ on that page for details). And if you prefer a self-hosted setup with a WebUI, PDFMathTranslate-next is the documented route.

Source installs are also supported, and the README again recommends uv for managing the virtual environment. You'll find the full instructions in the repository.

Final Thoughts

BabelDOC is a focused tool, and that's its strength. It doesn't try to be a general-purpose document translator—it targets scientific PDFs and bilingual comparison, and it gives you both a CLI for quick jobs and a library for building something bigger. If you read papers across languages, or you're building a tool that needs to, this is a sensible place to start. The project is actively maintained (the README notes they're hiring), and the multiple integration paths—online, self-hosted, Zotero—mean you can pick the workflow that fits. Worth a look if academic PDFs are part of your daily life.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: babeldocLast updated: November 8, 2026 at 02:50 AM