### Navigation

- index
- modules |
- next |
- previous |
- EBookLib 0.15 documentation »
- Modules »

# ebooklib Package

## `ebooklib` Package

## `epub` Module

class `ebooklib.epub.``EpubBook`

  Bases: `object`

  `add_author`(author, file_as=None, role=None, uid='creator')

    Add author for this document

  `add_item`(item)
  `add_metadata`(namespace, name, value, others=None)

    Add metadata

  `get_item_with_href`(href)
  `get_item_with_id`(uid)
  `get_items`()
  `get_items_of_media_type`(media_type)
  `get_items_of_type`(item_type)
  `get_metadata`(namespace, name)

    Retrieve metadata

  `get_template`(name)
  `reset`()

    Initialises all needed variables to default values

  `set_cover`(file_name, content, create_page=True)

    Set cover and create cover document if needed.

  `set_identifier`(uid)

    Sets unique id for this epub

  `set_language`(lang)

    Set language for this epub. You can set multiple languages.

  `set_template`(name, value)
  `set_title`(title)

    Set title. You can set multiple titles.

class `ebooklib.epub.``EpubCover`(uid='cover-img', file_name='')

  Bases: `ebooklib.epub.EpubItem`

class `ebooklib.epub.``EpubCoverHtml`(uid='cover', file_name='cover.xhtml', image_name='', title='Cover')

  Bases: `ebooklib.epub.EpubHtml`

  `get_content`()
  `is_chapter`()

exception `ebooklib.epub.``EpubException`(code, msg)

  Bases: `exceptions.Exception`

class `ebooklib.epub.``EpubHtml`(uid=None, file_name='', media_type='', content=None, title='', lang=None)

  Bases: `ebooklib.epub.EpubItem`

  `add_item`(item)
  `add_link`(**kwgs)
  `get_body_content`()
  `get_content`(default=None)
  `get_language`()
  `get_links`()
  `get_links_of_type`(link_type)
  `get_type`()
  `is_chapter`()
  `set_language`(lang)

class `ebooklib.epub.``EpubImage`

  Bases: `ebooklib.epub.EpubItem`

  `get_type`()

class `ebooklib.epub.``EpubItem`(uid=None, file_name='', media_type='', content='')

  Bases: `object`

  `get_content`(default='')
  `get_id`()
  `get_name`()
  `get_type`()

    Guess type according to the file extension. Not the best way to do it, but works for now.

  `set_content`(content)

class `ebooklib.epub.``EpubNav`(uid='nav', file_name='nav.xhtml', media_type='application/xhtml+xml')

  Bases: `ebooklib.epub.EpubHtml`

  `is_chapter`()

class `ebooklib.epub.``EpubNcx`(uid='ncx', file_name='toc.ncx')

  Bases: `ebooklib.epub.EpubItem`

class `ebooklib.epub.``EpubReader`(epub_file_name, options=None)

  Bases: `object`

  `DEFAULT_OPTIONS` = {}
  `load`()
  `process`()
  `read_file`(name)

class `ebooklib.epub.``EpubWriter`(name, book, options=None)

  Bases: `object`

  `DEFAULT_OPTIONS` = {'epub3_landmark': True, 'epub2_guide': True, 'landmark_title': 'Guide'}
  `process`()
  `write`()

class `ebooklib.epub.``Link`(href, title, uid=None)

  Bases: `object`

class `ebooklib.epub.``Section`(title)

  Bases: `object`

`ebooklib.epub.``read_epub`(name, options=None)

`ebooklib.epub.``write_epub`(name, book, options=None)

## `utils` Module

`ebooklib.utils.``debug`(obj)

`ebooklib.utils.``parse_html_string`(s)

`ebooklib.utils.``parse_string`(s)

## Subpackages

- plugins Package
  - `base` Module
  - `booktype` Module
  - `sourcecode` Module
  - `standard` Module
  - `tidyhtml` Module

### Navigation

- index
- modules |
- next |
- previous |
- EBookLib 0.15 documentation »
- Modules »