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.
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/PKG-INFO +7 -5
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/README.md +6 -4
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/__main__.py +1 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/classifier.py +10 -8
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/cli.py +198 -1910
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/codex_client.py +11 -2
- bbook_maker-1.3.4/book_maker/compat.py +1408 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/endpoints.py +385 -24
- bbook_maker-1.3.4/book_maker/files.py +49 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/legacy_cli.py +78 -46
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/base_loader.py +28 -24
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/model.py +3 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/epub_loader.py +475 -457
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/font_obfuscation.py +38 -21
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/helper.py +99 -89
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/md_loader.py +184 -100
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/pdf_loader.py +76 -60
- bbook_maker-1.3.4/book_maker/loader/plain_progress.py +63 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/plan.py +2 -5
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/rights.py +8 -0
- bbook_maker-1.3.4/book_maker/loader/srt_loader.py +306 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/txt_loader.py +63 -32
- bbook_maker-1.3.4/book_maker/pipeline/__main__.py +4 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/bundle.py +12 -22
- bbook_maker-1.3.4/book_maker/pipeline/cli.py +462 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/datalab.py +64 -21
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/docling_parser.py +18 -19
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_export.py +226 -81
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/errors.py +2 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/importer.py +85 -62
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/messages.py +141 -22
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_common.py +20 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_figures.py +77 -4
- bbook_maker-1.3.4/book_maker/pipeline/pdf_furniture.py +85 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_settings.py +20 -3
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/preflight.py +313 -24
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/reading_edition.py +259 -10
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/stages.py +12 -5
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/to_epub.py +32 -28
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/translate.py +393 -93
- bbook_maker-1.3.4/book_maker/prompt_options.py +176 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/provider_loader.py +28 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/redaction.py +19 -1
- bbook_maker-1.3.4/book_maker/request_retry.py +284 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/session_context.py +41 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/base_translator.py +138 -125
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/caiyun_translator.py +23 -15
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/capabilities.py +35 -132
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/chatgptapi_translator.py +165 -203
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/claude_batch.py +57 -39
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/claude_translator.py +311 -135
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/codex_translator.py +7 -10
- bbook_maker-1.3.4/book_maker/translator/contributions.py +46 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/custom_api_translator.py +26 -3
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/deepl_free_translator.py +14 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/deepl_translator.py +24 -18
- bbook_maker-1.3.4/book_maker/translator/gemini_translator.py +665 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/google_translator.py +28 -17
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/orcarouter_translator.py +4 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/qwen_translator.py +49 -69
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/reasoning.py +141 -21
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/tencent_transmart_translator.py +39 -6
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/vision.py +3 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/vendor/deeplx.py +11 -5
- bbook_maker-1.3.4/book_maker/zh_punctuation.py +545 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/pyproject.toml +1 -1
- bbook_maker-1.3.4/tests/ci_fake_make_book.py +35 -0
- bbook_maker-1.3.4/tests/epub3-samples-20230704.sha256 +45 -0
- bbook_maker-1.3.4/tests/fixtures/epub-progress-v3.pickle +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/hermetic/sitecustomize.py +0 -2
- bbook_maker-1.3.4/tests/smoke_installed_wheel.py +61 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_batch_groups_and_markers.py +1 -15
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_batch_layers.py +3 -12
- bbook_maker-1.3.4/tests/test_bilingual_export_refusal.py +381 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_bundle_pipeline.py +535 -36
- bbook_maker-1.3.4/tests/test_caiyun_offline.py +127 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_capabilities.py +70 -68
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_chatgptapi_translator.py +168 -40
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_ci_pdf_route_smoke.py +52 -11
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_classifier.py +19 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_claude_message_batches.py +356 -6
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_claude_session_context.py +230 -47
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_cli.py +228 -28
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_cli_documentation.py +1 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_codex_client.py +21 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_context_mode_cli.py +4 -33
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_corpus_epub_samples.py +4 -3
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_datalab_adapter.py +265 -4
- bbook_maker-1.3.4/tests/test_default_prompt.py +1112 -0
- bbook_maker-1.3.4/tests/test_delimiter_requests.py +149 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_disclosure.py +36 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_docling_adapter.py +10 -35
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_docs_to_wiki.py +33 -0
- bbook_maker-1.3.4/tests/test_endpoint_characterization.py +358 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_endpoints.py +63 -0
- bbook_maker-1.3.4/tests/test_epub_anchor_targets.py +29 -0
- bbook_maker-1.3.4/tests/test_epub_generated_navigation.py +413 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_loader_batch_translate.py +0 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_loader_correctness.py +400 -26
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_message_batches.py +6 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_nav.py +7 -6
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_output_validity.py +0 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_rights_loader.py +29 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epubcheck.py +1 -3
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_flag_compat.py +39 -4
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_font_obfuscation.py +228 -4
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_gemini_batch_translate.py +23 -20
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_general_grouping_and_json_degree.py +0 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_integration.py +0 -4
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_jev_classifier.py +1 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_legacy_cli.py +112 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_loader_compat_guards.py +0 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_md_loader.py +167 -27
- bbook_maker-1.3.4/tests/test_no_thinking.py +1046 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pandoc_version.py +4 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_figures.py +46 -15
- bbook_maker-1.3.4/tests/test_pdf_loader.py +102 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_ocr_engine.py +5 -9
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_ocr_replace_layer.py +3 -10
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_source_edit_guard.py +3 -16
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_structure_wiring.py +105 -14
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_to_epub_cli.py +45 -0
- bbook_maker-1.3.4/tests/test_plain_progress.py +156 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_plan_auto.py +212 -4
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_poetry_group_batching.py +3 -4
- bbook_maker-1.3.4/tests/test_preflight_lines.py +148 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompt_capture_server.py +38 -10
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompt_file.py +15 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompts_documented.py +12 -3
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_reading_edition_glossary.py +4 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_reading_edition_parallel.py +3 -2
- bbook_maker-1.3.4/tests/test_reading_edition_zh_punctuation.py +523 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_redaction.py +11 -0
- bbook_maker-1.3.4/tests/test_refuse_before_extraction.py +117 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_handoff_snapshot.py +3 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_mode_translator.py +3 -3
- bbook_maker-1.3.4/tests/test_srt_loader.py +239 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_structured_classify.py +2 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_to_epub_datalab_route.py +2 -1
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translate_with_backoff.py +4 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_identity_provider.py +6 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_identity_sidecar.py +8 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_metadata.py +1 -2
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_plan.py +26 -34
- bbook_maker-1.3.4/tests/test_translation_requests.py +671 -0
- bbook_maker-1.3.4/tests/test_translation_resume_endpoint.py +868 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translator_routes.py +14 -3
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_txt_loader.py +57 -7
- bbook_maker-1.3.4/tests/test_vendor_requests.py +968 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_vendored_deeplx.py +14 -3
- bbook_maker-1.3.4/tests/test_zh_punctuation.py +214 -0
- bbook_maker-1.3.2/book_maker/loader/srt_loader.py +0 -312
- bbook_maker-1.3.2/book_maker/translator/gemini_translator.py +0 -602
- bbook_maker-1.3.2/tests/test_no_thinking.py +0 -523
- bbook_maker-1.3.2/tests/test_pdf_loader.py +0 -64
- bbook_maker-1.3.2/tests/test_qwen_rate_limit.py +0 -11
- bbook_maker-1.3.2/tests/test_srt_loader.py +0 -109
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/LICENSE +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/__init__.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/config.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/glossary.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/__init__.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/__init__.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/agent.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/all.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/candidates.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/classify/session.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/disclosure.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/ledger.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/loader/markers.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/markdown_spans.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/__init__.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/datalab_markdown.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/decisions.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub.css +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_bilingual_nav.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_figures.lua +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/epub_nav.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_formula.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_headings.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/pdf_render.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/pipeline/progress.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/prompt_file.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/structured.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translation_checks.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translation_metadata.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/__init__.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/groq_translator.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/litellm_translator.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/translator/xai_translator.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/utils.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/book_maker/vendor/__init__.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/fixtures/glossary.txt +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/fixtures/jev_gateway_response.recorded.json +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/pipeline_helpers.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_async_translator.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_classify_prompt_documented.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_classify_prompt_pin.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_codex_translator.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_datalab_markdown.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_docker_pins.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_epub_metadata.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_functional_prompts.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_glossary.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_glossary_wiring.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_language_tag_and_name.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_cli.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_decisions.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_dependencies.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_formula.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_headings.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_layout.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_render.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_pdf_settings.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_prompt_sections.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_provider_loader.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_reading_edition_echo.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_rights.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_classify.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_session_context.py +0 -0
- {bbook_maker-1.3.2 → bbook_maker-1.3.4}/tests/test_translation_checks.py +0 -0
- {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.
|
|
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]"
|
|
@@ -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(
|
|
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(
|
|
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
|
|
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))
|