Skip to content

Releases: cumabozkurt/epub-tr

epub-tr 1.2.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 12:00

English

Added

  • Poems in <pre> are now translated. Line breaks are kept (<br/>); code-like blocks
    (<pre><code>, programming text) are still skipped. Use --keep-pre for the old behaviour.
  • Text fixes before translation: stretched words are normalised (Beau—ootiful Soo—oop →
    Beautiful Soup) and words broken across <br/> are re-joined (two p<br/>ennyworth).
    Turn them off with --no-text-fixes.
  • --strip-boilerplate: removes the Project Gutenberg header, START/END markers and license from the output.
  • --quality: a check for garbled machine translation that needs no LLM. It flags segments with an
    abnormal length ratio, repeated words, too few target-language words or leftover source words, then
    re-translates them (whole segment, sentence by sentence, with every MT engine) and keeps the candidate
    with the best back-translation score. The cache is updated, so a re-run keeps the fix.
  • --qa: after the EPUB is written, text that still contains source-language words is re-translated
    (sentence level, then word level) and reported in the run stats. It also catches capitalised common
    nouns copied from the source (Hearthrug) while leaving names (Alice, Bill) alone.
  • New optional extra qa (pip install "epub-tr[qa]", installs wordfreq), needed by --quality and --qa.
  • epub-tr is on PyPI: pip install epub-tr. The README has a PyPI badge and pip install instructions.
  • Release workflow: a pypi job uploads the wheel and sdist with twine and verifies
    pip install epub-tr==X.Y.Z when the PYPI_API_TOKEN secret is set; otherwise it is skipped with a
    notice. Trusted publishing is documented as an alternative. Release notes now start with pip install epub-tr==X.Y.Z.
  • Bilingual (TR/EN) project website on GitHub Pages (site/, deployed by .github/workflows/pages.yml).
  • Project banner (docs/images/banner.svg) at the top of both READMEs, a 1280×640 social preview
    image and scripts/outline_banner.py, which builds both from docs/images/banner.src.svg.
  • 147 offline tests (up from 120), including new suites for text fixes and the quality check.

Changed

  • <pre> blocks are translated by default (see above). If you relied on them staying in the source
    language, pass --keep-pre.

Fixed

  • --qa no longer reports ALL-CAPS names or host names as leftovers; it checks ALL-CAPS words, splits
    Turkish suffixes after an apostrophe and re-translates whole source-language runs instead of single words.
  • Stricter compound-word test for capitalised nouns; capitalised runs are lower-cased before re-translation.
  • CI lint: codespell no longer flags the stretched-word test fixture (beauti—FUL).

Install

pip install epub-tr==1.2.0
# or the wheel attached to this release
pip install "epub-tr @ https://github.com/cumabozkurt/epub-tr/releases/download/v1.2.0/epub_tr-1.2.0-py3-none-any.whl"
# or from source
pip install "git+https://github.com/cumabozkurt/epub-tr@v1.2.0"

Assets: wheel, source distribution and SHA256SUMS.txt (verify with sha256sum -c SHA256SUMS.txt).


Türkçe

