bbook-maker 1.3.2__tar.gz → 1.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/PKG-INFO +7 -5
  2. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/README.md +6 -4
  3. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/__main__.py +1 -1
  4. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/classifier.py +10 -8
  5. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/cli.py +198 -1910
  6. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/codex_client.py +11 -2
  7. bbook_maker-1.3.4/book_maker/compat.py +1408 -0
  8. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/endpoints.py +385 -24
  9. bbook_maker-1.3.4/book_maker/files.py +49 -0
  10. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/legacy_cli.py +78 -46
  11. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/base_loader.py +28 -24
  12. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/model.py +3 -1
  13. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/epub_loader.py +475 -457
  14. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/font_obfuscation.py +38 -21
  15. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/helper.py +99 -89
  16. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/md_loader.py +184 -100
  17. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/pdf_loader.py +76 -60
  18. bbook_maker-1.3.4/book_maker/loader/plain_progress.py +63 -0
  19. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/plan.py +2 -5
  20. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/rights.py +8 -0
  21. bbook_maker-1.3.4/book_maker/loader/srt_loader.py +306 -0
  22. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/txt_loader.py +63 -32
  23. bbook_maker-1.3.4/book_maker/pipeline/__main__.py +4 -0
  24. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/bundle.py +12 -22
  25. bbook_maker-1.3.4/book_maker/pipeline/cli.py +462 -0
  26. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/datalab.py +64 -21
  27. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/docling_parser.py +18 -19
  28. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_export.py +226 -81
  29. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/errors.py +2 -1
  30. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/importer.py +85 -62
  31. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/messages.py +141 -22
  32. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_common.py +20 -1
  33. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_figures.py +77 -4
  34. bbook_maker-1.3.4/book_maker/pipeline/pdf_furniture.py +85 -0
  35. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_settings.py +20 -3
  36. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/preflight.py +313 -24
  37. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/reading_edition.py +259 -10
  38. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/stages.py +12 -5
  39. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/to_epub.py +32 -28
  40. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/translate.py +393 -93
  41. bbook_maker-1.3.4/book_maker/prompt_options.py +176 -0
  42. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/provider_loader.py +28 -1
  43. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/redaction.py +19 -1
  44. bbook_maker-1.3.4/book_maker/request_retry.py +284 -0
  45. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/session_context.py +41 -0
  46. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/base_translator.py +138 -125
  47. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/caiyun_translator.py +23 -15
  48. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/capabilities.py +35 -132
  49. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/chatgptapi_translator.py +165 -203
  50. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/claude_batch.py +57 -39
  51. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/claude_translator.py +311 -135
  52. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/codex_translator.py +7 -10
  53. bbook_maker-1.3.4/book_maker/translator/contributions.py +46 -0
  54. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/custom_api_translator.py +26 -3
  55. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/deepl_free_translator.py +14 -1
  56. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/deepl_translator.py +24 -18
  57. bbook_maker-1.3.4/book_maker/translator/gemini_translator.py +665 -0
  58. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/google_translator.py +28 -17
  59. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/orcarouter_translator.py +4 -1
  60. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/qwen_translator.py +49 -69
  61. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/reasoning.py +141 -21
  62. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/tencent_transmart_translator.py +39 -6
  63. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/vision.py +3 -0
  64. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/vendor/deeplx.py +11 -5
  65. bbook_maker-1.3.4/book_maker/zh_punctuation.py +545 -0
  66. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/pyproject.toml +1 -1
  67. bbook_maker-1.3.4/tests/ci_fake_make_book.py +35 -0
  68. bbook_maker-1.3.4/tests/epub3-samples-20230704.sha256 +45 -0
  69. bbook_maker-1.3.4/tests/fixtures/epub-progress-v3.pickle +0 -0
  70. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/hermetic/sitecustomize.py +0 -2
  71. bbook_maker-1.3.4/tests/smoke_installed_wheel.py +61 -0
  72. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_batch_groups_and_markers.py +1 -15
  73. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_batch_layers.py +3 -12
  74. bbook_maker-1.3.4/tests/test_bilingual_export_refusal.py +381 -0
  75. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_bundle_pipeline.py +535 -36
  76. bbook_maker-1.3.4/tests/test_caiyun_offline.py +127 -0
  77. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_capabilities.py +70 -68
  78. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_chatgptapi_translator.py +168 -40
  79. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_ci_pdf_route_smoke.py +52 -11
  80. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_classifier.py +19 -0
  81. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_claude_message_batches.py +356 -6
  82. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_claude_session_context.py +230 -47
  83. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_cli.py +228 -28
  84. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_cli_documentation.py +1 -1
  85. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_codex_client.py +21 -0
  86. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_context_mode_cli.py +4 -33
  87. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_corpus_epub_samples.py +4 -3
  88. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_datalab_adapter.py +265 -4
  89. bbook_maker-1.3.4/tests/test_default_prompt.py +1112 -0
  90. bbook_maker-1.3.4/tests/test_delimiter_requests.py +149 -0
  91. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_disclosure.py +36 -2
  92. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_docling_adapter.py +10 -35
  93. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_docs_to_wiki.py +33 -0
  94. bbook_maker-1.3.4/tests/test_endpoint_characterization.py +358 -0
  95. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_endpoints.py +63 -0
  96. bbook_maker-1.3.4/tests/test_epub_anchor_targets.py +29 -0
  97. bbook_maker-1.3.4/tests/test_epub_generated_navigation.py +413 -0
  98. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_loader_batch_translate.py +0 -2
  99. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_loader_correctness.py +400 -26
  100. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_message_batches.py +6 -2
  101. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_nav.py +7 -6
  102. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_output_validity.py +0 -1
  103. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_rights_loader.py +29 -0
  104. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epubcheck.py +1 -3
  105. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_flag_compat.py +39 -4
  106. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_font_obfuscation.py +228 -4
  107. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_gemini_batch_translate.py +23 -20
  108. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_general_grouping_and_json_degree.py +0 -2
  109. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_integration.py +0 -4
  110. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_jev_classifier.py +1 -1
  111. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_legacy_cli.py +112 -0
  112. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_loader_compat_guards.py +0 -2
  113. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_md_loader.py +167 -27
  114. bbook_maker-1.3.4/tests/test_no_thinking.py +1046 -0
  115. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pandoc_version.py +4 -1
  116. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_figures.py +46 -15
  117. bbook_maker-1.3.4/tests/test_pdf_loader.py +102 -0
  118. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_ocr_engine.py +5 -9
  119. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_ocr_replace_layer.py +3 -10
  120. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_source_edit_guard.py +3 -16
  121. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_structure_wiring.py +105 -14
  122. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_to_epub_cli.py +45 -0
  123. bbook_maker-1.3.4/tests/test_plain_progress.py +156 -0
  124. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_plan_auto.py +212 -4
  125. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_poetry_group_batching.py +3 -4
  126. bbook_maker-1.3.4/tests/test_preflight_lines.py +148 -0
  127. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompt_capture_server.py +38 -10
  128. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompt_file.py +15 -0
  129. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompts_documented.py +12 -3
  130. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_reading_edition_glossary.py +4 -2
  131. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_reading_edition_parallel.py +3 -2
  132. bbook_maker-1.3.4/tests/test_reading_edition_zh_punctuation.py +523 -0
  133. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_redaction.py +11 -0
  134. bbook_maker-1.3.4/tests/test_refuse_before_extraction.py +117 -0
  135. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_handoff_snapshot.py +3 -1
  136. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_mode_translator.py +3 -3
  137. bbook_maker-1.3.4/tests/test_srt_loader.py +239 -0
  138. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_structured_classify.py +2 -2
  139. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_to_epub_datalab_route.py +2 -1
  140. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translate_with_backoff.py +4 -2
  141. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_identity_provider.py +6 -2
  142. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_identity_sidecar.py +8 -2
  143. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_metadata.py +1 -2
  144. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_plan.py +26 -34
  145. bbook_maker-1.3.4/tests/test_translation_requests.py +671 -0
  146. bbook_maker-1.3.4/tests/test_translation_resume_endpoint.py +868 -0
  147. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translator_routes.py +14 -3
  148. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_txt_loader.py +57 -7
  149. bbook_maker-1.3.4/tests/test_vendor_requests.py +968 -0
  150. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_vendored_deeplx.py +14 -3
  151. bbook_maker-1.3.4/tests/test_zh_punctuation.py +214 -0
  152. bbook_maker-1.3.2/book_maker/loader/srt_loader.py +0 -312
  153. bbook_maker-1.3.2/book_maker/translator/gemini_translator.py +0 -602
  154. bbook_maker-1.3.2/tests/test_no_thinking.py +0 -523
  155. bbook_maker-1.3.2/tests/test_pdf_loader.py +0 -64
  156. bbook_maker-1.3.2/tests/test_qwen_rate_limit.py +0 -11
  157. bbook_maker-1.3.2/tests/test_srt_loader.py +0 -109
  158. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/LICENSE +0 -0
  159. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/__init__.py +0 -0
  160. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/config.py +0 -0
  161. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/glossary.py +0 -0
  162. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/__init__.py +0 -0
  163. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/__init__.py +0 -0
  164. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/agent.py +0 -0
  165. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/all.py +0 -0
  166. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/candidates.py +0 -0
  167. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/session.py +0 -0
  168. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/disclosure.py +0 -0
  169. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/ledger.py +0 -0
  170. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/markers.py +0 -0
  171. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/markdown_spans.py +0 -0
  172. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/__init__.py +0 -0
  173. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/datalab_markdown.py +0 -0
  174. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/decisions.py +0 -0
  175. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub.css +0 -0
  176. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_bilingual_nav.py +0 -0
  177. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_figures.lua +0 -0
  178. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_nav.py +0 -0
  179. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_formula.py +0 -0
  180. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_headings.py +0 -0
  181. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_render.py +0 -0
  182. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/progress.py +0 -0
  183. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/prompt_file.py +0 -0
  184. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/structured.py +0 -0
  185. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translation_checks.py +0 -0
  186. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translation_metadata.py +0 -0
  187. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/__init__.py +0 -0
  188. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/groq_translator.py +0 -0
  189. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/litellm_translator.py +0 -0
  190. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/xai_translator.py +0 -0
  191. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/utils.py +0 -0
  192. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/vendor/__init__.py +0 -0
  193. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/fixtures/glossary.txt +0 -0
  194. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/fixtures/jev_gateway_response.recorded.json +0 -0
  195. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/pipeline_helpers.py +0 -0
  196. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_async_translator.py +0 -0
  197. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_classify_prompt_documented.py +0 -0
  198. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_classify_prompt_pin.py +0 -0
  199. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_codex_translator.py +0 -0
  200. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_datalab_markdown.py +0 -0
  201. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_docker_pins.py +0 -0
  202. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_metadata.py +0 -0
  203. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_functional_prompts.py +0 -0
  204. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_glossary.py +0 -0
  205. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_glossary_wiring.py +0 -0
  206. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_language_tag_and_name.py +0 -0
  207. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_cli.py +0 -0
  208. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_decisions.py +0 -0
  209. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_dependencies.py +0 -0
  210. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_formula.py +0 -0
  211. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_headings.py +0 -0
  212. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_layout.py +0 -0
  213. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_render.py +0 -0
  214. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_settings.py +0 -0
  215. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompt_sections.py +0 -0
  216. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_provider_loader.py +0 -0
  217. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_reading_edition_echo.py +0 -0
  218. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_rights.py +0 -0
  219. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_classify.py +0 -0
  220. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_context.py +0 -0
  221. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_checks.py +0 -0
  222. {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_vision.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bbook-maker
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: The bilingual_book_maker is an AI translation tool that uses ChatGPT to assist users in creating multi-language versions of epub/txt files and books.
5
5
  Author-Email: yihong0618 <zouzou0208@gmail.com>
6
6
  License: MIT
@@ -307,7 +307,7 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
307
307
 
308
308
  Priority: project-level `./bbm_providers.json` overrides global `~/.bbm/providers.json`.
309
309
 
310
- `--model` names a model at that provider; without it the first of `default_models` is used.
310
+ `--model` names a model at that provider; without it the first of `default_models` is used, or, when it lists several, the run rotates across them, the first one first.
311
311
 
312
312
  ```shell
313
313
  python3 make_book.py --provider siliconflow --key sk-xxx --book_name test_books/animal_farm.epub --use_context session
@@ -474,7 +474,7 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
474
474
 
475
475
  - You can also set the `user` and `system` role prompt by setting environment variables: `BBM_CHATGPTAPI_USER_MSG_TEMPLATE` and `BBM_CHATGPTAPI_SYS_MSG`.
476
476
 
477
- - An example JSON file can be found at [./prompt_template.json](./prompt_template.json).
477
+ - An example JSON file can be found at [./prompt_template.json](./prompt_template.json). Without `--prompt`, the openai-format, Claude and Gemini routes send this file's `system` and `user` text as their default prompt.
478
478
 
479
479
  - `--batch_size`:
480
480
 
@@ -581,6 +581,8 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
581
581
 
582
582
  Turn a PDF into a bilingual EPUB with a table of contents. See [PDF to bilingual EPUB](#pdf-to-bilingual-epub).
583
583
 
584
+ - `--no-zh-punctuation`: keep the translation's punctuation as the model wrote it. By default, for a Chinese target, ASCII `, : ; ! ? ( )` next to Chinese text are written full-width. For a finished bundle: `python -m book_maker.pipeline punctuation <bundle>`, then `export`.
585
+
584
586
  - `--sentence_mode`:
585
587
 
586
588
  Translate EPUB text sentence by sentence instead of translating each paragraph as one
@@ -622,7 +624,7 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
622
624
  - `--no-thinking`:
623
625
 
624
626
  Ask a reasoning model not to think before answering; on a paragraph of
625
- prose it buys nothing and costs tokens and time.
627
+ prose it buys nothing and costs tokens and time. A small model may answer a very short text, such as a title, with a remark instead of a translation when it cannot think.
626
628
 
627
629
  ```shell
628
630
  python3 make_book.py --book_name test_books/animal_farm.epub --key ${openai_key} --no-thinking
@@ -789,7 +791,7 @@ python3 make_book.py --book_name my_book.epub --key ${key} --plan-classify agent
789
791
 
790
792
  ### PDF to **bilingual** EPUB
791
793
 
792
- `--to-epub` turns a PDF into a reflowable bilingual EPUB with a table of contents: every paragraph followed by its translation, figures and display formulas kept as pictures. It needs the PDF extra, installed from a clone, and [Pandoc](https://pandoc.org/installing.html) 3.1.12 or newer; see [Installing the PDF extra](https://github.com/yihong0618/bilingual_book_maker/wiki/Installing-the-PDF-extra).
794
+ `--to-epub` turns a PDF into a reflowable bilingual EPUB with a table of contents: every paragraph followed by its translation, figures and display formulas kept as pictures. It needs the PDF extra, installed from a clone or from PyPI (`pip install "bbook_maker[pdf]"`), and [Pandoc](https://pandoc.org/installing.html) 3.1.12 or newer; see [Installing the PDF extra](https://github.com/yihong0618/bilingual_book_maker/wiki/Installing-the-PDF-extra).
793
795
 
794
796
  ```shell
795
797
  pip install ".[pdf]"
@@ -274,7 +274,7 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
274
274
 
275
275
  Priority: project-level `./bbm_providers.json` overrides global `~/.bbm/providers.json`.
276
276
 
277
- `--model` names a model at that provider; without it the first of `default_models` is used.
277
+ `--model` names a model at that provider; without it the first of `default_models` is used, or, when it lists several, the run rotates across them, the first one first.
278
278
 
279
279
  ```shell
280
280
  python3 make_book.py --provider siliconflow --key sk-xxx --book_name test_books/animal_farm.epub --use_context session
@@ -441,7 +441,7 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
441
441
 
442
442
  - You can also set the `user` and `system` role prompt by setting environment variables: `BBM_CHATGPTAPI_USER_MSG_TEMPLATE` and `BBM_CHATGPTAPI_SYS_MSG`.
443
443
 
444
- - An example JSON file can be found at [./prompt_template.json](./prompt_template.json).
444
+ - An example JSON file can be found at [./prompt_template.json](./prompt_template.json). Without `--prompt`, the openai-format, Claude and Gemini routes send this file's `system` and `user` text as their default prompt.
445
445
 
446
446
  - `--batch_size`:
447
447
 
@@ -548,6 +548,8 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
548
548
 
549
549
  Turn a PDF into a bilingual EPUB with a table of contents. See [PDF to bilingual EPUB](#pdf-to-bilingual-epub).
550
550
 
551
+ - `--no-zh-punctuation`: keep the translation's punctuation as the model wrote it. By default, for a Chinese target, ASCII `, : ; ! ? ( )` next to Chinese text are written full-width. For a finished bundle: `python -m book_maker.pipeline punctuation <bundle>`, then `export`.
552
+
551
553
  - `--sentence_mode`:
552
554
 
553
555
  Translate EPUB text sentence by sentence instead of translating each paragraph as one
@@ -589,7 +591,7 @@ codex "Hi, please use bbm-plan to translate this book: test_books/animal_farm.ep
589
591
  - `--no-thinking`:
590
592
 
591
593
  Ask a reasoning model not to think before answering; on a paragraph of
592
- prose it buys nothing and costs tokens and time.
594
+ prose it buys nothing and costs tokens and time. A small model may answer a very short text, such as a title, with a remark instead of a translation when it cannot think.
593
595
 
594
596
  ```shell
595
597
  python3 make_book.py --book_name test_books/animal_farm.epub --key ${openai_key} --no-thinking
@@ -756,7 +758,7 @@ python3 make_book.py --book_name my_book.epub --key ${key} --plan-classify agent
756
758
 
757
759
  ### PDF to **bilingual** EPUB
758
760
 
759
- `--to-epub` turns a PDF into a reflowable bilingual EPUB with a table of contents: every paragraph followed by its translation, figures and display formulas kept as pictures. It needs the PDF extra, installed from a clone, and [Pandoc](https://pandoc.org/installing.html) 3.1.12 or newer; see [Installing the PDF extra](https://github.com/yihong0618/bilingual_book_maker/wiki/Installing-the-PDF-extra).
761
+ `--to-epub` turns a PDF into a reflowable bilingual EPUB with a table of contents: every paragraph followed by its translation, figures and display formulas kept as pictures. It needs the PDF extra, installed from a clone or from PyPI (`pip install "bbook_maker[pdf]"`), and [Pandoc](https://pandoc.org/installing.html) 3.1.12 or newer; see [Installing the PDF extra](https://github.com/yihong0618/bilingual_book_maker/wiki/Installing-the-PDF-extra).
760
762
 
761
763
  ```shell
762
764
  pip install ".[pdf]"
@@ -1,4 +1,4 @@
1
- from cli import main
1
+ from .cli import main
2
2
 
3
3
  if __name__ == "__main__":
4
4
  main()
@@ -41,6 +41,8 @@ import time
41
41
  from dataclasses import dataclass, field
42
42
 
43
43
  from .endpoints import JEV_PATH # noqa: F401 (re-exported for callers)
44
+ from .redaction import public_address
45
+ from .request_retry import RequestRefused, is_refusal, refused_by_provider
44
46
 
45
47
  # --------------------------------------------------------------------------
46
48
  # The question and the answer
@@ -162,7 +164,9 @@ def has_schema_verdict(translator, model=None):
162
164
  return False
163
165
  try:
164
166
  verdict = probe(model) if model else probe()
165
- except Exception:
167
+ except Exception as err:
168
+ if refused_by_provider(err):
169
+ raise
166
170
  return False
167
171
  return verdict in ("strict", "shape", "json")
168
172
 
@@ -495,10 +499,11 @@ class Classifier:
495
499
  return getattr(self.translator, "usage", None)
496
500
 
497
501
  def where(self):
502
+ """The address to print, without URL userinfo or a query string."""
498
503
  base = self.base
499
504
  if base is None:
500
505
  base = getattr(self.translator, "api_base", None)
501
- return base or "the endpoint's default host"
506
+ return public_address(base) or "the endpoint's default host"
502
507
 
503
508
  def describe(self, backend=None):
504
509
  """`"gpt-6-luna at https://... via schema (cli)"`."""
@@ -546,9 +551,6 @@ JEV_TIMEOUT = 120
546
551
  # the errors stay non-fatal (owner ruling 260907: patient waits, capped per
547
552
  # wait, never in attempts). A `retry-after` header is honoured up to it.
548
553
  JEV_WAIT_CAP = 120
549
- # Statuses that are the request's own fault: asking again sends the same
550
- # thing and gets the same answer.
551
- JEV_FATAL_STATUSES = frozenset({400, 401, 403, 404, 405, 413, 422})
552
554
 
553
555
 
554
556
  def parse_min_confidence(raw):
@@ -585,7 +587,7 @@ def jev_min_confidence(flag=None):
585
587
  raise SystemExit(f"{JEV_MIN_CONFIDENCE_ENV} {err}")
586
588
 
587
589
 
588
- class JevFatal(Exception):
590
+ class JevFatal(RequestRefused):
589
591
  """TypeSafe refused the request itself (a key, a malformed question)."""
590
592
 
591
593
 
@@ -800,7 +802,7 @@ class JevBackend:
800
802
  status = response.status_code
801
803
  if status == 200:
802
804
  return response.json()
803
- detail = redact((getattr(response, "text", "") or "")[:300])
805
+ detail = redact(getattr(response, "text", "") or "")[:300]
804
806
  if 300 <= status < 400:
805
807
  where = (getattr(response, "headers", None) or {}).get(
806
808
  "location", "no location"
@@ -810,7 +812,7 @@ class JevBackend:
810
812
  "redirects are not followed, so name the final address "
811
813
  "with --classify-base-url"
812
814
  )
813
- if status in JEV_FATAL_STATUSES:
815
+ if is_refusal(status):
814
816
  raise JevFatal(f"jev answered {status}: {detail}")
815
817
  why = f"HTTP {status}: {detail}"
816
818
  retry_after = _retry_after(getattr(response, "headers", None))