ePub-utils: A Python library and CLI tool for inspecting ePub from the terminal

2 months ago 4

PyPI Python 3.x License

A Python CLI and utility library for manipulating EPUB files.

  • Parse and validate EPUB container and package files
  • Extract metadata like title, author, and identifier
  • Command-line interface for quick file inspection
  • Syntax highlighted XML output
  1. Install the package:
  1. Use as a CLI tool:
# Show container.xml contents epub-utils your-book.epub container # Show package OPF contents epub-utils your-book.epub package # Show table of contents epub-utils your-book.epub toc
  1. Use as a Python library:
from epub_utils import Document # Load an EPUB document doc = Document("path/to/book.epub") # Access container metadata print(f"Package file location: {doc.container.rootfile_path}") # Access package metadata print(f"Title: {doc.package.title}") print(f"Author: {doc.package.author}") print(f"Identifier: {doc.package.identifier}")
Read Entire Article