audora-epublib (1.0.0)
Installation
pip install --index-url audora-epublibAbout this package
Clean-room EPUB 2/3 writer, a drop-in replacement for the API surface of ebooklib
audora-epublib
A proprietary python library for creating EPUB2/3 files.
This library functions as a drop-in replacement for the AGPL-licensed ebooklib, but was written without referencing any AGPL source code. Only the usage documentation and interface format of ebooklib were consulted during the creation of this library.
It does not aim to re-implement all functionality of ebooklib, merely that which is utilized by WattpadDownloader. The most notable exclusion is reading EPUB files.
This library aims to follow the EPUB 3.3 format specification, as defined by the World Wide Web Consortium, with minimal backwards compatibility supported for EPUB 2.
Installation
The package is published to the Forgejo registry, not to PyPI — the name epublib on PyPI belongs to an unrelated project. Resolve it explicitly:
pip install --extra-index-url https://forge.towu.dev/api/packages/aaron/pypi/simple/ audora-epublib
With uv, add the index to pyproject.toml so it applies to every command in the project:
[[tool.uv.index]]
name = "forgejo"
url = "https://forge.towu.dev/api/packages/aaron/pypi/simple/"
Usage
Everything public is exported from the top level:
from audora_epublib import EpubBook, EpubHtml, EpubImage, write_epub
book = EpubBook()
book.set_identifier("urn:uuid:...")
book.set_title("A Title")
book.set_language("en")
book.set_modified(datetime.now(timezone.utc))
book.add_author("An Author")
chapter = EpubHtml(
file_name="chapter_1.xhtml",
title="Chapter 1",
content="<h1>Chapter 1</h1><p>...</p>",
)
book.add_item(chapter)
write_epub("book.epub", book)
The full public surface — every class, method, signature and raised exception — is documented in api_specification.md.
Development
ruff is the formatter and linter; mypy --strict is the type checker. There is no test suite. See AGENTS.md for the conventions and the release process.
ruff format .
ruff check --fix .
mypy