Eklendi

  • <pre> içindeki şiirler artık çevriliyor. Satır sonları (<br/>) korunuyor; kod gibi görünen
    bloklar (<pre><code>, programlama metni) yine atlanıyor. Eski davranış için --keep-pre.
  • Çeviriden önce metin düzeltmeleri: uzatılmış kelimeler düzeltiliyor (Beau—ootiful Soo—oop →
    Beautiful Soup), <br/> ile bölünmüş kelimeler birleştiriliyor (two p<br/>ennyworth).
    Kapatmak için --no-text-fixes.
  • --strip-boilerplate: Project Gutenberg başlığını, START/END işaretlerini ve lisans metnini çıktıdan siler.
  • --quality: bozuk makine çevirisini LLM gerektirmeden yakalar. Uzunluk oranı anormal, kelime
    tekrarı olan, hedef dilde çok az kelime içeren ya da kaynak dilde kelime bırakan bölümleri işaretler;
    bunları yeniden çevirir (bölümün tamamı, cümle cümle, her MT motoruyla) ve geri çeviri puanı en iyi
    olan adayı seçer. Önbellek de güncellenir, yeniden çalıştırınca düzeltme korunur.
  • --qa: EPUB yazıldıktan sonra hâlâ kaynak dilde kelime içeren metinler yeniden çevrilir (önce cümle,
    sonra kelime düzeyinde) ve çalışma istatistiklerinde raporlanır. Kaynaktan aynen kopyalanmış büyük
    harfli cins isimleri de (Hearthrug) yakalar, özel isimlere (Alice, Bill) dokunmaz.
  • Yeni isteğe bağlı qa eki (pip install "epub-tr[qa]", wordfreq kurar); --quality ve --qa için gerekli.
  • epub-tr artık PyPI'da: pip install epub-tr. README'de PyPI rozeti ve pip install talimatı var.
  • Sürüm iş akışı: PYPI_API_TOKEN sırrı tanımlıysa pypi işi wheel ve sdist dosyalarını twine ile
    yükler ve pip install epub-tr==X.Y.Z ile doğrular; sır yoksa bir bildirimle atlanır. Güvenilir
    yayıncı (trusted publishing) alternatif olarak belgelendi. Sürüm notları artık pip install epub-tr==X.Y.Z ile başlıyor.
  • GitHub Pages'te iki dilli (TR/EN) proje sitesi (site/, .github/workflows/pages.yml ile yayımlanıyor).
  • İki README'nin en üstünde proje afişi (docs/images/banner.svg), 1280×640 sosyal önizleme görseli ve
    ikisini docs/images/banner.src.svg kaynağından üreten scripts/outline_banner.py.
  • 147 çevrimdışı test (önceden 120); metin düzeltmeleri ve kalite denetimi için yeni test takımları var.

Değişti

  • <pre> blokları artık varsayılan olarak çevriliyor (yukarıya bakın). Kaynak dilde kalmalarını
    istiyorsanız --keep-pre kullanın.

Düzeltildi

  • --qa artık tamamı büyük harfli isimleri ve alan adlarını artık kelime olarak raporlamıyor; tamamı
    büyük harfli kelimeleri denetliyor, kesme işaretinden sonraki Türkçe ekleri ayırıyor ve tek tek
    kelimeler yerine kaynak dildeki kelime dizisini bütün olarak yeniden çeviriyor.
  • Büyük harfli isimler için daha sıkı birleşik kelime denetimi; büyük harfli diziler yeniden
    çevrilmeden önce küçük harfe çevriliyor.
  • CI yazım denetimi: codespell artık uzatılmış kelime test örneğini (beauti—FUL) hata saymıyor.

Kurulum

pip install epub-tr==1.2.0
# or the wheel attached to this release
pip install "epub-tr @ https://github.com/cumabozkurt/epub-tr/releases/download/v1.2.0/epub_tr-1.2.0-py3-none-any.whl"
# or from source
pip install "git+https://github.com/cumabozkurt/epub-tr@v1.2.0"

Dosyalar: wheel, kaynak paketi ve SHA256SUMS.txt (sha256sum -c SHA256SUMS.txt ile doğrulayın).

epub-tr 1.1.0

Choose a tag to compare

@github-actions github-actions released this 07 Oct 21:25

English

