Skip to main content

Decodes Apple's NSKeyedArchiver that were archived into text or binary plist files and returns a usable Python dict

Project description

NSKeyedUnArchiver

Unserializes any binary|text|file|memory plist data and returns a usable Python dict.

Plist files are very common in Apple platforms (macOS, iOS etc). Plist files are used to store data much like XML and JSON files, but can be pure text or binary (convertible with plutil command). Some Plist files were generated by Apple NSKeyedArchiver and contain a serialized version of objects stored in an intricate and complex schema of nested objects. NSKeyedUnArchiver converts it back to an hierarchical form as a Python dict.

Uses only Python 3.8 plistlib, no other dependencies.

Automatically converts well known data types to Python-equivalent data types:

  • NSArray -> list
  • NSMutableDictionary, NSDictionary -> dict
  • NSMutableString, NSString -> unwrap the string
  • NSMutableData, NSData -> unwrap the data
  • NSDate -> datetime

Check pypi for packages.

License is LGPL 3.

Sample usage

import NSKeyedUnArchiver

file='/patch/to/file.plist'
my_dict=NSKeyedUnArchiver.unserializeNSKeyedArchiver(file)


data=b'bplist00\xd4\x01\.........'
my_dict=NSKeyedUnArchiver.unserializeNSKeyedArchiver(data)


data='<plist version="1.0">......'
my_dict=NSKeyedUnArchiver.unserializeNSKeyedArchiver(data)


file=PurePath('/patch/to/file.plist')
my_dict=NSKeyedUnArchiver.unserializeNSKeyedArchiver(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

NSKeyedUnArchiver-1.5.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

NSKeyedUnArchiver-1.5-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

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