Skip to main content

A python library for reading/editing mobi/azw3 metadata.

Project description

mobi_header

A python library for reading/editing mobi/azw3 metadata.

Install: pip install mobi_header

class

MobiHeader

variables:

  • file_path: str, path of mobi/azw3 file.
  • palm_doc: a PalmDoc object, contain palmdoc's header and records.
  • metadata: a python dict, use offset as key, the metadata of file.
  • exth_value: a python list, the exth metadata of file.

method:

  • change_title(title : str):

    ​ change the title of metadata.

  • change_metadata(id : int, value):

    ​ change the mobi metadata. the value will be convert to origin dtype.

  • change_exth_metadata(id : int, value):

    ​ change the mobi exth metadata. the value will be convert to origin dtype.

  • get_exth_value_by_id(id : int):

    ​ return the value of id in exth metadata.

  • to_file(file : [str, None] = None):

    ​ write metadata to file. Default write to origin file.

About metadata and exth-metadata, the detail see here

Example

from mobi_header import MobiHeader
foo = MobiHeader("example.azw3")
foo.change_exth_metadata(501, "PDOC")
foo.to_file()

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

mobi_header-0.0.3.tar.gz (21.1 kB view hashes)

Uploaded Source

Built Distribution

mobi_header-0.0.3-py3-none-any.whl (20.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