openbooktranslation 0.1.0__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 (665) hide show
  1. openbooktranslation-0.1.0/.gitignore +47 -0
  2. openbooktranslation-0.1.0/CHANGELOG.md +53 -0
  3. openbooktranslation-0.1.0/CONTRIBUTING.md +122 -0
  4. openbooktranslation-0.1.0/LICENSE +201 -0
  5. openbooktranslation-0.1.0/PKG-INFO +185 -0
  6. openbooktranslation-0.1.0/README.md +136 -0
  7. openbooktranslation-0.1.0/docs/adr/0001-python-and-uv.md +42 -0
  8. openbooktranslation-0.1.0/docs/adr/0002-llm-engines-via-user-owned-cli-no-credentials.md +53 -0
  9. openbooktranslation-0.1.0/docs/adr/0003-epub-in-place-xhtml-rewrite-zip-lxml.md +27 -0
  10. openbooktranslation-0.1.0/docs/adr/0004-frontend-sveltekit-static-foliate-js.md +36 -0
  11. openbooktranslation-0.1.0/docs/adr/0005-local-storage-project-folder-sqlite.md +33 -0
  12. openbooktranslation-0.1.0/docs/adr/0006-license-apache-2.md +21 -0
  13. openbooktranslation-0.1.0/docs/adr/0007-pdf-import-via-docling-converted-to-epub.md +44 -0
  14. openbooktranslation-0.1.0/docs/adr/0008-ereader-optimization-pass.md +39 -0
  15. openbooktranslation-0.1.0/docs/adr/0009-frontend-react-shadcn.md +61 -0
  16. openbooktranslation-0.1.0/docs/adr/0010-api-key-in-os-keychain.md +68 -0
  17. openbooktranslation-0.1.0/docs/adr/0011-opt-in-update-check.md +42 -0
  18. openbooktranslation-0.1.0/docs/adr/0012-guided-engine-setup.md +43 -0
  19. openbooktranslation-0.1.0/docs/adr/0013-pdf-export-with-typst.md +49 -0
  20. openbooktranslation-0.1.0/docs/adr/0014-translated-title-and-export-file-names.md +57 -0
  21. openbooktranslation-0.1.0/docs/adr/README.md +30 -0
  22. openbooktranslation-0.1.0/docs/architecture.md +708 -0
  23. openbooktranslation-0.1.0/docs/case-study.md +89 -0
  24. openbooktranslation-0.1.0/docs/epics/E00-foundation.md +154 -0
  25. openbooktranslation-0.1.0/docs/epics/E01-document-model-and-formats.md +143 -0
  26. openbooktranslation-0.1.0/docs/epics/E02-project-storage.md +125 -0
  27. openbooktranslation-0.1.0/docs/epics/E03-engines.md +152 -0
  28. openbooktranslation-0.1.0/docs/epics/E04-pipeline-core-and-cli.md +179 -0
  29. openbooktranslation-0.1.0/docs/epics/E05-web-api.md +155 -0
  30. openbooktranslation-0.1.0/docs/epics/E06-web-ui.md +152 -0
  31. openbooktranslation-0.1.0/docs/epics/E07-quality-stages.md +126 -0
  32. openbooktranslation-0.1.0/docs/epics/E08-more-input-formats.md +102 -0
  33. openbooktranslation-0.1.0/docs/epics/E09-more-engines.md +105 -0
  34. openbooktranslation-0.1.0/docs/epics/E10-packaging-and-release.md +125 -0
  35. openbooktranslation-0.1.0/docs/epics/E11-ereader-optimized-export.md +167 -0
  36. openbooktranslation-0.1.0/docs/epics/E12-api-for-ui-v2.md +232 -0
  37. openbooktranslation-0.1.0/docs/epics/E13-web-ui-v2.md +305 -0
  38. openbooktranslation-0.1.0/docs/epics/E14-installer-and-updates.md +131 -0
  39. openbooktranslation-0.1.0/docs/epics/E15-guided-engine-setup.md +182 -0
  40. openbooktranslation-0.1.0/docs/epics/E16-pdf-export-and-translated-titles.md +173 -0
  41. openbooktranslation-0.1.0/docs/epics/README.md +96 -0
  42. openbooktranslation-0.1.0/docs/testing.md +153 -0
  43. openbooktranslation-0.1.0/docs/user-guide.md +542 -0
  44. openbooktranslation-0.1.0/pyproject.toml +238 -0
  45. openbooktranslation-0.1.0/scripts/check_dist.py +221 -0
  46. openbooktranslation-0.1.0/scripts/hatch_build.py +81 -0
  47. openbooktranslation-0.1.0/scripts/install/install.ps1 +135 -0
  48. openbooktranslation-0.1.0/scripts/install/install.sh +155 -0
  49. openbooktranslation-0.1.0/scripts/installer_e2e.py +235 -0
  50. openbooktranslation-0.1.0/scripts/make_icons.py +71 -0
  51. openbooktranslation-0.1.0/scripts/release_notes.py +82 -0
  52. openbooktranslation-0.1.0/scripts/wheel_smoke.py +316 -0
  53. openbooktranslation-0.1.0/src/openbooktranslation/__init__.py +10 -0
  54. openbooktranslation-0.1.0/src/openbooktranslation/__main__.py +6 -0
  55. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-128.png +0 -0
  56. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-16.png +0 -0
  57. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-256.png +0 -0
  58. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-32.png +0 -0
  59. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-48.png +0 -0
  60. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-512.png +0 -0
  61. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation-64.png +0 -0
  62. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation.icns +0 -0
  63. openbooktranslation-0.1.0/src/openbooktranslation/assets/icons/openbooktranslation.ico +0 -0
  64. openbooktranslation-0.1.0/src/openbooktranslation/cli.py +1426 -0
  65. openbooktranslation-0.1.0/src/openbooktranslation/desktop.py +449 -0
  66. openbooktranslation-0.1.0/src/openbooktranslation/engines/__init__.py +59 -0
  67. openbooktranslation-0.1.0/src/openbooktranslation/engines/anthropic_api.py +294 -0
  68. openbooktranslation-0.1.0/src/openbooktranslation/engines/base.py +224 -0
  69. openbooktranslation-0.1.0/src/openbooktranslation/engines/claude_subscription.py +442 -0
  70. openbooktranslation-0.1.0/src/openbooktranslation/engines/codex_cli.py +392 -0
  71. openbooktranslation-0.1.0/src/openbooktranslation/engines/credentials.py +293 -0
  72. openbooktranslation-0.1.0/src/openbooktranslation/engines/errors.py +90 -0
  73. openbooktranslation-0.1.0/src/openbooktranslation/engines/fake.py +185 -0
  74. openbooktranslation-0.1.0/src/openbooktranslation/engines/gemini_cli.py +401 -0
  75. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/__init__.py +9 -0
  76. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/log.py +71 -0
  77. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/plan.py +146 -0
  78. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/recipes.py +360 -0
  79. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/runner.py +339 -0
  80. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/signin.py +50 -0
  81. openbooktranslation-0.1.0/src/openbooktranslation/engines/install/terminal.py +148 -0
  82. openbooktranslation-0.1.0/src/openbooktranslation/engines/locate.py +311 -0
  83. openbooktranslation-0.1.0/src/openbooktranslation/engines/models.py +108 -0
  84. openbooktranslation-0.1.0/src/openbooktranslation/engines/ollama.py +460 -0
  85. openbooktranslation-0.1.0/src/openbooktranslation/engines/output.py +182 -0
  86. openbooktranslation-0.1.0/src/openbooktranslation/engines/registry.py +226 -0
  87. openbooktranslation-0.1.0/src/openbooktranslation/engines/subprocess_cli.py +339 -0
  88. openbooktranslation-0.1.0/src/openbooktranslation/formats/__init__.py +1 -0
  89. openbooktranslation-0.1.0/src/openbooktranslation/formats/base.py +268 -0
  90. openbooktranslation-0.1.0/src/openbooktranslation/formats/docx.py +928 -0
  91. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/__init__.py +1 -0
  92. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/bilingual.py +433 -0
  93. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/builder.py +736 -0
  94. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/cover.py +197 -0
  95. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/ereader.py +1471 -0
  96. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/metadata.py +265 -0
  97. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/ncx.py +73 -0
  98. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/reader.py +283 -0
  99. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/segmenter.py +316 -0
  100. openbooktranslation-0.1.0/src/openbooktranslation/formats/epub/writer.py +284 -0
  101. openbooktranslation-0.1.0/src/openbooktranslation/formats/errors.py +44 -0
  102. openbooktranslation-0.1.0/src/openbooktranslation/formats/pdf.py +721 -0
  103. openbooktranslation-0.1.0/src/openbooktranslation/formats/pdf_export/__init__.py +84 -0
  104. openbooktranslation-0.1.0/src/openbooktranslation/formats/pdf_export/document.py +397 -0
  105. openbooktranslation-0.1.0/src/openbooktranslation/formats/pdf_export/typst_markup.py +699 -0
  106. openbooktranslation-0.1.0/src/openbooktranslation/formats/text.py +401 -0
  107. openbooktranslation-0.1.0/src/openbooktranslation/instance.py +150 -0
  108. openbooktranslation-0.1.0/src/openbooktranslation/launcher.py +186 -0
  109. openbooktranslation-0.1.0/src/openbooktranslation/logging.py +68 -0
  110. openbooktranslation-0.1.0/src/openbooktranslation/model.py +119 -0
  111. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/__init__.py +11 -0
  112. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/chunker.py +71 -0
  113. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/config.py +538 -0
  114. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/events.py +232 -0
  115. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/glossary.py +85 -0
  116. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/jobs.py +826 -0
  117. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/presets/fast.yaml +25 -0
  118. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/presets/quality.yaml +25 -0
  119. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/prompts/__init__.py +196 -0
  120. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/prompts/analyze.j2 +21 -0
  121. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/prompts/metadata.j2 +30 -0
  122. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/prompts/review.j2 +30 -0
  123. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/prompts/translate.j2 +36 -0
  124. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/runner.py +136 -0
  125. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/stages/__init__.py +1 -0
  126. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/stages/analyze.py +183 -0
  127. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/stages/metadata.py +196 -0
  128. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/stages/rebuild.py +412 -0
  129. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/stages/review.py +292 -0
  130. openbooktranslation-0.1.0/src/openbooktranslation/pipeline/stages/translate.py +222 -0
  131. openbooktranslation-0.1.0/src/openbooktranslation/placeholders.py +341 -0
  132. openbooktranslation-0.1.0/src/openbooktranslation/py.typed +0 -0
  133. openbooktranslation-0.1.0/src/openbooktranslation/qa/__init__.py +36 -0
  134. openbooktranslation-0.1.0/src/openbooktranslation/qa/artifacts.py +44 -0
  135. openbooktranslation-0.1.0/src/openbooktranslation/qa/base.py +85 -0
  136. openbooktranslation-0.1.0/src/openbooktranslation/qa/glossary.py +37 -0
  137. openbooktranslation-0.1.0/src/openbooktranslation/qa/language.py +97 -0
  138. openbooktranslation-0.1.0/src/openbooktranslation/qa/length.py +71 -0
  139. openbooktranslation-0.1.0/src/openbooktranslation/qa/placeholders.py +63 -0
  140. openbooktranslation-0.1.0/src/openbooktranslation/qa/runner.py +30 -0
  141. openbooktranslation-0.1.0/src/openbooktranslation/qa/untranslated.py +73 -0
  142. openbooktranslation-0.1.0/src/openbooktranslation/server/__init__.py +6 -0
  143. openbooktranslation-0.1.0/src/openbooktranslation/server/app.py +257 -0
  144. openbooktranslation-0.1.0/src/openbooktranslation/server/errors.py +212 -0
  145. openbooktranslation-0.1.0/src/openbooktranslation/server/fake_script.py +226 -0
  146. openbooktranslation-0.1.0/src/openbooktranslation/server/fake_setup.py +166 -0
  147. openbooktranslation-0.1.0/src/openbooktranslation/server/health.py +110 -0
  148. openbooktranslation-0.1.0/src/openbooktranslation/server/model_pull.py +174 -0
  149. openbooktranslation-0.1.0/src/openbooktranslation/server/openapi.py +56 -0
  150. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/__init__.py +1 -0
  151. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/blocks.py +125 -0
  152. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/config.py +58 -0
  153. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/credentials.py +101 -0
  154. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/engine_setup.py +434 -0
  155. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/exports.py +211 -0
  156. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/jobs.py +154 -0
  157. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/metadata.py +88 -0
  158. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/projects.py +296 -0
  159. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/quality.py +151 -0
  160. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/settings.py +152 -0
  161. openbooktranslation-0.1.0/src/openbooktranslation/server/routers/system.py +220 -0
  162. openbooktranslation-0.1.0/src/openbooktranslation/server/schemas.py +788 -0
  163. openbooktranslation-0.1.0/src/openbooktranslation/server/security.py +313 -0
  164. openbooktranslation-0.1.0/src/openbooktranslation/server/serve.py +206 -0
  165. openbooktranslation-0.1.0/src/openbooktranslation/server/sse.py +215 -0
  166. openbooktranslation-0.1.0/src/openbooktranslation/server/state.py +97 -0
  167. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/ApiKeyField-CwkD8mcV.js +2 -0
  168. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/ExportPage-Fa0Q4yFs.js +1 -0
  169. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/OnboardingDialog-DPRVI9o2.js +1 -0
  170. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/PreviewPage-CDBbcRsL.js +13 -0
  171. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/ReviewPage-DVb0k5qW.js +1 -0
  172. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/RichText-yDVSDiZJ.js +1 -0
  173. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/SettingsPanel-sce33X6l.js +1 -0
  174. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/TranslatePage-wrGigor8.js +5 -0
  175. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/chevron-left-Do5MMlk3.js +1 -0
  176. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/dist-D8Wfxh48.js +1 -0
  177. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/drag-measure-BxaNHTq8.js +1 -0
  178. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/epub-Cp66Quc2.js +2 -0
  179. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/external-link-CEMBjcFZ.js +1 -0
  180. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/files-CyamUhiE.js +1 -0
  181. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/index-CTZzbh7g.js +50 -0
  182. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/index-Dgp32TP2.css +1 -0
  183. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  184. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  185. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  186. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  187. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  188. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  189. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  190. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/layout-fetched-opUODQTX.js +1 -0
  191. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-cyrillic-ext-opsz-italic-5yUt4G_9.woff2 +0 -0
  192. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-cyrillic-ext-opsz-normal-C5tfwALZ.woff2 +0 -0
  193. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-cyrillic-opsz-italic-Bj0ndbyp.woff2 +0 -0
  194. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-cyrillic-opsz-normal-DgmypKXX.woff2 +0 -0
  195. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-greek-ext-opsz-italic-DFpO5j-Z.woff2 +0 -0
  196. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-greek-ext-opsz-normal-DGm64vGR.woff2 +0 -0
  197. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-greek-opsz-italic-CHERNRFq.woff2 +0 -0
  198. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-greek-opsz-normal-DFglUmAd.woff2 +0 -0
  199. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-latin-ext-opsz-italic-4y8iAqqs.woff2 +0 -0
  200. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-latin-ext-opsz-normal-STiTPs0F.woff2 +0 -0
  201. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-latin-opsz-italic-CJ93D38p.woff2 +0 -0
  202. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-latin-opsz-normal-BHZsWIlc.woff2 +0 -0
  203. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-vietnamese-opsz-italic-BdcrZMcO.woff2 +0 -0
  204. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/literata-vietnamese-opsz-normal-Gqw5JQlq.woff2 +0 -0
  205. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/measure-DYLjE8ar.js +1 -0
  206. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/paginator-BFg7U5ic.js +97 -0
  207. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/progress-BuIeZ-NS.js +1 -0
  208. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/quality--f7_Hdkk.js +1 -0
  209. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/rolldown-runtime-Dl_DZoUm.js +1 -0
  210. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/rotate-ccw-DqiUVB-m.js +1 -0
  211. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/select-DzfvQbsj.js +1 -0
  212. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/sheet-DycYNe-v.js +1 -0
  213. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/slider-DLIujS5w.js +1 -0
  214. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/square-xm10Vp_L.js +1 -0
  215. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/switch-DZWsxNc8.js +1 -0
  216. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/useBook-DensDDmG.js +1 -0
  217. openbooktranslation-0.1.0/src/openbooktranslation/server/static/_app/immutable/zip-CwMXiiUf.js +1 -0
  218. openbooktranslation-0.1.0/src/openbooktranslation/server/static/favicon.svg +1 -0
  219. openbooktranslation-0.1.0/src/openbooktranslation/server/static/index.html +34 -0
  220. openbooktranslation-0.1.0/src/openbooktranslation/settings.py +477 -0
  221. openbooktranslation-0.1.0/src/openbooktranslation/storage/__init__.py +7 -0
  222. openbooktranslation-0.1.0/src/openbooktranslation/storage/bookinfo.py +179 -0
  223. openbooktranslation-0.1.0/src/openbooktranslation/storage/db.py +142 -0
  224. openbooktranslation-0.1.0/src/openbooktranslation/storage/errors.py +57 -0
  225. openbooktranslation-0.1.0/src/openbooktranslation/storage/filenames.py +241 -0
  226. openbooktranslation-0.1.0/src/openbooktranslation/storage/lock.py +119 -0
  227. openbooktranslation-0.1.0/src/openbooktranslation/storage/migrations/0001_init.sql +74 -0
  228. openbooktranslation-0.1.0/src/openbooktranslation/storage/migrations/0002_source_checksum.sql +4 -0
  229. openbooktranslation-0.1.0/src/openbooktranslation/storage/migrations/0003_quality.sql +32 -0
  230. openbooktranslation-0.1.0/src/openbooktranslation/storage/migrations/0004_finding_data_dismissals.sql +16 -0
  231. openbooktranslation-0.1.0/src/openbooktranslation/storage/migrations/0005_book_metadata.sql +15 -0
  232. openbooktranslation-0.1.0/src/openbooktranslation/storage/paths.py +207 -0
  233. openbooktranslation-0.1.0/src/openbooktranslation/storage/project.py +353 -0
  234. openbooktranslation-0.1.0/src/openbooktranslation/storage/repository.py +1545 -0
  235. openbooktranslation-0.1.0/src/openbooktranslation/update_helper.py +292 -0
  236. openbooktranslation-0.1.0/src/openbooktranslation/updates.py +470 -0
  237. openbooktranslation-0.1.0/src/openbooktranslation/xmlutil.py +221 -0
  238. openbooktranslation-0.1.0/tests/__init__.py +0 -0
  239. openbooktranslation-0.1.0/tests/api/__init__.py +0 -0
  240. openbooktranslation-0.1.0/tests/api/conftest.py +182 -0
  241. openbooktranslation-0.1.0/tests/api/test_app.py +455 -0
  242. openbooktranslation-0.1.0/tests/api/test_blocks_edit.py +318 -0
  243. openbooktranslation-0.1.0/tests/api/test_config.py +188 -0
  244. openbooktranslation-0.1.0/tests/api/test_covers.py +114 -0
  245. openbooktranslation-0.1.0/tests/api/test_credentials.py +238 -0
  246. openbooktranslation-0.1.0/tests/api/test_dismissals.py +136 -0
  247. openbooktranslation-0.1.0/tests/api/test_engine_cli_path.py +173 -0
  248. openbooktranslation-0.1.0/tests/api/test_engine_setup.py +822 -0
  249. openbooktranslation-0.1.0/tests/api/test_engines.py +73 -0
  250. openbooktranslation-0.1.0/tests/api/test_exports.py +326 -0
  251. openbooktranslation-0.1.0/tests/api/test_fake_script.py +234 -0
  252. openbooktranslation-0.1.0/tests/api/test_formats.py +107 -0
  253. openbooktranslation-0.1.0/tests/api/test_jobs.py +443 -0
  254. openbooktranslation-0.1.0/tests/api/test_metadata.py +247 -0
  255. openbooktranslation-0.1.0/tests/api/test_projects.py +452 -0
  256. openbooktranslation-0.1.0/tests/api/test_quality.py +313 -0
  257. openbooktranslation-0.1.0/tests/api/test_security.py +259 -0
  258. openbooktranslation-0.1.0/tests/api/test_serve.py +418 -0
  259. openbooktranslation-0.1.0/tests/api/test_settings.py +294 -0
  260. openbooktranslation-0.1.0/tests/api/test_system_update.py +320 -0
  261. openbooktranslation-0.1.0/tests/api/test_task_sse.py +88 -0
  262. openbooktranslation-0.1.0/tests/conftest.py +195 -0
  263. openbooktranslation-0.1.0/tests/contract/__init__.py +0 -0
  264. openbooktranslation-0.1.0/tests/contract/conftest.py +19 -0
  265. openbooktranslation-0.1.0/tests/contract/harnesses.py +312 -0
  266. openbooktranslation-0.1.0/tests/contract/test_engine_contract.py +138 -0
  267. openbooktranslation-0.1.0/tests/contract/test_live_smoke.py +74 -0
  268. openbooktranslation-0.1.0/tests/credential_guard.py +74 -0
  269. openbooktranslation-0.1.0/tests/engine_mocks.py +283 -0
  270. openbooktranslation-0.1.0/tests/fixtures/bin/fake_cli.py +102 -0
  271. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/EPUB/images/dot.svg +4 -0
  272. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/EPUB/nav.xhtml +16 -0
  273. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/EPUB/package.opf +20 -0
  274. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/EPUB/text/chapter.xhtml +38 -0
  275. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/EPUB/text/notes.xhtml +15 -0
  276. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/META-INF/container.xml +6 -0
  277. openbooktranslation-0.1.0/tests/fixtures/books/inline-heavy/mimetype +1 -0
  278. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub2-ncx/META-INF/container.xml +6 -0
  279. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub2-ncx/OPS/ch01.xhtml +14 -0
  280. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub2-ncx/OPS/ch02.xhtml +14 -0
  281. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub2-ncx/OPS/content.opf +18 -0
  282. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub2-ncx/OPS/toc.ncx +27 -0
  283. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub2-ncx/mimetype +1 -0
  284. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/META-INF/container.xml +6 -0
  285. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/OEBPS/content.opf +21 -0
  286. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/OEBPS/nav.xhtml +16 -0
  287. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/OEBPS/styles/book.css +3 -0
  288. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/OEBPS/text/chapter 1.xhtml +16 -0
  289. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/OEBPS/text/chapter2.xhtml +19 -0
  290. openbooktranslation-0.1.0/tests/fixtures/books/minimal-epub3/mimetype +1 -0
  291. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/META-INF/container.xml +6 -0
  292. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/content.opf +30 -0
  293. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/cover.svg +8 -0
  294. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/fable1.xhtml +18 -0
  295. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/fable2.xhtml +18 -0
  296. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/fable3.xhtml +19 -0
  297. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/nav.xhtml +24 -0
  298. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/style.css +4 -0
  299. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/title.xhtml +18 -0
  300. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/OEBPS/toc.ncx +19 -0
  301. openbooktranslation-0.1.0/tests/fixtures/books/public-domain-short/mimetype +1 -0
  302. openbooktranslation-0.1.0/tests/fixtures/engines/codex/stream_disconnected.jsonl +5 -0
  303. openbooktranslation-0.1.0/tests/fixtures/engines/codex/unauthorized.jsonl +4 -0
  304. openbooktranslation-0.1.0/tests/fixtures/engines/codex/usage_limit.jsonl +4 -0
  305. openbooktranslation-0.1.0/tests/fixtures/engines/gemini/overloaded.jsonl +3 -0
  306. openbooktranslation-0.1.0/tests/fixtures/engines/gemini/quota_exhausted.jsonl +4 -0
  307. openbooktranslation-0.1.0/tests/fixtures/pdf/sample.docling.json +742 -0
  308. openbooktranslation-0.1.0/tests/fixtures/text/book.md +37 -0
  309. openbooktranslation-0.1.0/tests/fixtures/text/chapters.txt +19 -0
  310. openbooktranslation-0.1.0/tests/fixtures/text/plain.txt +4 -0
  311. openbooktranslation-0.1.0/tests/helpers/__init__.py +0 -0
  312. openbooktranslation-0.1.0/tests/helpers/books.py +70 -0
  313. openbooktranslation-0.1.0/tests/helpers/cli_events.py +91 -0
  314. openbooktranslation-0.1.0/tests/helpers/docx.py +165 -0
  315. openbooktranslation-0.1.0/tests/helpers/e2e_keyring.py +23 -0
  316. openbooktranslation-0.1.0/tests/helpers/engines.py +82 -0
  317. openbooktranslation-0.1.0/tests/helpers/epubcheck.py +31 -0
  318. openbooktranslation-0.1.0/tests/helpers/fake_docling.py +111 -0
  319. openbooktranslation-0.1.0/tests/helpers/keychain.py +66 -0
  320. openbooktranslation-0.1.0/tests/helpers/ollama_mock.py +136 -0
  321. openbooktranslation-0.1.0/tests/helpers/pdf.py +240 -0
  322. openbooktranslation-0.1.0/tests/helpers/socketpair.py +38 -0
  323. openbooktranslation-0.1.0/tests/helpers/stub_cli.py +166 -0
  324. openbooktranslation-0.1.0/tests/integration/__init__.py +0 -0
  325. openbooktranslation-0.1.0/tests/integration/formats/__init__.py +0 -0
  326. openbooktranslation-0.1.0/tests/integration/formats/test_docx.py +554 -0
  327. openbooktranslation-0.1.0/tests/integration/formats/test_epub_bilingual.py +361 -0
  328. openbooktranslation-0.1.0/tests/integration/formats/test_epub_builder.py +628 -0
  329. openbooktranslation-0.1.0/tests/integration/formats/test_epub_ereader.py +914 -0
  330. openbooktranslation-0.1.0/tests/integration/formats/test_epub_metadata.py +225 -0
  331. openbooktranslation-0.1.0/tests/integration/formats/test_epub_writer.py +363 -0
  332. openbooktranslation-0.1.0/tests/integration/formats/test_pdf_docling.py +39 -0
  333. openbooktranslation-0.1.0/tests/integration/formats/test_pdf_export.py +322 -0
  334. openbooktranslation-0.1.0/tests/integration/pipeline/__init__.py +0 -0
  335. openbooktranslation-0.1.0/tests/integration/pipeline/conftest.py +101 -0
  336. openbooktranslation-0.1.0/tests/integration/pipeline/test_export.py +272 -0
  337. openbooktranslation-0.1.0/tests/integration/pipeline/test_export_imported_formats.py +82 -0
  338. openbooktranslation-0.1.0/tests/integration/pipeline/test_export_metadata.py +208 -0
  339. openbooktranslation-0.1.0/tests/integration/pipeline/test_export_pdf.py +325 -0
  340. openbooktranslation-0.1.0/tests/integration/pipeline/test_jobs.py +514 -0
  341. openbooktranslation-0.1.0/tests/integration/pipeline/test_jobs_lock_retranslate.py +259 -0
  342. openbooktranslation-0.1.0/tests/integration/pipeline/test_jobs_metadata.py +209 -0
  343. openbooktranslation-0.1.0/tests/integration/pipeline/test_quality_stages.py +688 -0
  344. openbooktranslation-0.1.0/tests/integration/pipeline/test_runner.py +374 -0
  345. openbooktranslation-0.1.0/tests/integration/storage/__init__.py +0 -0
  346. openbooktranslation-0.1.0/tests/integration/storage/test_import_formats.py +71 -0
  347. openbooktranslation-0.1.0/tests/integration/storage/test_projects.py +407 -0
  348. openbooktranslation-0.1.0/tests/integration/test_cli_formats.py +151 -0
  349. openbooktranslation-0.1.0/tests/integration/test_cli_metadata.py +195 -0
  350. openbooktranslation-0.1.0/tests/integration/test_cli_pipeline.py +585 -0
  351. openbooktranslation-0.1.0/tests/packaging/__init__.py +0 -0
  352. openbooktranslation-0.1.0/tests/packaging/test_build_hook.py +137 -0
  353. openbooktranslation-0.1.0/tests/packaging/test_check_dist.py +273 -0
  354. openbooktranslation-0.1.0/tests/packaging/test_installer.py +160 -0
  355. openbooktranslation-0.1.0/tests/packaging/test_release_notes.py +88 -0
  356. openbooktranslation-0.1.0/tests/packaging/test_wheel_smoke.py +328 -0
  357. openbooktranslation-0.1.0/tests/packaging/test_workflows.py +135 -0
  358. openbooktranslation-0.1.0/tests/test_docs_links.py +160 -0
  359. openbooktranslation-0.1.0/tests/test_licenses.py +297 -0
  360. openbooktranslation-0.1.0/tests/test_live_marker.py +70 -0
  361. openbooktranslation-0.1.0/tests/test_network_guard.py +58 -0
  362. openbooktranslation-0.1.0/tests/unit/__init__.py +0 -0
  363. openbooktranslation-0.1.0/tests/unit/engines/__init__.py +0 -0
  364. openbooktranslation-0.1.0/tests/unit/engines/conftest.py +30 -0
  365. openbooktranslation-0.1.0/tests/unit/engines/install/__init__.py +0 -0
  366. openbooktranslation-0.1.0/tests/unit/engines/install/test_no_credentials.py +86 -0
  367. openbooktranslation-0.1.0/tests/unit/engines/install/test_plan.py +195 -0
  368. openbooktranslation-0.1.0/tests/unit/engines/install/test_recipes.py +136 -0
  369. openbooktranslation-0.1.0/tests/unit/engines/install/test_runner.py +325 -0
  370. openbooktranslation-0.1.0/tests/unit/engines/install/test_terminal.py +214 -0
  371. openbooktranslation-0.1.0/tests/unit/engines/test_anthropic_api.py +410 -0
  372. openbooktranslation-0.1.0/tests/unit/engines/test_base.py +143 -0
  373. openbooktranslation-0.1.0/tests/unit/engines/test_claude_subscription.py +501 -0
  374. openbooktranslation-0.1.0/tests/unit/engines/test_codex_cli.py +383 -0
  375. openbooktranslation-0.1.0/tests/unit/engines/test_credentials.py +264 -0
  376. openbooktranslation-0.1.0/tests/unit/engines/test_engines_locate.py +204 -0
  377. openbooktranslation-0.1.0/tests/unit/engines/test_fake.py +203 -0
  378. openbooktranslation-0.1.0/tests/unit/engines/test_gemini_cli.py +338 -0
  379. openbooktranslation-0.1.0/tests/unit/engines/test_locate.py +535 -0
  380. openbooktranslation-0.1.0/tests/unit/engines/test_models.py +134 -0
  381. openbooktranslation-0.1.0/tests/unit/engines/test_ollama.py +344 -0
  382. openbooktranslation-0.1.0/tests/unit/engines/test_ollama_pull.py +98 -0
  383. openbooktranslation-0.1.0/tests/unit/engines/test_output.py +216 -0
  384. openbooktranslation-0.1.0/tests/unit/engines/test_registry.py +94 -0
  385. openbooktranslation-0.1.0/tests/unit/engines/test_subprocess_cli.py +330 -0
  386. openbooktranslation-0.1.0/tests/unit/formats/__init__.py +0 -0
  387. openbooktranslation-0.1.0/tests/unit/formats/epub/__init__.py +0 -0
  388. openbooktranslation-0.1.0/tests/unit/formats/epub/test_cover.py +167 -0
  389. openbooktranslation-0.1.0/tests/unit/formats/epub/test_reader.py +314 -0
  390. openbooktranslation-0.1.0/tests/unit/formats/epub/test_segmenter.py +207 -0
  391. openbooktranslation-0.1.0/tests/unit/formats/pdf_export/__init__.py +0 -0
  392. openbooktranslation-0.1.0/tests/unit/formats/pdf_export/snapshots/inline-heavy.typ +67 -0
  393. openbooktranslation-0.1.0/tests/unit/formats/pdf_export/test_document.py +470 -0
  394. openbooktranslation-0.1.0/tests/unit/formats/pdf_export/test_typst_markup.py +455 -0
  395. openbooktranslation-0.1.0/tests/unit/formats/test_base.py +104 -0
  396. openbooktranslation-0.1.0/tests/unit/formats/test_pdf.py +545 -0
  397. openbooktranslation-0.1.0/tests/unit/formats/test_text.py +275 -0
  398. openbooktranslation-0.1.0/tests/unit/pipeline/__init__.py +0 -0
  399. openbooktranslation-0.1.0/tests/unit/pipeline/snapshots/analyze.txt +18 -0
  400. openbooktranslation-0.1.0/tests/unit/pipeline/snapshots/metadata.txt +24 -0
  401. openbooktranslation-0.1.0/tests/unit/pipeline/snapshots/translate_full.txt +25 -0
  402. openbooktranslation-0.1.0/tests/unit/pipeline/snapshots/translate_minimal.txt +18 -0
  403. openbooktranslation-0.1.0/tests/unit/pipeline/snapshots/translate_style_notes.txt +21 -0
  404. openbooktranslation-0.1.0/tests/unit/pipeline/test_analyze.py +223 -0
  405. openbooktranslation-0.1.0/tests/unit/pipeline/test_chunker.py +129 -0
  406. openbooktranslation-0.1.0/tests/unit/pipeline/test_config.py +388 -0
  407. openbooktranslation-0.1.0/tests/unit/pipeline/test_events.py +187 -0
  408. openbooktranslation-0.1.0/tests/unit/pipeline/test_metadata.py +226 -0
  409. openbooktranslation-0.1.0/tests/unit/pipeline/test_prompts.py +142 -0
  410. openbooktranslation-0.1.0/tests/unit/qa/__init__.py +0 -0
  411. openbooktranslation-0.1.0/tests/unit/qa/test_artifacts_check.py +77 -0
  412. openbooktranslation-0.1.0/tests/unit/qa/test_glossary_check.py +67 -0
  413. openbooktranslation-0.1.0/tests/unit/qa/test_length_check.py +131 -0
  414. openbooktranslation-0.1.0/tests/unit/qa/test_placeholders_check.py +77 -0
  415. openbooktranslation-0.1.0/tests/unit/qa/test_runner.py +39 -0
  416. openbooktranslation-0.1.0/tests/unit/qa/test_untranslated_check.py +172 -0
  417. openbooktranslation-0.1.0/tests/unit/storage/__init__.py +0 -0
  418. openbooktranslation-0.1.0/tests/unit/storage/conftest.py +45 -0
  419. openbooktranslation-0.1.0/tests/unit/storage/test_book_metadata.py +130 -0
  420. openbooktranslation-0.1.0/tests/unit/storage/test_bookinfo.py +223 -0
  421. openbooktranslation-0.1.0/tests/unit/storage/test_db.py +310 -0
  422. openbooktranslation-0.1.0/tests/unit/storage/test_dismissals.py +158 -0
  423. openbooktranslation-0.1.0/tests/unit/storage/test_filenames.py +217 -0
  424. openbooktranslation-0.1.0/tests/unit/storage/test_lock.py +56 -0
  425. openbooktranslation-0.1.0/tests/unit/storage/test_paths.py +175 -0
  426. openbooktranslation-0.1.0/tests/unit/storage/test_quality_repository.py +217 -0
  427. openbooktranslation-0.1.0/tests/unit/storage/test_repository.py +312 -0
  428. openbooktranslation-0.1.0/tests/unit/storage/test_state_machine.py +315 -0
  429. openbooktranslation-0.1.0/tests/unit/storage/test_state_machine_stateful.py +161 -0
  430. openbooktranslation-0.1.0/tests/unit/test_cli.py +237 -0
  431. openbooktranslation-0.1.0/tests/unit/test_cli_engines_key.py +204 -0
  432. openbooktranslation-0.1.0/tests/unit/test_cli_engines_setup.py +283 -0
  433. openbooktranslation-0.1.0/tests/unit/test_cli_install.py +272 -0
  434. openbooktranslation-0.1.0/tests/unit/test_desktop.py +352 -0
  435. openbooktranslation-0.1.0/tests/unit/test_e2e_keyring.py +44 -0
  436. openbooktranslation-0.1.0/tests/unit/test_launcher.py +540 -0
  437. openbooktranslation-0.1.0/tests/unit/test_logging.py +79 -0
  438. openbooktranslation-0.1.0/tests/unit/test_model.py +67 -0
  439. openbooktranslation-0.1.0/tests/unit/test_placeholders.py +454 -0
  440. openbooktranslation-0.1.0/tests/unit/test_settings.py +513 -0
  441. openbooktranslation-0.1.0/tests/unit/test_update_helper.py +351 -0
  442. openbooktranslation-0.1.0/tests/unit/test_updates.py +458 -0
  443. openbooktranslation-0.1.0/tests/unit/test_version.py +42 -0
  444. openbooktranslation-0.1.0/tests/unit/test_xmlutil.py +127 -0
  445. openbooktranslation-0.1.0/uv.lock +3978 -0
  446. openbooktranslation-0.1.0/web/.gitignore +22 -0
  447. openbooktranslation-0.1.0/web/.npmrc +1 -0
  448. openbooktranslation-0.1.0/web/.oxlintrc.json +16 -0
  449. openbooktranslation-0.1.0/web/.prettierignore +10 -0
  450. openbooktranslation-0.1.0/web/.prettierrc +5 -0
  451. openbooktranslation-0.1.0/web/README.md +43 -0
  452. openbooktranslation-0.1.0/web/components.json +25 -0
  453. openbooktranslation-0.1.0/web/e2e/.gitkeep +0 -0
  454. openbooktranslation-0.1.0/web/e2e/a11y.spec.ts +126 -0
  455. openbooktranslation-0.1.0/web/e2e/export.spec.ts +147 -0
  456. openbooktranslation-0.1.0/web/e2e/global-setup.ts +35 -0
  457. openbooktranslation-0.1.0/web/e2e/helpers.ts +114 -0
  458. openbooktranslation-0.1.0/web/e2e/onboarding.spec.ts +195 -0
  459. openbooktranslation-0.1.0/web/e2e/pdf.spec.ts +64 -0
  460. openbooktranslation-0.1.0/web/e2e/preview.spec.ts +98 -0
  461. openbooktranslation-0.1.0/web/e2e/quality.spec.ts +87 -0
  462. openbooktranslation-0.1.0/web/e2e/rate-limit.spec.ts +42 -0
  463. openbooktranslation-0.1.0/web/e2e/review.spec.ts +173 -0
  464. openbooktranslation-0.1.0/web/e2e/screenshots.spec.ts +96 -0
  465. openbooktranslation-0.1.0/web/e2e/settings.spec.ts +117 -0
  466. openbooktranslation-0.1.0/web/e2e/translate.spec.ts +57 -0
  467. openbooktranslation-0.1.0/web/index.html +32 -0
  468. openbooktranslation-0.1.0/web/package.json +67 -0
  469. openbooktranslation-0.1.0/web/patches/foliate-js@0.0.0.patch +63 -0
  470. openbooktranslation-0.1.0/web/playwright.config.ts +129 -0
  471. openbooktranslation-0.1.0/web/pnpm-lock.yaml +5624 -0
  472. openbooktranslation-0.1.0/web/public/favicon.svg +1 -0
  473. openbooktranslation-0.1.0/web/scripts/gen-api.d.ts +5 -0
  474. openbooktranslation-0.1.0/web/scripts/gen-api.js +23 -0
  475. openbooktranslation-0.1.0/web/src/app/AppShell.test.tsx +75 -0
  476. openbooktranslation-0.1.0/web/src/app/AppShell.tsx +165 -0
  477. openbooktranslation-0.1.0/web/src/app/CommandPalette.tsx +95 -0
  478. openbooktranslation-0.1.0/web/src/app/RouteError.tsx +33 -0
  479. openbooktranslation-0.1.0/web/src/app/Sidebar.tsx +253 -0
  480. openbooktranslation-0.1.0/web/src/app/lazyPage.tsx +25 -0
  481. openbooktranslation-0.1.0/web/src/app/router.tsx +43 -0
  482. openbooktranslation-0.1.0/web/src/app/routes.ts +16 -0
  483. openbooktranslation-0.1.0/web/src/app/shortcuts.test.ts +38 -0
  484. openbooktranslation-0.1.0/web/src/app/shortcuts.ts +23 -0
  485. openbooktranslation-0.1.0/web/src/components/CoverArt.tsx +142 -0
  486. openbooktranslation-0.1.0/web/src/components/LanguageSelect.tsx +66 -0
  487. openbooktranslation-0.1.0/web/src/components/Motion.tsx +79 -0
  488. openbooktranslation-0.1.0/web/src/components/Segmented.tsx +71 -0
  489. openbooktranslation-0.1.0/web/src/components/Toolbar.tsx +15 -0
  490. openbooktranslation-0.1.0/web/src/components/ui/button.tsx +66 -0
  491. openbooktranslation-0.1.0/web/src/components/ui/command.tsx +193 -0
  492. openbooktranslation-0.1.0/web/src/components/ui/context-menu.tsx +262 -0
  493. openbooktranslation-0.1.0/web/src/components/ui/dialog.tsx +166 -0
  494. openbooktranslation-0.1.0/web/src/components/ui/dropdown-menu.tsx +266 -0
  495. openbooktranslation-0.1.0/web/src/components/ui/input-group.tsx +154 -0
  496. openbooktranslation-0.1.0/web/src/components/ui/input.tsx +18 -0
  497. openbooktranslation-0.1.0/web/src/components/ui/label.tsx +21 -0
  498. openbooktranslation-0.1.0/web/src/components/ui/popover.tsx +86 -0
  499. openbooktranslation-0.1.0/web/src/components/ui/select.tsx +189 -0
  500. openbooktranslation-0.1.0/web/src/components/ui/sheet.tsx +147 -0
  501. openbooktranslation-0.1.0/web/src/components/ui/slider.tsx +62 -0
  502. openbooktranslation-0.1.0/web/src/components/ui/sonner.tsx +45 -0
  503. openbooktranslation-0.1.0/web/src/components/ui/switch.tsx +32 -0
  504. openbooktranslation-0.1.0/web/src/components/ui/textarea.tsx +17 -0
  505. openbooktranslation-0.1.0/web/src/components/ui/tooltip.tsx +56 -0
  506. openbooktranslation-0.1.0/web/src/features/book/BookRoute.test.tsx +41 -0
  507. openbooktranslation-0.1.0/web/src/features/book/BookRoute.tsx +72 -0
  508. openbooktranslation-0.1.0/web/src/features/book/BookSettingsSheet.test.tsx +223 -0
  509. openbooktranslation-0.1.0/web/src/features/book/BookSettingsSheet.tsx +667 -0
  510. openbooktranslation-0.1.0/web/src/features/book/GlossaryEditor.test.tsx +111 -0
  511. openbooktranslation-0.1.0/web/src/features/book/GlossaryEditor.tsx +164 -0
  512. openbooktranslation-0.1.0/web/src/features/book/glossaryRows.ts +35 -0
  513. openbooktranslation-0.1.0/web/src/features/book/useBook.ts +14 -0
  514. openbooktranslation-0.1.0/web/src/features/engineSetup/EngineSetupActions.test.tsx +349 -0
  515. openbooktranslation-0.1.0/web/src/features/engineSetup/EngineSetupActions.tsx +548 -0
  516. openbooktranslation-0.1.0/web/src/features/engineSetup/hooks.ts +318 -0
  517. openbooktranslation-0.1.0/web/src/features/engineSetup/setupApi.ts +53 -0
  518. openbooktranslation-0.1.0/web/src/features/export/ExportPage.test.tsx +427 -0
  519. openbooktranslation-0.1.0/web/src/features/export/ExportPage.tsx +637 -0
  520. openbooktranslation-0.1.0/web/src/features/export/TitleSection.test.tsx +219 -0
  521. openbooktranslation-0.1.0/web/src/features/export/TitleSection.tsx +259 -0
  522. openbooktranslation-0.1.0/web/src/features/export/ereader.ts +44 -0
  523. openbooktranslation-0.1.0/web/src/features/export/fileName.ts +7 -0
  524. openbooktranslation-0.1.0/web/src/features/library/BookCard.tsx +175 -0
  525. openbooktranslation-0.1.0/web/src/features/library/DeleteBookDialog.tsx +45 -0
  526. openbooktranslation-0.1.0/web/src/features/library/ImportSheet.test.tsx +149 -0
  527. openbooktranslation-0.1.0/web/src/features/library/ImportSheet.tsx +212 -0
  528. openbooktranslation-0.1.0/web/src/features/library/LibraryPage.test.tsx +178 -0
  529. openbooktranslation-0.1.0/web/src/features/library/LibraryPage.tsx +184 -0
  530. openbooktranslation-0.1.0/web/src/features/library/libraryView.test.ts +83 -0
  531. openbooktranslation-0.1.0/web/src/features/library/libraryView.ts +78 -0
  532. openbooktranslation-0.1.0/web/src/features/onboarding/Onboarding.test.tsx +248 -0
  533. openbooktranslation-0.1.0/web/src/features/onboarding/Onboarding.tsx +35 -0
  534. openbooktranslation-0.1.0/web/src/features/onboarding/OnboardingDialog.tsx +428 -0
  535. openbooktranslation-0.1.0/web/src/features/onboarding/steps.test.ts +36 -0
  536. openbooktranslation-0.1.0/web/src/features/onboarding/steps.ts +68 -0
  537. openbooktranslation-0.1.0/web/src/features/preview/ParallelView.tsx +411 -0
  538. openbooktranslation-0.1.0/web/src/features/preview/PreviewPage.test.tsx +557 -0
  539. openbooktranslation-0.1.0/web/src/features/preview/PreviewPage.tsx +90 -0
  540. openbooktranslation-0.1.0/web/src/features/preview/Reader.tsx +491 -0
  541. openbooktranslation-0.1.0/web/src/features/preview/TextView.tsx +95 -0
  542. openbooktranslation-0.1.0/web/src/features/preview/files.test.ts +48 -0
  543. openbooktranslation-0.1.0/web/src/features/preview/files.ts +41 -0
  544. openbooktranslation-0.1.0/web/src/features/preview/look.ts +54 -0
  545. openbooktranslation-0.1.0/web/src/features/preview/parts.tsx +195 -0
  546. openbooktranslation-0.1.0/web/src/features/preview/useReader.ts +127 -0
  547. openbooktranslation-0.1.0/web/src/features/review/BlockRow.tsx +467 -0
  548. openbooktranslation-0.1.0/web/src/features/review/ChapterRail.tsx +69 -0
  549. openbooktranslation-0.1.0/web/src/features/review/ChipEditor.test.tsx +176 -0
  550. openbooktranslation-0.1.0/web/src/features/review/ChipEditor.tsx +207 -0
  551. openbooktranslation-0.1.0/web/src/features/review/Kbd.tsx +16 -0
  552. openbooktranslation-0.1.0/web/src/features/review/ReviewPage.test.tsx +401 -0
  553. openbooktranslation-0.1.0/web/src/features/review/ReviewPage.tsx +579 -0
  554. openbooktranslation-0.1.0/web/src/features/review/RichText.tsx +43 -0
  555. openbooktranslation-0.1.0/web/src/features/review/keys.ts +9 -0
  556. openbooktranslation-0.1.0/web/src/features/review/reviewApi.ts +48 -0
  557. openbooktranslation-0.1.0/web/src/features/review/reviewStore.ts +175 -0
  558. openbooktranslation-0.1.0/web/src/features/review/useEngineModels.ts +35 -0
  559. openbooktranslation-0.1.0/web/src/features/settings/ApiKeyField.test.tsx +179 -0
  560. openbooktranslation-0.1.0/web/src/features/settings/ApiKeyField.tsx +289 -0
  561. openbooktranslation-0.1.0/web/src/features/settings/CliPathField.tsx +112 -0
  562. openbooktranslation-0.1.0/web/src/features/settings/SettingsDialog.test.tsx +117 -0
  563. openbooktranslation-0.1.0/web/src/features/settings/SettingsDialog.tsx +100 -0
  564. openbooktranslation-0.1.0/web/src/features/settings/SettingsPanel.tsx +25 -0
  565. openbooktranslation-0.1.0/web/src/features/settings/SettingsPanels.test.tsx +285 -0
  566. openbooktranslation-0.1.0/web/src/features/settings/labels.ts +29 -0
  567. openbooktranslation-0.1.0/web/src/features/settings/panels/AboutPanel.tsx +186 -0
  568. openbooktranslation-0.1.0/web/src/features/settings/panels/AdvancedPanel.tsx +148 -0
  569. openbooktranslation-0.1.0/web/src/features/settings/panels/AppearancePanel.tsx +126 -0
  570. openbooktranslation-0.1.0/web/src/features/settings/panels/EnginesPanel.tsx +260 -0
  571. openbooktranslation-0.1.0/web/src/features/settings/panels/EreadersPanel.tsx +73 -0
  572. openbooktranslation-0.1.0/web/src/features/settings/panels/QualityPanel.tsx +76 -0
  573. openbooktranslation-0.1.0/web/src/features/settings/panels/TranslationPanel.tsx +162 -0
  574. openbooktranslation-0.1.0/web/src/features/settings/parts.tsx +187 -0
  575. openbooktranslation-0.1.0/web/src/features/settings/settingsApi.ts +33 -0
  576. openbooktranslation-0.1.0/web/src/features/settings/useSettingsPanel.ts +71 -0
  577. openbooktranslation-0.1.0/web/src/features/system/QuitDialog.tsx +62 -0
  578. openbooktranslation-0.1.0/web/src/features/system/quit.ts +25 -0
  579. openbooktranslation-0.1.0/web/src/features/system/system.test.tsx +223 -0
  580. openbooktranslation-0.1.0/web/src/features/system/systemApi.ts +27 -0
  581. openbooktranslation-0.1.0/web/src/features/system/updateNotice.ts +54 -0
  582. openbooktranslation-0.1.0/web/src/features/translate/ActivityFeed.tsx +148 -0
  583. openbooktranslation-0.1.0/web/src/features/translate/ChapterList.tsx +70 -0
  584. openbooktranslation-0.1.0/web/src/features/translate/CodeText.tsx +17 -0
  585. openbooktranslation-0.1.0/web/src/features/translate/EngineModelSelect.tsx +139 -0
  586. openbooktranslation-0.1.0/web/src/features/translate/Notices.tsx +208 -0
  587. openbooktranslation-0.1.0/web/src/features/translate/TranslatePage.test.tsx +432 -0
  588. openbooktranslation-0.1.0/web/src/features/translate/TranslatePage.tsx +338 -0
  589. openbooktranslation-0.1.0/web/src/features/translate/activity.test.ts +84 -0
  590. openbooktranslation-0.1.0/web/src/features/translate/activity.ts +146 -0
  591. openbooktranslation-0.1.0/web/src/features/translate/runView.test.ts +127 -0
  592. openbooktranslation-0.1.0/web/src/features/translate/runView.ts +155 -0
  593. openbooktranslation-0.1.0/web/src/features/translate/usePipeline.ts +47 -0
  594. openbooktranslation-0.1.0/web/src/features/translate/useTranslateRun.ts +254 -0
  595. openbooktranslation-0.1.0/web/src/index.css +290 -0
  596. openbooktranslation-0.1.0/web/src/lib/api/client.test.ts +140 -0
  597. openbooktranslation-0.1.0/web/src/lib/api/client.ts +214 -0
  598. openbooktranslation-0.1.0/web/src/lib/api/openapi.json +9048 -0
  599. openbooktranslation-0.1.0/web/src/lib/api/schema.d.ts +6544 -0
  600. openbooktranslation-0.1.0/web/src/lib/api/schema.test.ts +11 -0
  601. openbooktranslation-0.1.0/web/src/lib/api/types.ts +54 -0
  602. openbooktranslation-0.1.0/web/src/lib/api/upload.test.ts +70 -0
  603. openbooktranslation-0.1.0/web/src/lib/api/upload.ts +61 -0
  604. openbooktranslation-0.1.0/web/src/lib/chipEditor.test.ts +202 -0
  605. openbooktranslation-0.1.0/web/src/lib/chipEditor.ts +210 -0
  606. openbooktranslation-0.1.0/web/src/lib/configForm.test.ts +87 -0
  607. openbooktranslation-0.1.0/web/src/lib/configForm.ts +118 -0
  608. openbooktranslation-0.1.0/web/src/lib/csv.test.ts +45 -0
  609. openbooktranslation-0.1.0/web/src/lib/csv.ts +79 -0
  610. openbooktranslation-0.1.0/web/src/lib/eta.test.ts +99 -0
  611. openbooktranslation-0.1.0/web/src/lib/eta.ts +102 -0
  612. openbooktranslation-0.1.0/web/src/lib/foliate-js.d.ts +60 -0
  613. openbooktranslation-0.1.0/web/src/lib/foliate.ts +276 -0
  614. openbooktranslation-0.1.0/web/src/lib/format.test.ts +66 -0
  615. openbooktranslation-0.1.0/web/src/lib/format.ts +126 -0
  616. openbooktranslation-0.1.0/web/src/lib/indexHtml.test.ts +54 -0
  617. openbooktranslation-0.1.0/web/src/lib/jobStream.test.ts +295 -0
  618. openbooktranslation-0.1.0/web/src/lib/jobStream.ts +328 -0
  619. openbooktranslation-0.1.0/web/src/lib/languages.test.ts +31 -0
  620. openbooktranslation-0.1.0/web/src/lib/languages.ts +116 -0
  621. openbooktranslation-0.1.0/web/src/lib/paths.test.ts +11 -0
  622. openbooktranslation-0.1.0/web/src/lib/paths.ts +6 -0
  623. openbooktranslation-0.1.0/web/src/lib/pipelineDefaults.test.ts +74 -0
  624. openbooktranslation-0.1.0/web/src/lib/pipelineDefaults.ts +110 -0
  625. openbooktranslation-0.1.0/web/src/lib/placeholders.test.ts +138 -0
  626. openbooktranslation-0.1.0/web/src/lib/placeholders.ts +269 -0
  627. openbooktranslation-0.1.0/web/src/lib/poll.test.ts +61 -0
  628. openbooktranslation-0.1.0/web/src/lib/poll.ts +51 -0
  629. openbooktranslation-0.1.0/web/src/lib/progress.test.ts +49 -0
  630. openbooktranslation-0.1.0/web/src/lib/progress.ts +33 -0
  631. openbooktranslation-0.1.0/web/src/lib/quality.test.ts +65 -0
  632. openbooktranslation-0.1.0/web/src/lib/quality.ts +98 -0
  633. openbooktranslation-0.1.0/web/src/lib/readerLocation.test.ts +109 -0
  634. openbooktranslation-0.1.0/web/src/lib/readerLocation.ts +148 -0
  635. openbooktranslation-0.1.0/web/src/lib/reviewFilter.test.ts +137 -0
  636. openbooktranslation-0.1.0/web/src/lib/reviewFilter.ts +155 -0
  637. openbooktranslation-0.1.0/web/src/lib/run.test.ts +82 -0
  638. openbooktranslation-0.1.0/web/src/lib/run.ts +99 -0
  639. openbooktranslation-0.1.0/web/src/lib/seeded.test.ts +16 -0
  640. openbooktranslation-0.1.0/web/src/lib/seeded.ts +15 -0
  641. openbooktranslation-0.1.0/web/src/lib/taskStream.test.ts +56 -0
  642. openbooktranslation-0.1.0/web/src/lib/taskStream.ts +59 -0
  643. openbooktranslation-0.1.0/web/src/lib/testing/app.tsx +86 -0
  644. openbooktranslation-0.1.0/web/src/lib/testing/fixtures.ts +195 -0
  645. openbooktranslation-0.1.0/web/src/lib/testing/mockEventSource.ts +51 -0
  646. openbooktranslation-0.1.0/web/src/lib/testing/mockXhr.ts +65 -0
  647. openbooktranslation-0.1.0/web/src/lib/testing/settings.ts +177 -0
  648. openbooktranslation-0.1.0/web/src/lib/theme.ts +53 -0
  649. openbooktranslation-0.1.0/web/src/lib/useJobStream.ts +48 -0
  650. openbooktranslation-0.1.0/web/src/lib/useNow.ts +11 -0
  651. openbooktranslation-0.1.0/web/src/lib/utils.ts +1 -0
  652. openbooktranslation-0.1.0/web/src/main.tsx +14 -0
  653. openbooktranslation-0.1.0/web/src/stores/appSettings.ts +98 -0
  654. openbooktranslation-0.1.0/web/src/stores/appearance.ts +48 -0
  655. openbooktranslation-0.1.0/web/src/stores/engines.test.ts +72 -0
  656. openbooktranslation-0.1.0/web/src/stores/engines.ts +173 -0
  657. openbooktranslation-0.1.0/web/src/stores/library.ts +90 -0
  658. openbooktranslation-0.1.0/web/src/stores/reader.ts +41 -0
  659. openbooktranslation-0.1.0/web/src/stores/server.ts +23 -0
  660. openbooktranslation-0.1.0/web/src/stores/ui.ts +46 -0
  661. openbooktranslation-0.1.0/web/tsconfig.app.json +30 -0
  662. openbooktranslation-0.1.0/web/tsconfig.json +7 -0
  663. openbooktranslation-0.1.0/web/tsconfig.node.json +25 -0
  664. openbooktranslation-0.1.0/web/vite.config.ts +44 -0
  665. openbooktranslation-0.1.0/web/vitest-setup.ts +37 -0
