Generate and parse NSKeyedArchive files
Project description
keyedarchivelib
Basic Python (>=3.6) library to generate and parse NSKeyedArchive files.
Installation
Install with pip:
pip3 install keyedarchivelib
Usage
The keyedarchivelib
module has the same interface as the plistlib
standard library module:
load
, loads
, dump
, and dumps
have the same function signatures as plistlib.
The keyedarchivelib
module includes type hints.
For convenience, examples are provided below:
Reading (load
& loads
)
from keyedarchivelib import load
with open("example.plist", 'rb') as fp:
pl = load(fp)
print(pl["test"])
Writing (dump
& dumps
)
from keyedarchivelib import dump, dumps
example_dict = {
"test": 1
}
with open("example.plist", 'wb') as fp:
dump(example_dict, fp)
# ~~~ OR ~~~
print(dumps(example_dict))
Note on compatibility
For versions below 3.8, plistlib
doesn't support all the plist features used by NSKeyedArchiver. A compatibility
hot-patching layer is used to support these lesser versions of Python. This library has not endured thorough testing
beyond the latest versions of Python 3.6, 3.7, and 3.8. Please open issues for any observed problems!
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 keyedarchivelib-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae72370cc5aab0dda9a02829d2d91d3f7193c4c58a828c629456b81269a69a8a |
|
MD5 | 30337c1c272d6b50e5d9d8f3e9b3c61b |
|
BLAKE2b-256 | 1149a4ebe1b7a14dec510caa5fd799801857fb78d02e4169d42df1059e950b3b |