Some simple MacOS plist facilities.
Supports binary plist files, which the stdlib `plistlib` module does not.
*Latest release 20221228*:
ingest_plist_dict: bugfix initial setting for key.
## Function `export_xml_to_plist(E, fp=None, fmt='binary1')`
Export the content of an `etree.Element` to a plist file.
Parameters:
* `E`: the source `etree.Element`.
* `fp`: the output file or filename (if a str).
* `fmt`: the output format, default `"binary1"`.
The format must be a valid value for the `-convert` option of plutil(1).
## Function `import_as_etree(plist)`
Load an Apple plist and return an etree.Element.
Paramaters:
* `plist`: the source plist: data if `bytes`, filename if `str`,
otherwise a file object open for binary read.
## Function `ingest_plist(plist, recurse=False, resolve=False)`
Ingest an Apple plist and return as a `PListDict`.
Trivial wrapper for `import_as_etree` and `ingest_plist_etree`.
Parameters:
* `recurse`: unpack any `bytes` objects as plists
* `resolve`: resolve unpacked `bytes` plists' `'$objects'` entries
## Function `ingest_plist_array(pa)`
Ingest a plist <array>, returning a Python list.
## Function `ingest_plist_dict(pd)`
Ingest a plist <dict> Element, returning a PListDict.
## Function `ingest_plist_elem(e)`
Ingest a plist `Element`, converting various types to native Python objects.
Unhandled types remain as the original `Element`.
## Function `ingest_plist_etree(plist_etree)`
Recursively a plist's `ElementTree` into a native Python structure.
This returns a `PListDict`, a mapping of the plists's top dict
with attribute access to key values.
## Function `is_iphone()`
Test if we're on an iPhone.
## Class `ObjectClassDefinition`
A representation of a "class" object, used in `resolve_object()`
for otherwise unrecognised objects which contain a `$classname` member.
## Class `ObjectClassInstance`
A representation of a "class instance", used in `resolve_object()`
for objects with a `$class` member.
## Class `PListDict(builtins.dict)`
A mapping for a plist, subclassing `dict`, which also allows
access to the elements by attribute if that does not conflict
with a `dict` method.
## Function `readPlist(path, binary=False)`
An old routine I made to use inside my jailbroken iPhone.
## Function `resolve_object(objs, i)`
Resolve an object definition from structures like an iPhoto album
queryData object list.
## Function `writePlist(rootObj, path, binary=False)`
An old routine I made to use inside my jailbroken iPhone.
# Release Log
*Release 20221228*:
ingest_plist_dict: bugfix initial setting for key.
*Release 20220606*:
Initial PyPI release.
Raw data
{
"_id": null,
"home_page": "https://bitbucket.org/cameron_simpson/css/commits/all",
"name": "cs.app.osx.plist",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python2,python3",
"author": "Cameron Simpson",
"author_email": "Cameron Simpson <cs@cskk.id.au>",
"download_url": "https://files.pythonhosted.org/packages/81/6e/ad5a63d3498b09ea5b34e35914bc1f71efe8b1b5e850b5791e0bc1042420/cs.app.osx.plist-20221228.tar.gz",
"platform": null,
"description": "Some simple MacOS plist facilities.\nSupports binary plist files, which the stdlib `plistlib` module does not.\n\n*Latest release 20221228*:\ningest_plist_dict: bugfix initial setting for key.\n\n## Function `export_xml_to_plist(E, fp=None, fmt='binary1')`\n\nExport the content of an `etree.Element` to a plist file.\n\nParameters:\n* `E`: the source `etree.Element`.\n* `fp`: the output file or filename (if a str).\n* `fmt`: the output format, default `\"binary1\"`.\n The format must be a valid value for the `-convert` option of plutil(1).\n\n## Function `import_as_etree(plist)`\n\nLoad an Apple plist and return an etree.Element.\n\nParamaters:\n* `plist`: the source plist: data if `bytes`, filename if `str`,\n otherwise a file object open for binary read.\n\n## Function `ingest_plist(plist, recurse=False, resolve=False)`\n\nIngest an Apple plist and return as a `PListDict`.\nTrivial wrapper for `import_as_etree` and `ingest_plist_etree`.\n\nParameters:\n* `recurse`: unpack any `bytes` objects as plists\n* `resolve`: resolve unpacked `bytes` plists' `'$objects'` entries\n\n## Function `ingest_plist_array(pa)`\n\nIngest a plist <array>, returning a Python list.\n\n## Function `ingest_plist_dict(pd)`\n\nIngest a plist <dict> Element, returning a PListDict.\n\n## Function `ingest_plist_elem(e)`\n\nIngest a plist `Element`, converting various types to native Python objects.\nUnhandled types remain as the original `Element`.\n\n## Function `ingest_plist_etree(plist_etree)`\n\nRecursively a plist's `ElementTree` into a native Python structure.\nThis returns a `PListDict`, a mapping of the plists's top dict\nwith attribute access to key values.\n\n## Function `is_iphone()`\n\nTest if we're on an iPhone.\n\n## Class `ObjectClassDefinition`\n\nA representation of a \"class\" object, used in `resolve_object()`\nfor otherwise unrecognised objects which contain a `$classname` member.\n\n## Class `ObjectClassInstance`\n\nA representation of a \"class instance\", used in `resolve_object()`\nfor objects with a `$class` member.\n\n## Class `PListDict(builtins.dict)`\n\nA mapping for a plist, subclassing `dict`, which also allows\naccess to the elements by attribute if that does not conflict\nwith a `dict` method.\n\n## Function `readPlist(path, binary=False)`\n\nAn old routine I made to use inside my jailbroken iPhone.\n\n## Function `resolve_object(objs, i)`\n\nResolve an object definition from structures like an iPhoto album\nqueryData object list.\n\n## Function `writePlist(rootObj, path, binary=False)`\n\nAn old routine I made to use inside my jailbroken iPhone.\n\n# Release Log\n\n\n\n*Release 20221228*:\ningest_plist_dict: bugfix initial setting for key.\n\n*Release 20220606*:\nInitial PyPI release.\n",
"bugtrack_url": null,
"license": "GNU General Public License v3 or later (GPLv3+)",
"summary": "Some simple MacOS plist facilities. Supports binary plist files, which the stdlib `plistlib` module does not.",
"version": "20221228",
"split_keywords": [
"python2",
"python3"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "49ee14ae1975b9047ac16569fd21b986",
"sha256": "0373d13fe2b560e264eb3ab8566ca823caacaa5c25e849b9c55372ab11e1a41a"
},
"downloads": -1,
"filename": "cs.app.osx.plist-20221228-py3-none-any.whl",
"has_sig": false,
"md5_digest": "49ee14ae1975b9047ac16569fd21b986",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6087,
"upload_time": "2022-12-27T23:50:32",
"upload_time_iso_8601": "2022-12-27T23:50:32.374993Z",
"url": "https://files.pythonhosted.org/packages/dd/34/458471cee14d6fed4bb6c23bb4b480a84b0c54743a94afe724e6a12b1db0/cs.app.osx.plist-20221228-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "84f8d667da1867829eefbbbc18fe30ec",
"sha256": "85c4946e32c9d67f908a03cb06cd182f99ad45b3e0445b3b01d7364ccd2e16d5"
},
"downloads": -1,
"filename": "cs.app.osx.plist-20221228.tar.gz",
"has_sig": false,
"md5_digest": "84f8d667da1867829eefbbbc18fe30ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6233,
"upload_time": "2022-12-27T23:50:33",
"upload_time_iso_8601": "2022-12-27T23:50:33.998110Z",
"url": "https://files.pythonhosted.org/packages/81/6e/ad5a63d3498b09ea5b34e35914bc1f71efe8b1b5e850b5791e0bc1042420/cs.app.osx.plist-20221228.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-27 23:50:33",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "cs.app.osx.plist"
}