From the collection
Bindery
No. 014
A command-line surgeon for malformed EPUBs. The fixes are deliberately boring: self-close the void elements, convert named entities to numeric, sync the NCX uid with the OPF, put the mimetype entry first in the zip. Each one is deterministic, and each one lands only if epubcheck confirms the patient actually improved. epubcheck stays an external oracle, never a Python dependency; the package itself is stdlib only. Dry-run is the default mode, and --apply backs up before it touches anything.
Built to operate inside a Calibre library without breaking it: a repair atomically replaces only the .epub, leaving metadata.opf, cover.jpg, and the database for Calibre’s own Quality Check to re-sync. An opt-in lossy mode (--strip-pagination) goes further, removing the baked-in page-number furniture that PDF and OCR conversions leave behind, behind its own safety guards. Sibling to oceanstrip; the two share the epubcheck no-regression gate.