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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mobi_header-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bc93f6b6f910d11c6403643e9aafc00f58f1ac5cbd85101778f08c66ec701a7 |
|
MD5 | 79f4d813a7c346fbe6aa6b0bea6b7033 |
|
BLAKE2b-256 | daa74a02b90517133c2532dd52b3d56c6bea2451a6fae74d9da3fdcfe8efdcf5 |