Convert a public-domain EPUB into a bilingual edition with original and translated paragraphs side by side
Translate an SRT subtitle file into a bilingual version for language study using DeepL or GPT
Process a text file into a bilingual learning document using a local Ollama model at zero API cost
Create a bilingual PDF study copy from a document you have the rights to translate
Requires an API key from your chosen translation provider (OpenAI, Claude, DeepL, etc.) or a running Ollama instance.
Bilingual Book Maker is a Python tool that takes an ebook or text file and produces a version where every passage appears in both the original language and a translation side by side. You give it a file, tell it which AI service to use for translation, and it outputs a new file with both languages woven together. The tool supports epub, txt, srt, and pdf formats as input. The translation can be done through a wide range of AI services. The default is OpenAI's GPT models, but the tool also supports Claude, Google Gemini, DeepL, Google Translate, Alibaba's Qwen, Groq, Ollama for self-hosted models, xAI, and several others. You can even define custom providers through a JSON configuration file if you use an OpenAI-compatible API that is not built in. For most services, you need an API key from the provider, which you either pass as a command-line argument or set as an environment variable. The output file is named after the original with a bilingual suffix added. For an epub input you get a bilingual epub back, for text or subtitle files you get bilingual text output. The tool inserts a small amount of context from surrounding paragraphs with each translation request, which can help the AI produce more coherent results across a long text. The project is specifically designed for public domain works and materials you have the right to translate. The repository includes a disclaimer making clear it is not intended for copyrighted books you do not have permission to work with. A sample copy of Animal Farm is included for testing, since that book is in the public domain. To get started, you install the dependencies with pip and then run the make_book.py script with the path to your file and the API key for your chosen translation service. The tool is also available as an installable package called bbook_maker from PyPI if you prefer not to run it directly from the source.
← yihong0618 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.