Skip to content

epubveri for calibre 0.1.0

Latest

Choose a tag to compare

@bariskayadelen bariskayadelen released this 03 Sep 15:47
· 1 commit to main since this release

Validates the book open in calibre's Edit Book with
epubveri — no Java, sub-second, and
reporting epubcheck's own message IDs. It reads your book and reports; it
changes nothing.

Install: Preferences → Plugins → Load plugin from file, choose
epubveri_v0.1.0.zip, then restart calibre. The tool appears in the editor's
Plugins menu and toolbar as Validate with epubveri.

On first use it downloads the epubveri binary for your platform (~3 MB) into
<calibre config>/plugins/epubveri/ and verifies it against that release's
SHA256SUMS.txt. The zip contains no binary.

What it does

  • Every finding in a panel with its file, line and message. Activating a
    row opens the file and puts the cursor on the line, the same way calibre's
    own Check Book results do.
  • Validates what calibre currently holds, including unsaved edits.
  • Labels every line — ERROR, WARNING, USAGE, ADVISORY — and each
    advisory says epubcheck does not report it and the verdict is unaffected.
    Only errors, fatals and warnings decide VALID/NOT VALID, exactly as in
    epubcheck.
  • A settings page (Preferences → Plugins → epubveri → Customize) with
    three switches: automatic updates, show usage notes, show advisory findings.
    All three start on, so out of the box calibre and Sigil report a book
    identically. Whenever a switch hides something the summary says how many
    findings are not listed and where the setting is — never a silently shorter
    report.
  • Verifies the binary before every run (~1.8 ms for 2.8 MB) and keeps it
    current at most once an hour by reading 842 bytes of checksums rather than
    asking an API. Turn that off in the settings and it never touches the
    network. Offline is silent.

It does not touch your book, and that is measured

calibre keeps unsaved edits in the open editors, so they are committed to the
container first. The container is then cloned and the clone written out,
because EpubContainer.commit calls update_modified_timestamp() — committing
the real container would rewrite an EPUB 3 book's dcterms:modified, so
validating would edit the book.

Cloning alone was not enough: the timestamp update dirties the OPF, and a
dirtied file is re-serialised rather than copied. calibre's serialiser is not
byte-preserving, so the OPF gained a line and every finding below it was
reported one line off. That is now neutralised on the clone, and a test asserts
that every file in the packaged copy is byte-identical to the container's.

How much it has been used

calibre 9.14, macOS, one day. Nothing has run on Windows or Linux, and no
other calibre release has loaded it — minimum_calibre_version is 6.0 because
that is when qt.core replaced PyQt5.Qt, which is the oldest it can load
on, not the oldest it has been run on.

Five defects were found on its first day by running it inside calibre, and a
sixth by its own tests; the suite is 24 tests, run with
calibre-debug plugins/calibre/tests/test_plugin.py. That rate has not
flattened, which is why this is 0.1.0.

Bug reports here. A wrong finding rather than a wrong plugin belongs in
epubveri — a wrong error on a
good book is the report we most want.

Credit

Doitsu wrote the first epubveri plugin for calibre and proved the idea;
thiago.eec contributed to it. This is an independent implementation rather than
a fork — none of their code is used — but what it needed to do was learned from
theirs, and his is the one that has been in users' hands.