skip to navigation
skip to content

EbookLib 0.15

Ebook library which can handle EPUB2/EPUB3 and Kindle format

Latest Version: 0.16

About EbookLib

EbookLib is a Python library for managing EPUB2/EPUB3 and Kindle files. It's capable of reading and writing EPUB files programmatically (Kindle support is under development).

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 2.0]( from Sourcefabric, as well as [sprits-it!]( [fanfiction2ebook]( and [deboutlesgens](

Packages of EbookLib for GNU/Linux are available in [Debian]( and [Ubuntu](

Sphinx documentation is generated from the templates in the docs/ directory and made available at



from ebooklib import epub

book = epub.read_epub('test.epub')

for image in book.get_items_of_type(epub.ITEM_IMAGE):
print image


from ebooklib import epub

book = epub.EpubBook()

# set metadata
book.set_title('Sample book')

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=u'<h1>Intro heading</h1><p>Žaba je skočila u baru.</p>'

# add chapter

# define Table Of Contents
book.toc = (epub.Link('chap_01.xhtml', 'Introduction', 'intro'),
(epub.Section('Simple book'),
(c1, ))

# add default NCX and Nav file

# define CSS style
style = 'BODY {color: white;}'
nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style)

# add CSS file

# basic spine
book.spine = ['nav', c1]

# write to the file
epub.write_epub('test.epub', book, {})


EbookLib is licensed under the AGPL license.

* Aleksandar Erkalovic <>
* Borko Jandras <>  
File Type Py Version Uploaded on Size
EbookLib-0.15.tar.gz (md5) Source 2014-05-15 28KB