View Single Post
Old 05-20-2011, 01:14 PM   #1
Junior Member
jmeb began at the beginning.
Posts: 2
Karma: 10
Join Date: May 2011
Device: Kindle DX
Python script: batch create mobi's from epubs (if they don't exist)

Mornin' all,

I've created a little script for my personal use that creates .mobi files from any .epub files that don't already have a .mobi counterpart using ebook-convert.

This is my very, very first script in Python. (Usually write things like this in bash.) So it has a good deal of limitations: it only works on one directory at a time, it assumes that the name of the file between epub and mobi versions is constant, and I'm sure it has a thousand other limitations. It handles white space in the filenames fine. I've only tested it in linux I doubt it is windows friendly.

You can find the script here: . You need to feed it one argument: the directory it should search for epubs/mobis. For example:
python /home/jmeb/ebooks
I welcome any feedback or improvements. Again, my very first go at python.

Thanks for the wonderful software to base this on, and the community round here (been lurking around for a while.)


Last edited by jmeb; 05-20-2011 at 03:25 PM.
jmeb is offline   Reply With Quote