# ebooklib **Repository Path**: ivycandy/ebooklib ## Basic Information - **Project Name**: ebooklib - **Description**: No description available - **Primary Language**: Unknown - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-27 - **Last Updated**: 2025-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # About EbookLib EbookLib is a Python library for managing EPUB2/EPUB3 and Kindle files. It's capable of reading and writing EPUB files programmatically. We are working on [refreshing the project](https://github.com/aerkalov/ebooklib/issues/318) so please check and comment if you have your own ideas what needs to happen with the project. The API is designed to be as simple as possible, while at the same time making complex things possible too. It has support for covers, table of contents, spine, guide, metadata and etc. EbookLib is used in [Booktype](https://github.com/sourcefabric/Booktype/) from Sourcefabric, as well as [sprits-it!](https://github.com/the-happy-hippo/sprits-it), [fanfiction2ebook](https://github.com/ltouroumov/fanfiction2ebook), [viserlalune](https://github.com/vjousse/viserlalune) and [Telemeta](https://github.com/Parisson/Telemeta). Packages of EbookLib for GNU/Linux are available in [Debian](https://packages.debian.org/python-ebooklib) and [Ubuntu](http://packages.ubuntu.com/python-ebooklib). Sphinx documentation is generated from the templates in the docs/ directory and made available at http://ebooklib.readthedocs.io # Usage ## Reading ```py import ebooklib from ebooklib import epub book = epub.read_epub('test.epub') for image in book.get_items_of_type(ebooklib.ITEM_IMAGE): print(image) ``` ## Writing ```py from ebooklib import epub book = epub.EpubBook() # set metadata book.set_identifier("id123456") book.set_title("Sample book") book.set_language("en") book.add_author("Author Authorowski") book.add_author( "Danko Bananko", file_as="Gospodin Danko Bananko", role="ill", uid="coauthor", ) # create chapter c1 = epub.EpubHtml(title="Intro", file_name="chap_01.xhtml", lang="hr") c1.content = ( "
Zaba je skocila u baru.
" '![[ebook logo]](static/ebooklib.gif)