Skip to main content

epubcheck-bridge

PyPI test

epubcheck-bridge installs a pinned, checksum-verified copy of the official EPUBCheck distribution into the active Python environment. It exposes the upstream CLI as epubcheck and provides a small Python API for consuming JSON validation results.

It is a bridge to the official Java implementation, not a reimplementation of EPUB validation. This project is not affiliated with or endorsed by W3C or the DAISY Consortium.

The current release pins official EPUBCheck 5.3.0.

Requirements

  • Python 3.10 or newer
  • Java available as java on PATH
  • Network access when installing the pinned EPUBCheck distribution

Installation

Project dependency

Add the bridge, then explicitly install its pinned official distribution:

uv add epubcheck-bridge
uv run epubcheck-install
uv run epubcheck --version

Use uv add --dev epubcheck-bridge instead when validation is only a development or release task.

Inside an already activated virtual environment, pip can be used instead:

python -m pip install epubcheck-bridge
epubcheck-install
epubcheck --version

Standalone command

Install the two commands in an isolated uv tool environment:

uv tool install epubcheck-bridge
epubcheck-install
epubcheck --version

The installer must run from a virtual or tool environment. It places the official distribution under that environment's share/epubcheck-bridge/ directory. Re-running it is a no-op when the expected version and checksum are already installed; pass --force to replace it.

The download is explicit rather than an install hook or a first-run side effect. This keeps dependency installation predictable and lets offline validation fail with an actionable message.

Command-line usage

All arguments and the exit status are forwarded to the official command:

uv run epubcheck book.epub
uv run epubcheck --json report.json book.epub

When installed as a standalone tool, omit uv run.

Python API

Python callers can request a structured result:

from epubcheck_bridge import EpubCheckRunner

result = EpubCheckRunner().validate("book.epub")
if not result.passed:
    raise SystemExit(
        f"{result.fatals} fatal, {result.errors} error, {result.warnings} warning"
    )

EpubCheckResult includes the source and report paths, checker version, fatal, error and warning counts, subprocess exit code, parsed messages, and a passed property. Pass fail_on_warnings=True to validate() when warnings should also make the upstream command fail.

EpubCheckUnavailable reports resolution failures. EpubCheckExecutionError reports launch failures, timeouts, and unreadable or unexpected JSON reports.

Command resolution

The bridge resolves EPUBCheck in this order:

  1. command_path passed to EpubCheckRunner;
  2. the EPUBCHECK environment variable;
  3. the EPUBCHECK_JAR environment variable;
  4. the managed distribution installed by epubcheck-install;
  5. an external epubcheck command on PATH;
  6. /usr/share/java/epubcheck.jar.

An executable path is run directly. A .jar path is launched with java -jar.

Security and release policy

The upstream EPUBCheck version, archive URL, byte size, and SHA-256 digest are pinned in the package. Updating EPUBCheck requires a reviewed epubcheck-bridge release; runtime commands never resolve a moving "latest" download.

The EPUBCheck archive is downloaded directly from the upstream W3C GitHub release and retains its own license files. It is not bundled in this Python distribution.

epubcheck-bridge and EPUBCheck have independent version numbers and release cycles. A new bridge release is required whenever its pinned upstream distribution changes.

Development

The unit suite uses local fixtures and does not download EPUBCheck. The package repository owns one CI smoke test that downloads the pinned archive and runs the official Java version command.

uv sync --frozen
uv run ruff check .
uv run ruff format --check .
uv run pytest -q
uv build --no-sources

License

The Python bridge is released under the MIT License. The separately downloaded official EPUBCheck distribution is not part of this package and retains its own license.

Metadata

Release files for epubcheck-bridge 0.1.1

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

Source distribution (sdist)

Source distribution for epubcheck-bridge 0.1.1
File Size Uploaded Provenance
epubcheck_bridge-0.1.1.tar.gz 9.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for epubcheck-bridge 0.1.1
File Interpreter ABI Platform
epubcheck_bridge-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / epubcheck_bridge-0.1.1.tar.gz

Download URL epubcheck_bridge-0.1.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
094524887a4cb638521e91b6fcc4a914470a529cc6412508db51c9713bb18568
BLAKE2b-256 checksum
How to use checksums
bc966b2d16b27df060c3a72bd314b716e70392ce79f1c190f2ae3faa66fa98a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / epubcheck_bridge-0.1.1-py3-none-any.whl

Download URL epubcheck_bridge-0.1.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9734b024a1766e4986924d6918708dc5da61634c84362bb7e65ed58943e517c
BLAKE2b-256 checksum
How to use checksums
65902e0414f3583adcf0812a69d2919f857bf6901c752014930f4ade71583cd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for epubcheck-bridge 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.1 This release

2 release files No 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