From the collection
bindery-cli
A command-line surgeon for malformed EPUBs. The fixes are deterministic and cover everything from simple XML violations (self-closing void elements, numeric entity conversion, id colon replacements) to complex structural repairs (unwrapping illegal HTML tags, duplicate playOrder rewriting). Each fix lands only if epubcheck confirms the patient actually improved. epubcheck stays an external oracle, but bindery-cli invokes it through a persistent, transparent Java daemon that validates thousands of books in minutes without the JVM startup penalty.
Built to operate inside a Calibre library without breaking it, using cquarry for database integration (the same engine powering CalibreQuarry and Hermitage): the --install-to-calibre mode installs the repaired file atomically through cquarry’s write module, re-registering the format row in a single transaction so the stored size stays truthful and Calibre regenerates its sidecar on next start (no external calibredb call involved), with a safe in-place fallback when the database cannot confirm the book. Opt-in lossy modes (--strip-pagination, --strip-watermarks, --unwrap-illegal-tags) go further, systematically removing baked-in page numbers, distributor stamps, and invalid HTML tags across an entire library, guarded by strict safety nets. It also includes text auditing, replacing the former standalone oceanstrip and audit_epub tools.