Added

  • Test suite: 120 offline tests (fake engines and mocked HTTP, no network) cover placeholder encoding,
    EPUB reading and writing, the pipeline, every engine adapter, the prompts and the CLI. Coverage is 93%.
  • CI on Ubuntu, Windows and macOS with Python 3.10–3.13, plus ruff, codespell, markdownlint, an offline
    link check, a package build with twine check, a clean-venv wheel install and an EPUBCheck 5.4.0 job.
  • CodeQL (Python and Actions), a weekly link check, Dependabot (pip and GitHub Actions) and pre-commit hooks.
  • Tag-driven release workflow: it checks that the tag matches the version, runs the tests, builds the
    sdist and wheel, writes SHA256SUMS.txt and publishes a GitHub release with notes in English and Turkish.
  • Release tooling: scripts/release.py and scripts/release_notes.py. Validation tooling:
    scripts/validate_epub.py (EPUBCheck JSON) and scripts/check_links.py (Markdown links and anchors).
  • Community files: CONTRIBUTING (EN/TR), CODE_OF_CONDUCT, SECURITY, bilingual issue forms (bug,
    translation quality, feature) and a pull request template.
  • Docs: docs/ARCHITECTURE.md, docs/ENGINES.md and docs/AUTOMATION.md, each with a Turkish version.
  • Real OpenCode results on The Gift of the Magi: raw, polished and bilingual EPUBs, run logs, a
    side-by-side comparison and EPUBCheck output, all committed under out/.
  • engine_models in the run summary records the model each engine actually ended on. OpenCode can
    switch models during a run.

Changed

  • OpenCode now skips to the next free model when a model returns empty output. Before, it only did
    this on rate limits. In the real run, one model returned nothing over and over.
  • The engine list in the run header reads opencode/big-pickle instead of opencode/opencode/big-pickle.
  • Minimum Python is now 3.10. Package metadata is complete: classifiers, URLs, keywords and dev extras.

Fixed

  • Bilingual output: rebuilt inline anchors kept their id, so EPUBs could contain duplicate IDs.
  • The running glossary accepted reversed or invented entries from the model, such as
    Hediyenin Getirdiği Mutluluk => The Gift of the Magi. A source term is now kept only if it occurs in the chunk, and stale entries from older runs are ignored.
  • MyMemory recursed forever on a single sentence longer than the 500-byte limit. Text is now split by
    sentence, then word, then character.
  • Plain text taken from a segment merged words across <br/>.
  • No pointless back-off sleep after the last retry.
  • On Windows, the OpenCode agent config was written without UTF-8. Timed-out OpenCode processes are now reaped.
  • The CLI no longer crashes on consoles that cannot encode Turkish characters.
  • EPUB files and the cache are now closed properly.

Install

pip install "epub-tr @ https://github.com/cumabozkurt/epub-tr/releases/download/v1.1.0/epub_tr-1.1.0-py3-none-any.whl"
# or from source
pip install "git+https://github.com/cumabozkurt/epub-tr@v1.1.0"

Assets: wheel, source distribution and SHA256SUMS.txt (verify with sha256sum -c SHA256SUMS.txt).


Türkçe

Eklendi

  • Test takımı: 120 çevrimdışı test (sahte motorlar ve taklit HTTP ile, ağ yok). Yer tutucu kodlamayı,
    EPUB okuma ve yazmayı, çeviri hattını, tüm motor bağdaştırıcılarını, istemleri ve CLI'yi kapsıyor.
    Kapsama oranı %93.
  • Ubuntu, Windows ve macOS'ta, Python 3.10–3.13 ile CI. Ayrıca ruff, codespell, markdownlint,
    çevrimdışı bağlantı denetimi, twine check ile paket derleme, temiz bir venv'de wheel kurulumu ve
    bir EPUBCheck 5.4.0 işi.
  • CodeQL (Python ve Actions), haftalık bağlantı denetimi, Dependabot (pip ve GitHub Actions) ve
    pre-commit kancaları.
  • Etiketle tetiklenen sürüm iş akışı: etiketin sürümle eşleştiğini denetler, testleri çalıştırır,
    sdist ve wheel derler, SHA256SUMS.txt yazar ve İngilizce ile Türkçe notlu bir GitHub sürümü yayımlar.
  • Sürüm araçları: scripts/release.py ve scripts/release_notes.py. Doğrulama araçları:
    scripts/validate_epub.py (EPUBCheck JSON) ve scripts/check_links.py (Markdown bağlantıları ve çapaları).
  • Topluluk dosyaları: CONTRIBUTING (EN/TR), CODE_OF_CONDUCT, SECURITY, iki dilli sorun formları (hata,
    çeviri kalitesi, özellik isteği) ve bir çekme isteği şablonu.
  • Belgeler: docs/ARCHITECTURE.md, docs/ENGINES.md ve docs/AUTOMATION.md; her birinin Türkçesi de var.
  • The Gift of the Magi üzerinde gerçek OpenCode sonuçları: ham, redaksiyonlu ve iki dilli EPUB'lar,
    çalışma günlükleri, yan yana karşılaştırma ve EPUBCheck çıktısı. Hepsi out/ altında depoda.
  • Çalışma özetine engine_models eklendi. Her motorun sonunda gerçekten kullandığı modeli kaydeder;
    OpenCode çalışma sırasında model değiştirebiliyor.

