yihong0618 /bilingual_book_maker

Make bilingual epub books Using AI translate

★ 9,941⑂ 1,300👁 51⑃ 237● 304▤ 10
PythonMITCreated 2023-03-02
下载:v1.3.2v1.3.2 ↓1.3.22026-10-30
+1
日增长
9,941
stars
1,300
forks
51
watchers
237
prs
304
issues
10
releases

README

Bilingual Book Maker

中文 | English


The bilingual_book_maker is an AI translation tool that uses ChatGPT to assist users in creating multi-language versions of epub/txt/md/srt/pdf files and books. Use it only with material you have the right to translate — works for which you hold the necessary rights, suitably licensed or permitted works, public-domain books, or uses otherwise allowed by applicable law. Before using this tool, please review the project's disclaimer.

Guides for every file type and option, and the measurements behind the defaults, are on the wiki. If you use a coding agent (Codex, Claude Code), the repository's skill translates a book for you: Translate with an agent.












!image

 Supported endpoints

OpenAI and Anthropic format endpoints are supported.
Usually it comes with three fields, two if you are using the official endpoints, such as gpt-6-luna (the default)
or claude-sonnet-4-6. 
Specify openai, or anthropic at --api_format for API request formats.
This argument also supports selecting some translation services (google, caiyun, deepl, deeplfree,
tencent, customapi — not an OpenAI format) or codex
if you want to use your Codex quota instead. 

--provider is an alternative way to pass credentials, through a JSON config file
bbm_providers.json. 

Epub tags classification is auto enabled on JSON-schema endpoints, and on any endpoint that can hold a conversation — the codex route and plain reseller proxies included — where the model is asked for exact skip/translate verdicts instead. Only routes with no conversation at all (the MT engines) fall back to translating p tags only, so some poetry or verse may be omitted there. See Plan mode for details.

Older flags (--model gpt4o,
--model gemini, --openai_key, …) still work: see
Models and languages.

 Preparation

1. ChatGPT or OpenAI token [^token]
2. epub/txt/md/pdf books
3. Environment with internet access or proxy
4. Python 3.10+

 Quick Start

A sample book, test_books/animal_farm.epub, is provided for testing purposes.
--test translates only its first few paragraphs.

shell
pip install -r requirements.txt       or: pip install -U bbook_maker


Then:

shell
cp bbm_providers.example.json bbm_providers.json
 edit base_url, default_models and env_key in ./bbm_providers.json
python3 make_book.py --book_name test_books/animal_farm.epub --provider openai --test --use_context session


You can also pass the key on the command line:

shell
python3 make_book.py --book_name test_books/animal_farm.epub \
  --key sk-... --model gpt-6-luna --api_base https://api.openai.com/v1 --test --use_context session


To spend a Codex subscription:

shell
python3 make_book.py --book_name test_books/animal_farm.epub --model gpt-6-luna --api_format codex --test


Or hand it to a coding agent

shell
git clone https://github.com/yihong0618/bilingual_book_maker.git
cd bilingual_book_maker
codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.epub into a bilingual Chinese-

Top issues

Discussions

Latest release

v1.3.2 v1.3.2 2026-10-30
What's Changed
 feat(docs): Integrate Jev through Cloudflare AI gateway as epub tag classifier by @pc418 in https://github.com/yihong0618/bilingual_book_maker/pull/580
 feat: Datalab as a --to-epub engine, Claude Message Batches (--batch-api) on Markdown and EPUB, bilingual --to-epub contents, reading-edition fixes by @pc418 in https://github.com/yihong0618/bilingual_book_maker/pull/581


Full Changelog: https://github.com/yihong0618/bilingual_book_maker/compare/v1.3.1...v1.3.2

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON