Kepubify converts EPUBs to KEPUBs. Kepubify is fast, lightweight, easy-to-use, and cross platform.

Features

Installation
Windows:
  1. Download kepubify
Linux:
  1. Download kepubify
  2. Open a terminal
  3. Type cd ~/Downloads (or whatever location you downloaded kepubify to) and press enter
  4. Type chmod +x kepubify-linux-* and press enter
macOS:
  1. Download kepubify
  2. Open a terminal
  3. Type cd ~/Downloads and press enter
  4. Type chmod +x kepubify-darwin-* (or whatever location you downloaded kepubify to) and press enter
macOS (Homebrew):
  1. Open a terminal
  2. Type brew install kepubify and press enter
Usage
Usage: kepubify [options] input_path [input_path]...

General Options:
  -v, --verbose   Show extra information in output
      --version   Show the version
  -h, --help      Show this help text

Output Options:
  -u, --update             Don't reconvert files which have already been converted (i.e. don't overwrite output files)
  -i, --inplace            Don't add the _converted suffix to converted files and directories
      --no-preserve-dirs   Flatten the directory structure of the input (an error will be shown if there are conflicts)
  -o, --output string      [>1 inputs || 1 file input with existing dir output]: Directory to place converted files/dirs under; [1 file input with
                           nonexistent output]: Output filename; [1 dir input]: Output directory for contents of input (default: current directory)
      --calibre            Use .kepub instead of .kepub.epub as the output extension (for Calibre compatibility, only use if you know what you are doing)

Conversion Options:
      --smarten-punctuation        Smarten punctuation (smart quotes, dashes, etc) (excluding pre and code tags)
  -c, --css stringArray            Custom CSS to add to ebook
      --hyphenate                  Force enable hyphenation
      --no-hyphenate               Force disable hyphenation
      --fullscreen-reading-fixes   Enable fullscreen reading bugfixes based on https://www.mobileread.com/forums/showpost.php?p=3113460&postcount=16
  -r, --replace stringArray        Find and replace on all html files (repeat any number of times) (format: find|replace)

Links:
  Website      - https://pgaskin.net/kepubify
  Source Code  - https://github.com/geek1011/kepubify
  Bugs/Support - https://github.com/geek1011/kepubify/issues
  MobileRead   - http://mr.gd/forums/showthread.php?t=295287
Examples

For the following examples, replace kepubify with the path to the downloaded kepubify.

To convert a single book by dragging and dropping on Windows:
Just drag the original epub file over kepubify.exe. The resulting file will be saved to the same directory as the original epub.

To convert a folder of books by dragging and dropping on Windows:
Just drag the folder over kepubify.exe. The resulting file will be saved to the same directory as the originals, but with the suffix _converted.

To convert a single book:
kepubify /path/to/the/book.epub
The resulting file will be saved to the current directory.

To convert a single book with a different output folder:
kepubify --output "/path/to/save/the/book/" /path/to/the/book.epub
The resulting file will be saved to specified folder (in this example /path/to/save/the/book/).

To convert all books in the current folder into a folder called converted:
kepubify -o "converted" *.epub

To batch convert a directory of ebooks:
kepubify /path/to/the/books/
The converted books will be saved to the original dir with the suffix _converted (e.g. /path/to/the/books_converted).The directory structure of the source is preserved in the output.

To batch convert a directory of ebooks with a different output folder:
kepubify -o "/path/to/output/the/converted/books" /path/to/the/books/
The directory structure of the source is preserved in the output.

To convert a directory of ebooks, but skipping ones which have already been converted:
kepubify --update /path/to/the/books/

To convert a calibre library in-place:
kepubify --update --inplace --calibre /path/to/calibre/library/

Series metadata

On Linux and Windows, you can update the series metadata on the Kobo using seriesmeta. Seriesmeta is available here. It will automatically detect your Kobo when you run it. Seriesmeta doesn't conflict with Calibre, and works on both EPUB and KEPUB books.

Seriesmeta supports Calibre-style (meta[name=calibre:series], meta[name=calibre:series-index]) and EPUB3-style (meta[property=belongs-to-collection], meta[refines][property=collection-type], meta[refines][property=group-position]) series metadata.

New: Seriesmeta doesn't require the books to be already imported anymore! You can now run seriesmeta right after you transfer you books, and the metadata will be updated on the next reboot.

Usage: seriesmeta [options] [kobo_path]

Options:
  -h, --help         Show this help message
  -p, --no-persist   Don't ensure metadata is always set (this will cause series metadata to be lost if opening a book after an import but before a reboot)
  -n, --no-replace   Don't replace existing series metadata (you probably don't want this option)
  -u, --uninstall    Uninstall seriesmeta table and hooks (imported series metadata will be left untouched)

Arguments:
  kobo_path is the path to the Kobo eReader. If not specified, seriesmeta will
  try to automatically detect the Kobo.

See here for more details.

Cover images

You can pre-generate/re-generate cover images using covergen. Covergen is available here. It will automatically detect your Kobo when you run it. You cam use covergen without using kepubify (i.e. it works with EPUB books and won't conflict with Calibre).

This tool is useful to save time or for when Kobo automatically generates the cover incorrectly (for example taking an image of the first page, or using a generic cover). It can also optionally stretch the covers to a specific aspect ratio for consistency.

Usage: covergen [options] [kobo_path]

Options:
  -a, --aspect-ratio float   Stretch the covers to fit a specific aspect ratio (for example 1.3, 1.5, 1.6)
  -g, --grayscale            Convert images to grayscale
  -h, --help                 Show this help message
  -i, --invert               Invert images
  -m, --method string        Resize algorithm to use (bilinear, bicubic, lanczos2, lanczos3) (default "lanczos3")
  -r, --regenerate           Re-generate all covers

Arguments:
  kobo_path is the path to the Kobo eReader. If not specified, covergen will try
  to automatically detect the Kobo.

See here for more details.

What is different about KEPUBs?

KEPUB is Kobo's ebook format based on EPUB. This format enables additional features such as chapter progress stats, time left, faster page turns, page flipping (hold finger in bottom corner of screen), footnote previews, image zooming, and faster text selection. Also, ePub 3 is only supported using the kepub reader.

Why would I use this over the Calibre kepub output plugin?

If you are already using Calibre heavily to manage your books, kepubify is not for you (unless you want to use it to pre-convert your books). You may still like covergen or seriesmeta, though.

Reporting Issues

If you find any issues or have any questions, please report them here, or send me an email at geek1011 (at) outlook.com. Include the kepubify version, the operating system you are using, and if possible, the book which you are having problems with. You can find the version by typing: kepubify --version.