Python Script 1: Convert ebooks from epub to mobi format

kindle ebook conversion

We are starting a series of python scripts which we may use in our daily life to automate mundane task and save some time.

This is the first article in this series. Recently I bought Amazon’s Ebook Reader, kindle paperwhite 3. I purchased few books from kindle store and downloaded most of the books in Epub format. Now kindle doesn’t support epub format. You need to convert them to either mobi or azw3 format.

Converting books one by one using some online tool is extremely time consuming and frustrating. Hence I searched for some tool which might perform bulk conversion. I found calibre. You may install and use it to convert books from one format to other in bulk. But if you are more of a terminal guy then you need to read further.

First install the calibre. Use the tool if you want to. Or use the below script to convert the books.


I have a folder ‘ebooks’ which contains all the downloaded ebooks. After files are converted to required format, they are stored in ‘ebooks/kindle’ directory and the original file is moved to ‘ebooks/processed’ directory.

Once calibre is installed, a command line utility ‘ebook-convert’ is made available which takes two command line arguments, name of file to be converted and name of output file.

We will be calling this command line utility from our program, passing the file names one by one. As of now we are ignoring pdf file as they take lot of time to convert and require some setting updates in calibre. I will leave that up to you.

Kindle unlimited offer : Read over 1 million books.


(Visited 1,097 times, 1 visits today)

You must read this :

1 thought on “Python Script 1: Convert ebooks from epub to mobi format”

Leave a Reply

Your email address will not be published. Required fields are marked *