Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-22-2026, 12:12 PM   #1
Kayadelenium
Addict
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 305
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
[GUI Plugin] epubsana

epubsana for calibre repairs a book in your calibre library with epubsana, my EPUB repair tool. epubsana fixes the defects epubveri reports where there is exactly one correct repair that keeps the content as it is, and leaves everything else alone.

What it does
  • Select one book and choose Repair the selected book from the epubsana button. It works on one book at a time.
  • A window lists every repair epubsana proposes for that book, in two groups, Safe and Check first. The safe ones are ticked. The ones that need your judgement are not, so you can look at them first. Selecting a line shows why the repair is safe, what to check, and what changes in each file it touches. Each group has its own tick box, so a book with a hundred findings is not ticked one line at a time.
  • Only the repairs you tick are made, and epubsana checks the book again afterwards. A repair that made the book worse is undone, and the report says so.
  • Some defects only show once another is repaired: an undeclared HTML entity, for example, hides an empty title behind it. When epubsana finds more after a round, the window comes back with them. Your library is written once, at the end.
  • If the book also has a KEPUB, it was made from the old EPUB, and the report reminds you to convert it again.

Why it is safe to point at your library
  • epubsana never writes to the file it reads. Every round runs on a copy in a temporary folder.
  • Nothing reaches your library until you have seen the proposed repairs and approved them. Cancelling, or a failed run, leaves the book as it was. If the EPUB changes in your library while the repair is running, nothing is written.
  • The EPUB as it was before the first repair is kept once and never overwritten. It is kept as ORIGINAL_EPUB, which calibre's own Restore in the Book details panel brings back. If the book already has an ORIGINAL_EPUB from an earlier conversion or polish, that one is left alone, and the old EPUB is kept among the book's data files instead. Repairing the same book again keeps the first copy. Put back the EPUB from before the repair, in the plugin's menu, restores it either way.
  • Each repair is recorded in a small repairs.json among the book's data files: the date, the versions, the repairs made, and the file's SHA-256 before and after.

Nothing is bundled. Like my other calibre plugins, it contains no binary. On first use it downloads epubsana for your platform from epubsana's own GitHub releases, verifies it against that release's published SHA256SUMS.txt before running it, and checks it again before every run. epubsana 0.44.0 or later is required; the plugin downloads the latest.

Installing. Download the zip attached to this post, then Preferences / Plugins / Load plugin from file, and restart calibre. If the epubsana button does not appear, add it under Preferences / Toolbars & menus. calibre 6.0 or later is required; if your calibre cannot keep data files with a book, the plugin says so and does not start a repair. I have tested it on calibre 9.19 on macOS; reports from Windows and Linux are very welcome.

What would help
  • A repair you disagree with. The book as it was is kept, so you can compare the two, and put it back.
  • The repair window: whether what it shows is enough to decide on a Check first repair.
  • Anything about the plugin itself: the menu, the report, installing.

Where to report what. Anything about this plugin belongs in this thread or at https://github.com/veripublica/calibre-plugins/issues. A question about a repair itself, what epubsana does to a book, belongs in the epubsana thread, https://www.mobileread.com/forums/sh...d.php?t=374799.

Links
Plugin Download
Attached Files
File Type: zip epubsana_calibre_v0.1.0.zip (39.4 KB, 13 views)
File Type: txt SHA256SUMS.txt (94 Bytes, 1 views)

Last edited by Kayadelenium; Today at 06:20 AM.
Kayadelenium is offline   Reply With Quote
Old 11-22-2026, 12:13 PM   #2
Kayadelenium
Addict
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 305
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
Before I write the plugin, I would like your view on one thing: where the repaired book goes. I see two ways.

A. The same book record. The repaired file becomes the book's EPUB, and the file as it was before is kept in the same record as ORIGINAL_EPUB, the way calibre's own Polish and Convert keep theirs. Both files stay in your library, side by side in the Book details panel, and calibre's own Restore command there brings the old one back. Metadata, custom columns, annotations and whatever a device plugin stores stay with the book, and sending it to your reader again replaces the copy there. If the book already has an ORIGINAL_EPUB from an earlier conversion or polish, the plugin leaves it alone and keeps its own copy of the pre-repair file with the book, with a menu entry to put it back.

B. A new book record. The repaired file is added as a separate book with the same metadata and cover, and the original record is not touched at all. The price is two entries for the same book, in the library and on the reader, and the reading position, annotations, collections and custom columns stay with the old one.

I lean towards A. In the epubsana thread, fogice asked how to put a repaired book back into calibre while keeping the reading position Kobo Utilities records, and the answer was to replace the format, not the book. But you are the ones who will live with it, so:

1. Would you use A or B? Should it be a setting?
2. If you see a repair on your reader and do not like it, how would you want to undo it?
3. Is there anything else you would expect from a plugin that changes books in your library?
Kayadelenium is offline   Reply With Quote
Old 11-22-2026, 02:48 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 85,868
Karma: 154365287
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Do it like the Modify ePub plugin does it. Modify ePub creates an ORIGINAL_EPUB. But what it does differently to the rest of calibre, is that if you run Modify ePub multiple times, it never touches the ORIGINAL_EPUB. So you can run Modify ePub on your source ePub as much as you want.
JSWolf is offline   Reply With Quote
Old Today, 06:22 AM   #4
Kayadelenium
Addict
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 305
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
epubsana for calibre 0.1.0 is out. The zip is attached to the first post, which now describes the plugin as it is.

Thank you, JSWolf: it does what you asked for in #3, the way Modify ePub does. The first repair keeps the EPUB as ORIGINAL_EPUB, and later repairs never touch it, so you can run the plugin on the same book as often as you like. If the book already has an ORIGINAL_EPUB, from a conversion or a polish, that one is left alone too, and the plugin keeps the EPUB from before its repair among the book's data files instead. Put back the EPUB from before the repair, in the plugin's menu, brings back whichever it kept.

Nobody asked for the repaired book as a new book record (B in #2), so I did not build it, and there is no setting for it. If you would use one, say so here.
Kayadelenium is offline   Reply With Quote
Old Today, 09:50 AM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 85,868
Karma: 154365287
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
If you do end up making a new database entry for the modified ePub, please make it an option. I quite like the way it's being handled now. Thank you.
JSWolf is offline   Reply With Quote
Old Today, 03:48 PM   #6
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 2,516
Karma: 9656907
Join Date: Sep 2020
Device: Libra Colour
@Kayadelenium Earlier today I had accidentally inserted the epubveri thread number in the epubsana index entry. I've now corrected it and epubsana is live at https://code.calibre-ebook.com/plugins and the mirror https://plugins.calibre-ebook.com. I'm sorry.

On an unrelated note, this update to the Calibre CSS library might be relevant to the veripublica projects, in case you haven't seen it yet:

https://www.mobileread.com/forums/sh...359648&page=31
Comfy.n is online now   Reply With Quote
Reply

Tags
autofix, epub, epubsana, repair, veripublica


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] epubsana - Repair the book with epubsana. Kayadelenium Plugins 2 11-26-2026 07:23 PM
[GUI Plugin] Streamer - RSVP Speed Reader plugin for Calibre npapadacis Plugins 8 10-28-2026 09:29 AM
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB lrpirlet Plugins 2 08-18-2022 04:15 PM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 06:25 AM


All times are GMT -4. The time now is 06:41 PM.


MobileRead.com is a privately owned, operated and funded community.