Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install ebooklib

How to install EbookLib

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install ebooklib
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.1 Available View build log
 
License
LICENSE.txt
Dependencies
Lastest release
version 0.1 on May 23rd, 2013

About EbookLib

E-book library for Python capable of handling EPUB2/EPUB3 and Kindle format

Usage

Reading

from ebooklib import epub

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

Writing

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

# add chapter book.add_item(c1)

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

System Message: ERROR/3 (<string>, line 41)

Unexpected indentation.
(epub.Section('Simple book'), (c1, ))

System Message: WARNING/2 (<string>, line 43)

Block quote ends without a blank line; unexpected unindent.

)

# add default NCX and Nav file book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav())

# 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 book.add_item(nav_css)

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

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

License

EbookLib is licensed under the AGPL license.

Authors

Subscribe to package updates

Last updated May 23rd, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.