File: parse.py

package info (click to toggle)
python-ebooklib 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 648 kB
  • sloc: python: 1,800; makefile: 132; sh: 52
file content (17 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys

import ebooklib
from ebooklib import epub
from ebooklib.utils import debug

book = epub.read_epub(sys.argv[1])

debug(book.metadata)
debug(book.spine)
debug(book.toc)

for x in  book.get_items_of_type(ebooklib.ITEM_IMAGE):
    debug(x)

for x in  book.get_items_of_type(ebooklib.ITEM_DOCUMENT):
    debug(x)