MOBI libraries
Open-source libraries for Mobipocket and Kindle files. MOBI has no public specification, so libraries are based on reverse-engineering (the MobileRead wiki, Calibre and KindleUnpack). Few of them write MOBI: to create Kindle files, most projects generate EPUB and convert it with Calibre (ebook-convert book.epub book.azw3). None of them opens DRM-protected Amazon books without the owner’s device key, and none reads KFX.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | libmobi | yes | partial | MOBI 6, KF8, hybrid, Print Replica; metadata editing, EPUB export; LGPL |
| C/C++ | MuPDF | yes | no | renders MOBI 6 text and images, extracts text, converts to PDF; AGPL |
| Go | mobi | no | yes | creates KF8 AZW3 books |
| Python | mobi | yes | no | KindleUnpack as a library: unpacks to EPUB, HTML or PDF; GPL-3.0 |
| Python | PyMuPDF | yes | no | text extraction, rendering, convert to PDF; AGPL |
| Rust | mobi | yes | no | metadata, headers, text content, images |
| PHP | PHP eBook | yes | no | metadata and cover from MOBI, AZW, AZW3 |
By language#
- MOBI libraries for C/C++ Open-source C libraries for MOBI, AZW and AZW3 Kindle e-books: libmobi parses and edits MOBI and KF8, MuPDF renders MOBI pages and extracts text. Code examples.
- MOBI libraries for Go Open-source Go library for creating Kindle e-books: leotaku/mobi writes KF8 MOBI and AZW3 files with chapters, cover and metadata. Code examples.
- MOBI libraries for Python Open-source Python libraries for MOBI, AZW and AZW3 Kindle e-books: mobi (KindleUnpack) unpacks books to EPUB or HTML, PyMuPDF extracts text and renders pages.
- MOBI libraries for Rust Open-source Rust crate for MOBI Kindle e-books: mobi reads metadata, PalmDB, MOBI and EXTH headers, text content and images. Code examples.
- MOBI libraries for PHP Open-source PHP library for MOBI, AZW and AZW3 Kindle e-books: PHP eBook (kiwilan/php-ebook) reads metadata, EXTH records and the cover. Code examples.