Değişti

  • OpenCode artık boş çıktı veren bir modelde de sıradaki ücretsiz modele geçiyor. Önceden bunu yalnızca
    kota sınırında yapıyordu. Gerçek çalıştırmada bir model art arda boş yanıt döndürdü.
  • Çalıştırma başlığındaki motor listesi opencode/opencode/big-pickle yerine opencode/big-pickle yazıyor.
  • En düşük Python sürümü artık 3.10. Paket üst verisi tamamlandı: sınıflandırıcılar, bağlantılar,
    anahtar sözcükler ve dev ekleri.

Düzeltildi

  • İki dilli çıktı: yeniden kurulan satır içi çapalar id özniteliğini koruyordu, bu yüzden EPUB'da
    yinelenen kimlikler oluşabiliyordu.
  • Yürüyen sözlük, modelin bildirdiği ters ya da uydurma girdileri kabul ediyordu (örneğin
    Hediyenin Getirdiği Mutluluk => The Gift of the Magi). Artık kaynak terim yalnızca o parçada geçiyorsa saklanıyor; önceki çalıştırmalardan kalan geçersiz girdiler yok sayılıyor.
  • MyMemory, 500 bayt sınırını aşan tek bir cümlede sonsuz özyinelemeye giriyordu. Metin artık önce
    cümleye, sonra sözcüğe, en son karaktere göre bölünüyor.
  • Bir parçadan alınan düz metinde <br/> iki yanındaki sözcükler birleşiyordu.
  • Son denemeden sonra gereksiz bekleme yapılmıyor.
  • Windows'ta OpenCode ajan yapılandırması UTF-8 olmadan yazılıyordu. Zaman aşımına uğrayan OpenCode
    süreçleri artık düzgünce sonlandırılıyor.
  • Türkçe karakterleri kodlayamayan konsollarda CLI artık çökmüyor.
  • EPUB dosyaları ve önbellek artık düzgünce kapatılıyor.

Kurulum

pip install "epub-tr @ https://github.com/cumabozkurt/epub-tr/releases/download/v1.1.0/epub_tr-1.1.0-py3-none-any.whl"
# or from source
pip install "git+https://github.com/cumabozkurt/epub-tr@v1.1.0"

Dosyalar: wheel, kaynak paketi ve SHA256SUMS.txt (sha256sum -c SHA256SUMS.txt ile doğrulayın).

epub-tr 1.0.0 — first public release / ilk sürüm

Choose a tag to compare

@cumabozkurt cumabozkurt released this 03 Oct 20:25

epub-tr 1.0.0 — first public release / ilk herkese açık sürüm

Translate EPUB books into natural, literary Turkish (other target languages work too) while keeping the book intact — formatting, images, CSS, fonts, TOC (nav + NCX), metadata and internal links. All engines are free.

