https://github.com/bigfootjon/keyedarchivelib
Generate and parse NSKeyedArchive files in Python (>=3.8)
https://github.com/bigfootjon/keyedarchivelib
plist python
Last synced: 6 months ago
JSON representation
Generate and parse NSKeyedArchive files in Python (>=3.8)
- Host: GitHub
- URL: https://github.com/bigfootjon/keyedarchivelib
- Owner: bigfootjon
- License: lgpl-3.0
- Created: 2019-10-10T16:25:34.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T01:27:24.000Z (6 months ago)
- Last Synced: 2025-04-28T18:14:55.452Z (6 months ago)
- Topics: plist, python
- Language: Python
- Homepage: https://pypi.org/project/keyedarchivelib/
- Size: 118 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# keyedarchivelib
Basic Python (>=3.8) 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](https://docs.python.org/3/library/plistlib.html) minus the `fmt` option, which is not available since it's
always binary.The `keyedarchivelib` module includes type hints.
For convenience, examples are provided below:
### Reading (`load` & `loads`)
```python
from keyedarchivelib import loadwith open("example.plist", 'rb') as fp:
pl = load(fp)
print(pl["test"])
```### Writing (`dump` & `dumps`)
```python
from keyedarchivelib import dump, dumpsexample_dict = {
"test": 1
}
with open("example.plist", 'wb') as fp:
dump(example_dict, fp)# ~~~ OR ~~~
print(dumps(example_dict))
```