For a couple of reasons I found myself running into limitations using the Calibre tools for working with epubs. One issue has been performance and the other is being able to more comprehensively interact with the OPF Package fields specific to epub.
This led me to work on a library and some command-line utilities for working specifically with epub files (and only epub files). My software is compiled into native code and is not only extremely performant but also doesn't carry dependencies to any VM or interpreter.
The programs in epub-tools are:
a command-line utility for examining and editing epub book metadata. With it you can export, import and edit the raw OPF Package XML document for a given book. Or simply dump the metadata to stdout for viewing in a friendly format.
here's an example of epubmeta output:
$ epubmeta Kelly_Kessel_Lethem-NinetyPercentOfEverything.epub
title: Ninety Percent of Everything
file-as: Kelly, James Patrick
creator: James Patrick Kelly
creator: John Kessel
creator: Jonathan Lethem
creator: calibre (0.5.1) [http://calibre.kovidgoyal.net]
id: [WARNING: missing required id attribute]
subject: Science Fiction/Fantasy
a command-line utility for renaming epub ebook files based on their OPF Package metadata. It tries to use author names and title info to construct a sensible name.
Using it looks like this:
$ epubname poorly-named-book.epub
poorly-named-book.epub -> WattsPeter-Blindsight_2006.epub
$ epubname another-poorly-named-book.epub
another-poorly-named-book.epub -> Kelly_Kessel_Lethem-NinetyPercentOfEverything.epub
a handy utility for zipping up the files that comprise an epub into an .epub zip file. Using the same technology as epubname, it can try to make a meaningful filename for the book.
I ran a time comparison of using epubmeta (from epub-tools) and ebook-meta (from Calibre) side-by-side against a random sample of 50 epub files (mostly purchased from Fictionwise). The results of a simple dump of book metadata using these tools looks like this:
$ time for F in *.epub ; do ebook-meta $F ; done
$ time for F in *.epub ; do epubmeta $F ; done
This software is open-source and is available for UNIX-like operating systems and in Windows binary form, downloadable at its home:
One thing I would be open to is more switches for epubmeta to allow you to script changes to books. At the moment, you can edit or export/import the OPF XML document in the book with it, which has been enough for my needs.
Any feedback would be welcome: firstname.lastname@example.org