@@ -0,0 +1,47 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ .venv/
9
+ .python-version.local
10
+
11
+ # Tooling caches
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .mypy_cache/
15
+ .pyright/
16
+ .hypothesis/
17
+ .coverage
18
+ .coverage.*
19
+ coverage.xml
20
+ htmlcov/
21
+
22
+ # Node / web
23
+ node_modules/
24
+ web/build/
25
+ web/test-results/
26
+ web/playwright-report/
27
+ .pnpm-store/
28
+
29
+ # Built frontend bundled into the Python package (built in CI / release)
30
+ src/openbooktranslation/server/static/
31
+
32
+ # Local data and secrets: never commit
33
+ .env
34
+ .env.*
35
+ *.sqlite
36
+ *.sqlite-journal
37
+ /projects/
38
+ /local-data/
39
+
40
+ # Editors / OS
41
+ .idea/
42
+ .vscode/*
43
+ !.vscode/extensions.json
44
+ .DS_Store
45
+
46
+ # Claude Code agent worktrees
47
+ .claude/worktrees/
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Versions come from git tags (`v0.1.0` → `0.1.0`); see [CONTRIBUTING.md](CONTRIBUTING.md#releasing).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-12-05
10
+
11
+ The first release (MVP).
12
+
13
+ ### Added
14
+
15
+ - **Books:** EPUB 2 and 3 (the XHTML is rewritten in place, so styles, fonts, images, links, footnotes and the table of contents survive), plain text and Markdown. DRM-protected EPUBs are rejected with a clear error.
16
+ - **Word books (DOCX):** translated in place, keeping run formatting, links, lists, tables and images. Export to DOCX or to EPUB.
17
+ - **PDF books** (optional `pdf` extra: `openbooktranslation[pdf]`): converted to EPUB at import with docling. Chapters come from the headings, running headers and page numbers are removed, footnotes go to the end of their chapter, and images are kept. Without the extra, a PDF is refused with `install openbooktranslation[pdf]`.
18
+ - **Engines:**
19
+ - `claude-subscription`: your own Claude plan, through the official Claude Agent SDK and your logged-in `claude` CLI. OpenBookTranslation never reads or stores credentials.
20
+ - `anthropic-api`: an Anthropic API key, found by the official SDK (`ANTHROPIC_API_KEY` or `ant auth login`).
21
+ - `codex-cli`: your ChatGPT plan, through OpenAI's official Codex CLI (`codex exec`, read-only sandbox, no web search, none of your Codex settings). Sign in with `codex login`.
22
+ - `gemini-cli`: Gemini through Google's official Gemini CLI, headless and tool-less (a paid Gemini API key or a Code Assist Standard/Enterprise license; Google AI Pro/Ultra sign-ins no longer work with the Gemini CLI).
23
+ - `ollama`: local models served by Ollama (`OLLAMA_HOST`), with structured JSON output.
24
+ - `fake`: for trying the interface and for tests.
25
+ - The `claude`, `codex` and `gemini` commands are found outside `PATH` too, in the folders their installers normally use (so an app started from a menu or icon finds them), or where you point **Settings → Engines → Use a different location…** (`engines.<id>.cli_path` in `settings.yaml`). `obt doctor` shows where each was found.
26
+ - **Guided engine setup** ([ADR 0012](docs/adr/0012-guided-engine-setup.md)): `obt engines install <engine>` installs the `claude`, `codex`, `gemini` or `ollama` tool with the vendor's official installer (it shows the exact command and the page that documents it, and asks first; Node.js first for the Gemini CLI); `obt engines login <engine> --open` opens the vendor's own sign-in in a terminal window; `obt doctor` suggests the install command of each missing tool. The same is available to the interface through new API routes, which only accept requests from the app itself: install plans and installs with a live log, the sign-in window, and Ollama model downloads with progress (`gemma3:4b` suggested first).
27
+ - **Setup buttons in Settings → Engines:** each card offers what its engine needs: **Install…** (the exact command, its vendor and documentation first, then the installer's live output with **Cancel install**; installers that need a password open in a terminal window), **Open sign-in window** (then "Waiting for you to sign in…" until the engine is ready, checked every 5 seconds for up to 10 minutes), **Download** for Ollama's suggested model, **Check again**, **Show command** (the manual steps as text) and **Use a different location…**.
28
+ - **Setup assistant:** on the first start, a short assistant asks which AI you already use (Claude Pro or Max, ChatGPT, a Google account, free and offline with Ollama, or an Anthropic API key, each with its live status), installs its tool, signs you in, asks the update question and makes it the engine of new books. Every step can be skipped; it does not open again once finished or closed (installs that already have books or a default engine never see it), and **Set up an engine…** in Settings → Engines or the command palette reopens it.
29
+ - **Pipeline:** `fast` and `quality` presets, editable as `pipeline.yaml` or in the interface; languages, model, effort, chunk size, context, style prompt and a glossary. Translations are checked for placeholders (inline formatting) and retried or split when the engine returns invalid output.
30
+ - **Quality stages** (on in the `quality` preset): an analysis before translating proposes glossary entries and style notes (`obt analyze`, or **Run analysis now**); free checks after each run flag broken formatting, odd lengths, untranslated text, unused glossary terms and stray markup (`obt qa`; language detection with the optional `qa` extra); an optional review pass lets the engine correct flagged parts, never your edits. Review filters by finding and shows the corrections as a diff.
31
+ - **Bilingual EPUB** export (EPUB and PDF books): each paragraph of the original followed by its translation (`--format bilingual-epub`).
32
+ - **EPUB exports ready for Kindle and Kobo:** the cover shows in the device library and fills the screen; page numbers (about 1850 characters per page) make Kindle show "Page x of y" instead of locations; EPUB 2 books become EPUB 3; complete table of contents, landmarks and metadata, and an identifier of their own. Choose your own cover with **Choose cover** on the Export screen or `obt export --cover`. Settings under `output.ereader` in `pipeline.yaml`.
33
+ - **PDF export** for every book ([ADR 0013](docs/adr/0013-pdf-export-with-typst.md)): `--format pdf`, or **PDF** on the Export screen. Made from the translated book with Typst (the `typst` package, about 30 MB more per install): a cover page (your chosen cover or the book's own, SVG covers included), a title page, a table of contents, justified and hyphenated text, page numbers, images, tables and notes. Page size A5, A4, Letter or 6×9 in (`output.pdf` in `pipeline.yaml`). Arabic, Hebrew, Indic and CJK text needs fonts installed on the system.
34
+ - **Translated title and authors** ([ADR 0014](docs/adr/0014-translated-title-and-export-file-names.md)): at the start of a translation the engine suggests the book's title and authors in the target language (an established title when there is one; names kept or transliterated, never translated). Edit them, ask again or go back to the original on the Export screen, with `obt metadata` or through the API (`GET/PUT/DELETE /api/projects/{slug}/metadata`, `POST .../metadata/suggest`); your edit is never replaced by a suggestion. They go inside EPUB, Word and PDF exports.
35
+ - **Export file names:** exports are named after the book's title and authors in the target language, `output/<Title> - <Authors>.<ext>` (for example `Três Fábulas de Esopo - Esopo.epub`; `.bilingual.epub` for the bilingual EPUB), the same name on disk and in the download. Text and Markdown books without a title are named after the file you imported. `--out` chooses another path.
36
+ - **Resumable jobs:** every block is tracked in a per-project SQLite database. A usage or rate limit pauses the job (with the reset time when the engine reports it); resume it later without resending finished work. Crashes and restarts are recovered.
37
+ - **Web interface** (`obt serve`, on `127.0.0.1` only): Library, Configure (with an engine health check), Run (live progress, pause, resume, cancel), Review (side-by-side editor with placeholder chips, retranslate a block), Preview (in-browser reader) and Export. Fonts and scripts are bundled; nothing is fetched from the internet.
38
+ - **Command line:** `obt translate`, `obt projects list|show|delete`, `obt export`, `obt metadata`, `obt analyze`, `obt qa`, `obt doctor`, `obt serve`, `obt version`.
39
+ - **Packaging:** one command runs everything: `uvx openbooktranslation serve`. The wheel ships the built interface, so Node.js is not needed.
40
+ - **Windows:** the tests and the wheel's install-and-serve check run on Windows in CI (and the tests on macOS). On Windows, a Codex or Gemini run that times out or is cancelled is stopped with its whole process tree, Ctrl-Break stops `obt serve` cleanly, and a busy port is never shared with another server.
41
+ - **One-line installer** for Linux, macOS (`curl -LsSf …/releases/latest/download/install.sh | sh`) and Windows (`powershell -ExecutionPolicy Bypass -c "irm …/install.ps1 | iex"`): installs uv if needed, the app with `uv tool install` (options `--with pdf,qa`, `--no-launch`, `--no-desktop`), an **OpenBookTranslation** entry in the app menu / `~/Applications` / Start menu and on the desktop, and opens the app. `obt uninstall [--purge]` removes it again (keeping your books unless `--purge`).
42
+ - **App launcher:** `obt launch` (what the icons run; `obt-app` without a console window) starts the app in the background or brings you back to the one already running; **Quit** in the sidebar's ⋯ menu or the command palette stops it. `obt shortcuts install|remove` manages the icons.
43
+ - **Updates, opt-in:** the setup assistant (or Settings → About, while there is no answer) asks once whether the app may check PyPI for new releases (at most daily, no identifier; see [ADR 0011](docs/adr/0011-opt-in-update-check.md)); **Check now** checks on demand. Installs made by the installer update with **Update and restart** (or at launch, with automatic checks on) and say "Updated to X" afterwards; other installs are shown the command to run.
44
+ - **Documentation:** a [user guide](docs/user-guide.md).
45
+
46
+ ### Security
47
+
48
+ - The server binds to `127.0.0.1`, checks `Host` and `Origin`, limits upload sizes and sends a strict Content Security Policy. FastAPI's built-in OpenTelemetry support is switched off: there is no telemetry.
49
+ - The app contacts nothing by itself unless you turn on the update check; then only `pypi.org`, once a day at most.
50
+ - PDF exports are compiled in a temporary folder that holds only the book's checked images, with no Typst packages, so a book cannot make the PDF read other files or the network; book text never becomes Typst markup. SVG images lose their links to other files first.
51
+
52
+ [Unreleased]: https://github.com/AlvaroVeloso070/openbooktranslation/compare/v0.1.0...HEAD
53
+ [0.1.0]: https://github.com/AlvaroVeloso070/openbooktranslation/releases/tag/v0.1.0
@@ -0,0 +1,122 @@
1
+ # Contributing to OpenBookTranslation
2
+
3
+ Thanks for your interest! This project is built epic by epic; see [docs/epics/README.md](docs/epics/README.md) for what is planned and what is in progress.
4
+
5
+ ## Development setup
6
+
7
+ Prerequisites:
8
+ - Python 3.12+ and [uv](https://docs.astral.sh/uv/)
9
+ - Node.js 22+ and [pnpm](https://pnpm.io/) (only for the web UI)
10
+ - Optional:
11
+ - the `claude` CLI, logged in with your own account, to try the subscription engine
12
+ - `ANTHROPIC_API_KEY`, for the API engine
13
+ - Java + [epubcheck](https://github.com/w3c/epubcheck), for EPUB validation tests
14
+
15
+ ```bash
16
+ git clone https://github.com/AlvaroVeloso070/openbooktranslation.git && cd openbooktranslation
17
+ uv sync
18
+ uv run pre-commit install
19
+ uv run pytest
20
+ pnpm -C web install && pnpm -C web test
21
+ ```
22
+
23
+ You can develop the whole app without any LLM account: use the `fake` engine.
24
+
25
+ ### The web UI
26
+
27
+ The UI in `web/` is a React + TypeScript app (Vite, Tailwind CSS, shadcn/ui; [ADR 0009](docs/adr/0009-frontend-react-shadcn.md)). Its layout and conventions are in [web/README.md](web/README.md) and [architecture §8](docs/architecture.md#8-web-ui).
28
+
29
+ ```bash
30
+ uv run obt serve --port 8765 --engine-override fake # the API, with the fake engine
31
+ pnpm -C web dev # Vite dev server; proxies /api to port 8765
32
+ pnpm -C web lint && pnpm -C web check && pnpm -C web test
33
+ pnpm -C web build # into src/openbooktranslation/server/static
34
+ pnpm -C web test:e2e # Playwright, after build (first: pnpm -C web exec playwright install chromium)
35
+ ```
36
+
37
+ - After an API change, run `uv run python -m openbooktranslation.server.openapi`, then `pnpm -C web gen:api`; tests fail while either generated file is stale.
38
+ - Components from shadcn/ui live in `web/src/components/ui/` and are ours to edit. New npm dependencies must have a permissive licence (MIT, ISC, BSD, Apache-2.0); list them in the pull request.
39
+ - UI changes that are visible come with updated screenshots in `docs/images/` when a documented screen changes (1280×800, Paper theme, fake engine).
40
+
41
+ ## Test policy (mandatory)
42
+
43
+ - Every change that touches behaviour comes with tests. Pull requests without tests for new behaviour are not merged.
44
+ - The default test run (`uv run pytest`) must be **offline**: no network, no real LLM calls.
45
+ - Tests that hit a real engine are marked `@pytest.mark.live`. They are skipped unless `OBT_LIVE_TESTS=1` is set.
46
+ - Branch coverage on `src/` must stay **≥ 85%**. CI enforces it.
47
+ - Bug fixes start with a failing test that reproduces the bug.
48
+
49
+ Details are in [docs/testing.md](docs/testing.md).
50
+
51
+ ## Branches and commits
52
+
53
+ - Branch names: `epic/E03-engines`, `feat/<short-topic>`, `fix/<short-topic>`, `docs/<short-topic>`.
54
+ - Commits follow [Conventional Commits](https://www.conventionalcommits.org/): `feat(epub): rewrite xhtml in place`, `test(pipeline): cover resume after crash`, `docs(adr): add 0007`.
55
+ - Keep pull requests focused: one story, or a few small related stories, per PR.
56
+
57
+ ## Definition of Done
58
+
59
+ A change is done when it meets the global [Definition of Done](docs/epics/README.md#definition-of-done):
60
+ - tests added and green
61
+ - coverage gate kept
62
+ - `ruff` and `pyright` clean; for UI changes, `pnpm -C web lint`, `check`, `test` and `build`
63
+ - docs and ADRs updated
64
+ - acceptance criteria demonstrated
65
+ - no credential handling
66
+
67
+ ## Building the package
68
+
69
+ The wheel ships the built web UI (`src/openbooktranslation/server/static/`, git-ignored), so build the UI first:
70
+
71
+ ```bash
72
+ pnpm -C web install --frozen-lockfile && pnpm -C web build
73
+ uv build # dist/*.tar.gz and dist/*.whl
74
+ uv run python scripts/check_dist.py dist/ # the UI is in, nothing else leaks in
75
+ uv run python scripts/wheel_smoke.py dist/ # clean venv: obt --version, doctor, a PDF export, serve
76
+ ```
77
+
78
+ - The build backend is hatchling. A build hook (`scripts/hatch_build.py`) stops `uv build` with a clear message when the UI is missing; if `pnpm` is on `PATH`, it builds the UI itself. Editable installs (`uv sync`) skip the check.
79
+ - The sdist carries the `web/` sources **and** the built UI, so installing from it needs no Node.js. The wheel carries only the built UI.
80
+ - The version comes from git tags through `hatch-vcs`: `v0.1.0` → `0.1.0`; an untagged commit builds as something like `0.1.dev19+g1ced091`. There is no version number to edit anywhere.
81
+ - The UI build is not checked for staleness: rebuild it after changing `web/`. The release workflow always builds it fresh.
82
+
83
+ ## Releasing
84
+
85
+ Releases are automated by [`.github/workflows/release.yml`](.github/workflows/release.yml), triggered by pushing a `v*` tag: full CI → build the UI → build the sdist and wheel → check their contents and that the version equals the tag → install the wheel into clean venvs (Linux, macOS and Windows, Python 3.12 and 3.13) and smoke-test `obt --version`, `obt doctor` and `obt serve` → run the installer end-to-end workflow (`installer-e2e.yml`: shellcheck and PSScriptAnalyzer, then on Linux, macOS and Windows `scripts/installer_e2e.py` installs a locally built `99.0.0` wheel with `install.sh`/`install.ps1`, checks the shortcuts, launches, reuses and quits the app, updates it to `99.0.1` through the API and uninstalls it) → publish with PyPI trusted publishing → create the GitHub release with the changelog section, the artifacts and the installer scripts `install.sh` and `install.ps1` (the one-liners download them from `…/releases/latest/download/`, so the newest release always serves the current scripts).
86
+
87
+ The installer end-to-end workflow can also be started by hand (Actions → Installer end-to-end → Run workflow). To try `install.sh` locally without touching your setup, point it at a wheel and at throw-away folders: `OBT_INSTALL_SPEC=dist/openbooktranslation-….whl UV_TOOL_DIR=/tmp/t/tools UV_TOOL_BIN_DIR=/tmp/t/bin XDG_DATA_HOME=/tmp/t/share HOME=/tmp/t/home OBT_DATA_DIR=/tmp/t/data sh scripts/install/install.sh --no-launch`. The app icons in `src/openbooktranslation/assets/icons/` are generated by `uv run python scripts/make_icons.py` and committed.
88
+
89
+ | Tag | Published to | GitHub release |
90
+ |---|---|---|
91
+ | `v0.1.0` | PyPI | release |
92
+ | `v0.1.0rc1`, `v0.1.0b1`, `v0.1.0a1` | TestPyPI | pre-release |
93
+
94
+ Tags must be the PEP 440 version with a `v` prefix (`v0.1.0rc1`, not `v0.1.0-rc.1`), or the version check fails.
95
+
96
+ **One-time setup** (repository maintainers):
97
+
98
+ 1. On [PyPI](https://pypi.org/manage/account/publishing/) and on [TestPyPI](https://test.pypi.org/manage/account/publishing/), add a *pending trusted publisher* for the project `openbooktranslation`: owner `AlvaroVeloso070`, repository `openbooktranslation`, workflow `release.yml`, environment `pypi` (on PyPI) or `testpypi` (on TestPyPI). No API token is created or stored.
99
+ 2. In the GitHub repository settings, create the environments `pypi` and `testpypi`. Restricting them to `v*` tags and requiring a reviewer for `pypi` is recommended.
100
+
101
+ **Each release:**
102
+
103
+ 1. In `CHANGELOG.md`, rename `## [Unreleased]` to `## [X.Y.Z] - YYYY-MM-DD` (drop its "rename this section" note), start a new empty `## [Unreleased]` above it, and update the links at the bottom. A pre-release uses its own section (`## [X.Y.ZrcN]`) when there is one, else the `X.Y.Z` section. The workflow fails before publishing if the section is missing. `git log --oneline vPREVIOUS..` (conventional commits) helps draft it.
104
+ 2. Commit, then tag and push: `git tag vX.Y.Z && git push origin vX.Y.Z`.
105
+ 3. Follow the run in the Actions tab.
106
+
107
+ Try a release candidate first, on a clean machine or container:
108
+
109
+ ```bash
110
+ uvx --index https://test.pypi.org/simple/ --index-strategy unsafe-best-match \
111
+ --from 'openbooktranslation==X.Y.ZrcN' obt serve
112
+ ```
113
+
114
+ TestPyPI carries only some of the dependencies (the rest come from PyPI). If the resolution picks odd versions, run the wheel attached to the GitHub pre-release instead: `uvx --from <wheel URL> obt serve`.
115
+
116
+ ## Architecture decisions
117
+
118
+ Significant decisions (new dependency families, storage format changes, new engine types, license-affecting deps) need an ADR in [docs/adr/](docs/adr/). Copy the format of an existing one and use the next number.
119
+
120
+ ## Credentials
121
+
122
+ Never commit, log, read or store LLM credentials. The subscription engines rely on the official CLIs/SDKs to authenticate. See [ADR 0002](docs/adr/0002-llm-engines-via-user-owned-cli-no-credentials.md).
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,185 @@
1
+ Metadata-Version: 2.5
2
+ Name: openbooktranslation
3
+ Version: 0.1.0
4
+ Summary: Local-first, open-source pipelines for translating whole books with LLMs you already have access to.
5
+ Project-URL: Homepage, https://github.com/AlvaroVeloso070/openbooktranslation
6
+ Project-URL: Documentation, https://github.com/AlvaroVeloso070/openbooktranslation/blob/main/docs/user-guide.md
7
+ Project-URL: Changelog, https://github.com/AlvaroVeloso070/openbooktranslation/blob/main/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/AlvaroVeloso070/openbooktranslation/issues
9
+ Author: Veloso
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Environment :: Web Environment
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Text Processing :: Linguistic
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: anthropic>=2.17.0
23
+ Requires-Dist: claude-agent-sdk>=0.2.189
24
+ Requires-Dist: cssselect>=1.6.0
25
+ Requires-Dist: fastapi>=0.165.1
26
+ Requires-Dist: httpx2>=2.18.0
27
+ Requires-Dist: jinja2>=3.1.6
28
+ Requires-Dist: keyring>=25.7.0
29
+ Requires-Dist: lxml>=6.2.1
30
+ Requires-Dist: markdown-it-py>=4.3.0
31
+ Requires-Dist: packaging>=24
32
+ Requires-Dist: pillow>=11
33
+ Requires-Dist: platformdirs>=4.14.9
34
+ Requires-Dist: pydantic>=2.14.4
35
+ Requires-Dist: python-docx>=1.2.0
36
+ Requires-Dist: python-multipart>=0.0.34
37
+ Requires-Dist: pyyaml>=6.0.4
38
+ Requires-Dist: rich>=15.0.0
39
+ Requires-Dist: typer>=0.26.0
40
+ Requires-Dist: typst<0.16,>=0.15
41
+ Requires-Dist: uvicorn[standard]>=0.55.0
42
+ Provides-Extra: pdf
43
+ Requires-Dist: docling-slim[convert-core,feat-ocr-rapidocr-onnx,format-pdf,models-local]>=2.156.0; extra == 'pdf'
44
+ Requires-Dist: torch>=2.2.2; extra == 'pdf'
45
+ Requires-Dist: torchvision>=0.17.0; extra == 'pdf'
46
+ Provides-Extra: qa
47
+ Requires-Dist: lingua-language-detector>=2.2.0; extra == 'qa'
48
+ Description-Content-Type: text/markdown
49
+
50
+ # OpenBookTranslation
51
+
52
+ > Local-first, open-source pipelines for translating whole books with the LLM subscriptions you already pay for.
53
+
54
+ OpenBookTranslation runs on your own machine. You pick a book, preview it, tune a translation pipeline in a web interface, and get back a translated (or bilingual) EPUB, or a PDF. It keeps the original layout, styles, images and footnotes. The LLM work goes through engines you already have access to. The first one is **your own Claude subscription**, through the official Claude Agent SDK. An Anthropic API key works too.
55
+
56
+ **Status:** pre-alpha. It works: EPUB, text, Markdown, Word and PDF books, the Claude subscription, API key, Codex CLI, Gemini CLI and Ollama engines, quality stages, resumable jobs and the web interface. More is planned; see [the epics](docs/epics/README.md).
57
+
58
+ ---
59
+
60
+ ## Features
61
+
62
+ ### MVP
63
+ - **EPUB in, EPUB out.** The original XHTML is rewritten in place, so CSS, fonts, images and links survive. TXT and Markdown are also supported.
64
+ - **Word and PDF.** DOCX books are translated in place (you get a DOCX back, or an EPUB). PDFs are converted to EPUB with [docling](https://github.com/docling-project/docling) when you import them; this needs the optional extra: `uv tool install 'openbooktranslation[pdf]'`.
65
+ - **Configurable pipelines** with presets (`fast`, `quality`), editable in the UI or as YAML.
66
+ - **Quality stages:** a glossary and style analysis before translating, QA checks and an optional LLM review pass after, and a bilingual EPUB output.
67
+ - **PDF export** for every book, made with [Typst](https://typst.app/) inside the app: cover, title page, table of contents, page sizes from A5 to Letter.
68
+ - **Translated titles.** The engine suggests the book's title and authors in your language (editable). They go inside the EPUB, Word and PDF files and name them: `Três Fábulas de Esopo - Esopo.epub`.
69
+ - **Engines:**
70
+ - your Claude subscription, through the Claude Agent SDK and your logged-in `claude` CLI
71
+ - Anthropic API key
72
+ - your ChatGPT plan, through OpenAI's official Codex CLI (`codex exec`)
73
+ - Gemini, through Google's official Gemini CLI (a paid Gemini API key or a Code Assist Standard/Enterprise license)
74
+ - local models through Ollama
75
+ - a fake engine for development and tests
76
+ - **Resumable jobs.** Every segment is tracked in SQLite. When you hit a usage limit, the job pauses; resume it later without losing work.
77
+ - **Web UI on localhost:**
78
+ - a library of covers; drop a book anywhere to add it
79
+ - live progress with the time left, the engine and model, and the book's settings (languages, glossary, style prompt, quality stages)
80
+ - side-by-side review and editor, with the quality findings ("mark as fine") and the review's corrections
81
+ - a reader: one page, two pages, or the original next to the translation
82
+ - export for any reading app, Kindle or Kobo, or as a PDF, with your own cover
83
+ - one settings window: themes, engines (and the Anthropic API key, kept in your OS keychain), defaults for new books
84
+
85
+ ### Later
86
+ - A translated user interface (i18n)
87
+
88
+ ---
89
+
90
+ ## How it works
91
+
92
+ ```
93
+ Browser (localhost) Your machine
94
+ ┌─────────────────────────────┐ ┌─────────────────────────────────────────────┐
95
+ │ Library · Translate │ │ FastAPI ──► Job runner ──► Pipeline stages │
96
+ │ Review · Preview · Export │◄─►│ │ │
97
+ └─────────────────────────────┘ │ ▼ │
98
+ │ Engine adapter │
99
+ │ ┌───────────────┬────────┴──────────┐ │
100
+ │ ▼ ▼ ▼ │
101
+ │ claude CLI Anthropic API codex CLI, │
102
+ │ (your login) (your key) gemini CLI,│
103
+ │ gemini, │
104
+ │ Project folder + SQLite ollama │
105
+ └─────────────────────────────────────────────┘
106
+ ```
107
+
108
+ Pipeline: **ingest → normalize → (analyze) → chunk → translate → (review) → rebuild**. Details are in [docs/architecture.md](docs/architecture.md).
109
+
110
+ **Stack:** Python 3.12+ with FastAPI, SQLite and lxml on the server; a React + TypeScript single-page app (Vite, Tailwind CSS, shadcn/ui) built into the package, so running it needs no Node.js; [foliate-js](https://github.com/johnfactotum/foliate-js) for the reader.
111
+
112
+ | Translate | Review |
113
+ |---|---|
114
+ | ![The Translate screen: progress, time left, chapters and the quality stages](docs/images/translate.png) | ![The Review screen: the original and the translation side by side, with findings](docs/images/review.png) |
115
+ | **Preview** | **Library** |
116
+ | ![The reader: the original and the translation side by side](docs/images/preview-side-by-side.png) | ![The library of covers](docs/images/library.png) |
117
+
118
+ ---
119
+
120
+ ## Using your Claude subscription
121
+
122
+ OpenBookTranslation **never asks for, reads, stores or forwards your Claude credentials.**
123
+
124
+ 1. Install Claude Code (the official `claude` CLI) and sign in **yourself** by running `claude` and then `/login`.
125
+ 2. In OpenBookTranslation, choose the **Claude (subscription)** engine. The app calls the official Claude Agent SDK, which runs your unmodified `claude` binary under your own account.
126
+ 3. Usage counts against your plan's limits. A full book is a large job: expect it to span several usage windows on smaller plans. Jobs pause and resume for exactly this reason.
127
+
128
+ Anthropic's terms allow an end user to sign in to the unmodified Claude Code binary with their own subscription. They do not allow third-party apps to offer claude.ai login or to handle subscription tokens. OpenBookTranslation is built to stay on the right side of that line. These terms have changed before; see [Legal and compliance](https://code.claude.com/docs/en/legal-and-compliance). That is why the **Anthropic API key** engine is a first-class alternative.
129
+
130
+ OpenBookTranslation is an independent project. It is not affiliated with or endorsed by Anthropic. It is "Powered by Claude" when you use a Claude engine.
131
+
132
+ ---
133
+
134
+ ## Quick start
135
+
136
+ Paste one line into a terminal. On **Linux and macOS**:
137
+
138
+ ```bash
139
+ curl -LsSf https://github.com/AlvaroVeloso070/openbooktranslation/releases/latest/download/install.sh | sh
140
+ ```
141
+
142
+ On **Windows** (PowerShell):
143
+
144
+ ```powershell
145
+ powershell -ExecutionPolicy Bypass -c "irm https://github.com/AlvaroVeloso070/openbooktranslation/releases/latest/download/install.ps1 | iex"
146
+ ```
147
+
148
+ The installer brings [uv](https://docs.astral.sh/uv/) (which installs Python for you; no Node.js needed), installs the app with `uv tool install`, adds **OpenBookTranslation** to your app menu and desktop, and opens it in your browser. Run it again to upgrade; `obt uninstall` removes it and keeps your books.
149
+
150
+ Prefer the terminal? With [uv](https://docs.astral.sh/uv/getting-started/installation/) installed you can run it without installing:
151
+
152
+ ```bash
153
+ uvx openbooktranslation serve # opens http://127.0.0.1:<port> in your browser
154
+ # or, headless:
155
+ uvx openbooktranslation translate my-book.epub --to pt-BR --engine claude-subscription
156
+ # try the interface without any account (the fake engine):
157
+ uvx openbooktranslation serve --engine-override fake
158
+ ```
159
+
160
+ `uvx openbooktranslation doctor` checks your setup. The [user guide](docs/user-guide.md) covers choosing an engine, the whole translation flow, troubleshooting and where your data lives.
161
+
162
+ Development setup: see [CONTRIBUTING.md](CONTRIBUTING.md).
163
+
164
+ ---
165
+
166
+ ## Documentation
167
+
168
+ | Document | What it covers |
169
+ |---|---|
170
+ | [docs/user-guide.md](docs/user-guide.md) | Installing, choosing an engine, translating a book, troubleshooting, backups |
171
+ | [CHANGELOG.md](CHANGELOG.md) | What changed in each release |
172
+ | [docs/case-study.md](docs/case-study.md) | Why Python, which libraries, and how the subscription engine is allowed to work |
173
+ | [docs/architecture.md](docs/architecture.md) | Components, domain model, pipeline, engines, storage, API, UI |
174
+ | [docs/testing.md](docs/testing.md) | Test strategy and the mandatory test policy |
175
+ | [docs/adr/](docs/adr/) | Architecture decision records |
176
+ | [docs/epics/README.md](docs/epics/README.md) | Implementation plan split into epics |
177
+ | [CLAUDE.md](CLAUDE.md) | Instructions for AI coding sessions working on this repo |
178
+
179
+ ## Please translate responsibly
180
+
181
+ Translate books you have the right to translate: public-domain works, your own texts, or books for personal use where your local law allows it. Do not use this tool to distribute copyrighted translations. DRM-protected files are not supported.
182
+
183
+ ## License
184
+
185
+ [Apache License 2.0](LICENSE).