Kindle Strip


Here's a useful python tool for reducing the size of MOBI files created using Amazon's Publishing kindlegen tool.

Basically, kindlegen includes the original .html, .epub, ... file inside it's created .mobi file.  You really don't need this, but it's speculated the reasoning is for future compatibility.  (Read the comments at the top of the file for more information.)

If you publish, then you likely want to strip this extra data so you use less bandwidth on the remote host, saving you money.

The author made a post to MobileRead posting his Python script.  Unfortunately, the script was likely created with a Windows editor placing ^M at the end of each line.  I've edited this out for Linux users and am placing this script on my site for easier access.  (Especially since Forums may disappear overnight!)

kindlestrip-1.2.py