Skip to main content

unpack unencrypted mobi files

Project description

mobi - library for unpacking unencrypted mobi files

Version Downloads

A fork of KindleUnpack which removes the GUI part and makes it available as a python library via PyPi for easy unpacking of mobi files.


As library

import mobi

tempdir, filepath = mobi.extract("")

'tempdir' is the path where the mobi is unpacked 'filepath' is the path to either an epub, html or pdf file depending on the mobi type

NOTE: You are responsible to delete the generated tempdir!

From the command line

The installer also creates a console script entrypoint that wraps the original KindleUnpack

$ mobiunpack
KindleUnpack v0.82
   Based on initial mobipocket version Copyright © 2009 Charles M. Hannum <>
   Extensive Extensions and Improvements Copyright © 2009-2014
       by:  P. Durrant, K. Hendricks, S. Siebert, fandrieu, DiapDealer, nickredding, tkeo.
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, version 3.

  Unpacks an unencrypted Kindle/MobiPocket ebook to html and images
  or an unencrypted Kindle/Print Replica ebook to PDF and images
  into the specified output folder.
  mobiunpack -r -s -p apnxfile -d -h --epub_version= infile [outdir]
    -h                 print this help message
    -i                 use HD Images, if present, to overwrite reduced resolution images
    -s                 split combination mobis into mobi7 and mobi8 ebooks
    -p APNXFILE        path to an .apnx file associated with the azw3 input (optional)
    --epub_version=    specify epub version to unpack to: 2, 3, A (for automatic) or
                         F (force to fit to epub2 definitions), default is 2
    -d                 dump headers and other info to output and extra files
    -r                 write raw data to the output folder

[0.3.1] - 2020-06-27

  • Fix pypi link
  • Update dependencies

[0.3.0] - 2020-03-02

  • Add support for mobi7 only files
  • Add experimental support for mobi print replica files
  • Add support for file-like objects

[0.2.0] - 2020-03-02

  • Minimal working 'extract' function and 'mobiunpack' console wrapper
  • Replace most print calls with logging

[0.1.0] - 2020-03-02

  • Empty package registered on pypi



All credits for the hard work go to

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mobi, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size mobi-0.3.1-py3-none-any.whl (102.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mobi-0.3.1.tar.gz (91.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page