✨ Highlights (EN)

  • Structure-preserving EPUB I/O — read with ebooklib + lxml; write at ZIP level: original entries are copied byte-for-byte, only translated XHTML, OPF (dc:language, title) and nav/NCX labels change. Outputs add no new EPUBCheck errors.
  • Inline markup kept — <i>, <em>, anchors, <br/>, footnote refs become neutral placeholders and are rebuilt with all attributes; a lenient fallback keeps every anchor/link.
  • Engines: opencode (OpenCode Zen free models with automatic switching on rate limits), ollama, google, bing / yandex / modernmt (via translators), mymemory, lingva, libretranslate, argos (offline), and OpenAI-compatible presets openrouter, gemini, groq, mistral, openai.
  • Literary LLM pipeline: chunking with stable <seg id>s, context window, running glossary persisted in the cache, proper-name detection with Turkish apostrophe suffixes, a Turkish literary prompt (TDK spelling, register, sen/siz consistency), --dialogue quotes|dash, optional --polish second pass.
  • Robustness: per-chunk --fallback chain, retries with back-off, SQLite cache = free resume, bilingual mode, --chapters / --limit, --stats and --dump.
  • Docs: full EN/TR README (CLI and environment reference, glossary format, architecture, troubleshooting), TEST_REPORT.md, RESEARCH.md (survey of 15 open-source translators).

✨ Öne çıkanlar (TR)

  • Yapıyı koruyan EPUB okuma/yazma — ebooklib + lxml ile okuma; ZIP düzeyinde yazma: özgün dosyalar bayt bayt kopyalanır, yalnızca çevrilen XHTML, OPF (dc:language, başlık) ve nav/NCX etiketleri değişir. Çıktılar EPUBCheck'te yeni hata üretmez.
  • Satır içi biçim korunur — <i>, <em>, bağlantılar, <br/>, dipnotlar yer tutuculara çevrilip tüm öznitelikleriyle geri kurulur; esnek geri dönüş tüm bağlantıları korur.
  • Motorlar: opencode (kota sınırında otomatik model değişimiyle OpenCode Zen ücretsiz modelleri), ollama, google, bing / yandex / modernmt (translators ile), mymemory, lingva, libretranslate, argos (çevrimdışı) ve OpenAI uyumlu openrouter, gemini, groq, mistral, openai.
  • Edebi LLM hattı: kararlı <seg id> kimlikli parçalama, bağlam penceresi, önbellekte saklanan yürüyen sözlük, kesme işaretli Türkçe eklerle özel ad tespiti, Türkçe edebi istem (TDK yazımı, üslup, sen/siz tutarlılığı), --dialogue quotes|dash, isteğe bağlı --polish redaksiyon geçişi.
  • Dayanıklılık: parça başına --fallback zinciri, yeniden deneme, SQLite önbellek ile kaldığı yerden devam, iki dilli mod, --chapters / --limit, --stats ve --dump.
  • Belgeler: ayrıntılı EN/TR README (komut satırı ve ortam değişkeni başvurusu, sözlük biçimi, mimari, sorun giderme), TEST_REPORT.md, RESEARCH.md.

🧪 Tested / Test edildi

  • pytest: 5/5 passed.
  • Full-book runs on The Gift of the Magi (PG #7256) with google, bing, yandex, modernmt, argos, ollama gemma3:4b (+polish), aya-expanse:8b (partial), fallback chain and cache resume; The Yellow Wallpaper (PG #1952) via google. See TEST_REPORT.md.
  • Known limits: OpenCode free tier was rate-limited for the test IP during this release (integration verified, translation quality not yet measured); lingva/mymemory public endpoints were unavailable; API-key presets documented but not exercised.

📦 Install / Kurulum

git clone https://github.com/cumabozkurt/epub-tr.git && cd epub-tr
python3 -m venv .venv && . .venv/bin/activate
pip install -e '.[argos,extra]'
epub-tr translate book.epub -o book.tr.epub --engine opencode --polish --fallback google

MIT License.