nile: ebook normalizer
April 4, 2026 ยท View on GitHub

SUMMARY
nile cleans up ebooks.
EXAMPLE
% cd examples
% nile shakespeare.epub
% ls
shakespeare.epub
shakespeare.normalized.epub
For more options, run nile -h.
DOWNLOAD
git clone https://github.com/mcandre/nile.git ~/src/github.com/mcandre/nile
Prerequisites
- bash 4+
- findutils
- git
- GNU compatible readlink
- tidy-html5 5.6+
- xmlstarlet 1.6.1+
- zip
Postinstall
Register "$HOME/src/github.com/mcandre/nile/bin to PATH environment variable.
For details on building from source, see DEVELOPMENT.
ABOUT
nile normalizes ebooks.
Amazon Kindle ereaders often mishandle non-ASCII runes, such as smart quotes, apostrophes, em dashes, and other common Unicode sequences. Kindle visually corrupts the page, making it difficult to read books.
nile fixes this problem, by standardizing ebooks into more portable contents.
WARNINGS
The ebook pages must not contain intensely bizarre oddities, such as a Unicode non-breaking space as a literal rune, or else the ebook may trigger a generic Amazon WhisperSync upload error. For example, the .(x)htm(l) files within the ebook will need to be able to render well in macOS Quick Look and Google Chrome, prior to any sanitization with nile.
Some ebooks may present latent glitches, which can trigger when Calibre converting, such as after applying a custom book cover. This is due to oddities in how Calibre processes CSS.
Some ebooks may not upload at all! We apply some tidy cleanup preprocessing, but even that can't account for all possible ebook file corruption. Your mileage may vary.
RESOURCES
Prior art, personal plugs, and tools for managing digital content.
- Pandoc - a file format converter
- Sigil - an ebook editor
- mcandre/tigris - (Kindle) comic archival utilities