Skip to main content

a python package to read ePub infos and edit it.

Project description

EpubEdit

Regarding epubedit, this is a Python package for viewing and editing epub file metadata

Installation and Usage

  • Installation:
pip install epubedit
  • Usage
from epubedit import read_epub_info


book = read_epub_info('book_name')
book.get_infos()

Functions

read_info(str) -> str | list

Read the value of a single metadata Supported parameters: [ 'epub_version', "book_name", "author_name", "publisher_name", "ISBN", "ASIN", "bookid", "describe", "language", "rights", "publication_date", ]

Example:

from epubedit import read_epub_info

book = read_epub_info("Moby Dick.epub")
print(book.get_info('book_name'))

Running results

Moby Dick; Or, The Whale

read_infos(list) -> list

Pass a list and transmit the corresponding metadata values

from epubedit import read_epub_info

book = read_epub_info("Moby Dick.epub")
print(book.get_infos(["book_name", "epub_version", "language"]))

Running results

{"book_name": "Moby Dick; Or, The Whale", "epub_version": "3.0", "language": "en"}

read_all_infos() -> dict

No input value, all metadata information is transmitted. If there is a lack of relevant information in EPUB, it will return str: "" or list: []

book = read_epub_info('Moby Dick.epub')
print(book.get_all_infos())

Running results

{
    "epub_version": "3.0",
    "rights": "Public domain in the USA.",
    "book_name": "Moby Dick; Or, The Whale",
    "author": ["Herman Melville"],
    "isbn": "",
    "asin": "",
    "publisher": "",
    "published_date": "",
    "modified_date": "2024-07-20T22:24:39Z",
    "language": "en",
    "subject": [
        "Whaling -- Fiction",
        "Sea stories",
        "Psychological fiction",
        "Ship captains -- Fiction",
        "Adventure stories",
        "Mentally ill -- Fiction",
        "Ahab, Captain (Fictitious character) -- Fiction",
        "Whales -- Fiction",
        "Whaling ships -- Fiction",
    ],
}

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epubedit-0.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

epubedit-0.0.1-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page