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.

  • get_exth_value_by_name(name : str):

    ​ return the value of name 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.4.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mobi_header-0.0.4-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file mobi_header-0.0.4.tar.gz.

File metadata

  • Download URL: mobi_header-0.0.4.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for mobi_header-0.0.4.tar.gz
Algorithm Hash digest
SHA256 abad819d5e6402bd4785631c6658619013d0ae472a74cfccfdf52d31c459e0f7
MD5 6dcda2f3acf61502ebe51df4d886beb9
BLAKE2b-256 c05b2bbdad3eef99a0e436fa84a971cd24820e8b07c68f5a04127d584f517af7

See more details on using hashes here.

File details

Details for the file mobi_header-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mobi_header-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for mobi_header-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0bc93f6b6f910d11c6403643e9aafc00f58f1ac5cbd85101778f08c66ec701a7
MD5 79f4d813a7c346fbe6aa6b0bea6b7033
BLAKE2b-256 daa74a02b90517133c2532dd52b3d56c6bea2451a6fae74d9da3fdcfe8efdcf5

See more details on using hashes here.

Supported by

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