Skip to main content

txt2epub

GitHub Actions Workflow Status PyPI - Version Docs

An auditable Chinese TXT → EPUB 3 converter with multi-level navigation for KOReader, Kindle, and other EPUB readers.

Every source line gets a disposition in a line ledger. Conversion refuses to write an EPUB unless the source/output/dropped text multiset balances, unless --allow-loss is passed explicitly.

AI usage disclosure: Most of this codebase was written by AI coding agents. Human maintainers have verified behavior with automated tests and real-book conversions, but have not performed a rigorous line-by-line review. Review the source before relying on it in sensitive environments.

Install

Requires Python 3.11+. Install with uv.

# install as an isolated CLI tool (recommended)
uv tool install txt2epub-cli

# or run once without installing
uvx --from txt2epub-cli txt2epub --help

The PyPI distribution is txt2epub-cli, and the CLI command is txt2epub.

Quick start

# inspect without writing anything
txt2epub inspect book.txt

# write book.epub next to the source file
txt2epub convert book.txt

# batch into a directory
txt2epub convert *.txt -o out/

Existing output files are skipped by default. Pass --force to overwrite them. A batch run ends with a summary of succeeded, failed, and skipped files.

Documentation

Full documentation (English and Simplified Chinese): https://ak1ra-lab.github.io/txt2epub/

Development

uv sync --group dev
uv run pre-commit install

just lint
just typecheck
just test

See the development documentation for test fixtures, local samples, docs, and release notes.

License

GPL-3.0-only. See LICENSE.

Metadata

Release files for txt2epub-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for txt2epub-cli 0.2.0
File Size Uploaded Provenance Actions
txt2epub_cli-0.2.0.tar.gz 153.7 kB With provenance Details for txt2epub_cli-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for txt2epub-cli 0.2.0
File Interpreter ABI Platform Actions
txt2epub_cli-0.2.0-py3-none-any.whl Python 3 none any Details for txt2epub_cli-0.2.0-py3-none-any.whl

Total release size: 207.3 kB

Release files / txt2epub_cli-0.2.0.tar.gz

Download URL txt2epub_cli-0.2.0.tar.gz
Size 153.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e5618ac64fc9b2ba650f5f7a8d8a670d07434e6111e6bb699be395adebce1b70
BLAKE2b-256 checksum
How to use checksums
2c625bb31eb9e84876b716bcd2d8b6b06b3062dd2032ded5f8141cf8ea7adbe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / txt2epub_cli-0.2.0-py3-none-any.whl

Download URL txt2epub_cli-0.2.0-py3-none-any.whl
Size 53.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a190a7337425d1c04f22228ef08a3aba24aca9a988731f57259d88bd71f3cd14
BLAKE2b-256 checksum
How to use checksums
510ea2607593319482e97a99cb121dc7066fad84b758cb94afa4dabfaa61705b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for txt2epub-cli 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for txt2epub_cli-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page