Documents#Translation

bilingual_book_maker: Turn Ebooks into Bilingual Side-by-Side Editions

A CLI tool that uses LLMs to turn epub, txt, srt, and PDF into bilingual editions, with multiple model providers and session mode for consistent names.

Project facts

GitHub Ecosystem
Repositorygithub.com/yihong0618/bilingual_book_maker
License
MIT
Language
Python
Stars
9,843
Data checked
2026-10-06

Snapshot figures reflect the check date and may change over time.

Translating an entire book takes a long time, and feeding it to a chatbot paragraph by paragraph makes it hard to keep names and terms consistent. bilingual_book_maker is an open-source command-line tool that calls LLMs like ChatGPT and Claude to turn epub, txt, srt, and pdf files into bilingual side-by-side editions you can drop straight into an e-reader. GitHubDaily recommended it in February 2025; as of October 6, 2026 the repo has 9,843 stars, with its most recent push on September 30.

Core features

  • Multiple input formats: covers epub, txt, md, srt, and pdf, outputting a _bilingual file.
  • PDF to bilingual EPUB: --to-epub converts a PDF into a reflowable, table-of-contents-equipped bilingual EPUB, with each paragraph followed by its translation and figures/formulas kept as images; it needs the PDF extra and Pandoc 3.1.12+, and --pdf-ocr handles scans with no text layer.
  • Multiple model providers: compatible with the OpenAI and Anthropic API formats, plus Gemini, Qwen-MT, Groq, xAI, OrcaRouter, Ollama, and LiteLLM; a Codex subscription quota also works, or define any OpenAI/Anthropic-compatible provider yourself via a JSON config.
  • Translation planning (Plan mode): by default, epub tags are classified up front so the model decides whether poetry, lists, and table cells need translating, catching what a naive pass would miss; --plan-dry-run previews the plan with no API key, and --plan-classify agent hands the decision to you or a coding agent before translating.
  • Session mode: --use_context session shares one translation history across the whole book so names and terminology stay consistent, auto-compacting into a handoff summary once it passes --context-compact-at (8192 tokens by default).
  • Resumable and parallel: interrupted runs can resume, and multiple workers can process chapters and segments concurrently.

Typical use cases

  • Turning public-domain ebooks into Chinese-English or other multilingual side-by-side editions for reading in an e-reader.
  • Translating an English paper PDF: test two pages with --pages 1-2 first, then run the whole file into a table-of-contents bilingual EPUB.
  • Batch-translating TXT or Markdown documents, or producing multilingual versions of SRT subtitles.
  • Handing the whole job to a coding agent: clone the repo and tell Claude Code or Codex to “use bbm-plan to translate this book into a bilingual Chinese-English edition,” which runs the repo’s own agent skill.
  • Testing the output first via a free engine — Google, Tencent TranSmart, or the DeepL free tier — with no API key required.

Quick start

pip install -U bbook_maker
cp bbm_providers.example.json bbm_providers.json  # fill in your keys
python3 make_book.py --book_name test_books/animal_farm.epub --provider openai --test --use_context session

If you’d rather skip setting up the environment, prebuilt Docker images are available — mount the folder with your book at /book:

docker pull ghcr.io/yihong0618/bilingual_book_maker:latest
docker run --rm -v "/path/to/books":/book ghcr.io/yihong0618/bilingual_book_maker:latest --book_name "/book/animal_farm.epub" --key "sk-XXX" --language zh-hans

Summary

This suits readers, translators, and developers who want to make their own bilingual books, documents, or subtitles, including handing the whole run to a coding agent; if you only need an English paper PDF translated rather than a full ebook, BabelDOC preserves academic layout more directly. The project is MIT-licensed and actively maintained; the LLM path requires your own API key and Python 3.10 or newer, and the PDF-to-EPUB feature needs Pandoc and extra PDF dependencies on top, making that install noticeably larger. The README includes a disclaimer: only translate content you’re authorized to use or that’s in the public domain.