Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Python script to convert Apple's developer documentation to the Kindle's mobipocket format
branch: master

Merge pull request #2 from darvin/master

EPUB format support and dynamic cover generation
latest commit e9ebe61244
Ole Zorn authored



This is a Python script to convert Apple’s developer documentation to the Kindle’s mobipocket format, including table of contents and chapter markers.


  • The kindlegen commandline tool has to be downloaded separately from Amazon.
  • Docsets can be downloaded with Xcode. The Mac OS X documentation set is typically located in /Developer/Documentation/DocSets, e.g. /Developer/Documentation/DocSets/ The iOS documentation is usually in /Library/Developer/Documentation/DocSets.


  • Place the kindlegen binary in the script’s directory or somewhere in your $PATH.
  • > python "path/to/docset" -o output_directory
  • This will extract all documents of type ‘Guide’ or ‘Getting Started’ from the specified docset and put Kindle versions in the output directory (documentation for individual classes etc. is not included). The conversion may take a couple of minutes. The docset for iOS contains about 140 books, the one for Mac OS X about 340.
  • > python "path/to/docset" -o output_directory -f epub
  • This will convert all document to EPUB format.
  • It’s also possible to specify a directory that contains multiple docsets (e.g. /Developer/Documentation/DocSets), but as the output file names are determined by the book titles, it is possible that a book in one of the docsets overwrites a book with the same title in another docset.

Known Issues:

  • Lists (ul, ol) don’t look quite right (there’s too much vertical space after the bullet point)
  • Links across books don’t work (I’m not sure if this is even possible with Kindle books)
  • Newest Apple docsets not supported. Newest supported docsets are:
  • iOS 4.3 Library
  • Snow Leopard Library (install from XCode)
Something went wrong with that request. Please try again.