• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

biplist/H03-Dec-2017-978830

biplist.egg-info/H03-May-2022-2522

tests/H03-Dec-2017-807633

AUTHORSH A D17-Jun-2016101 42

LICENSEH A D17-Jun-20161.5 KiB2622

MANIFEST.inH A D17-Jun-201687 54

PKG-INFOH A D03-Dec-20171.1 KiB2522

README.mdH A D17-Jun-20161.5 KiB6346

setup.cfgH A D03-Dec-201759 64

setup.pyH A D03-Dec-20171.9 KiB5948

README.md

1biplist
2=======
3`biplist` is a binary plist parser/generator for Python.
4
5## About
6
7Binary Property List (plist) files provide a faster and smaller serialization
8format for property lists on OS X. This is a library for generating binary
9plists which can be read by OS X, iOS, or other clients.
10
11## API
12
13The API models the `plistlib` API, and will call through to plistlib when
14XML serialization or deserialization is required.
15
16To generate plists with UID values, wrap the values with the `Uid` object. The
17value must be an int.
18
19To generate plists with `NSData`/`CFData` values, wrap the values with the
20`Data` object. The value must be a string.
21
22Date values can only be `datetime.datetime` objects.
23
24The exceptions `InvalidPlistException` and `NotBinaryPlistException` may be
25thrown to indicate that the data cannot be serialized or deserialized as
26a binary plist.
27
28## Installation
29
30To install the latest release version:
31
32`sudo easy_install biplist`
33
34## Examples
35
36Plist generation example:
37
38```python
39from biplist import *
40from datetime import datetime
41plist = {'aKey':'aValue',
42         '0':1.322,
43         'now':datetime.now(),
44         'list':[1,2,3],
45         'tuple':('a','b','c')
46         }
47try:
48    writePlist(plist, "example.plist")
49except (InvalidPlistException, NotBinaryPlistException), e:
50    print "Something bad happened:", e
51```
52
53Plist parsing example:
54
55```python
56from biplist import *
57try:
58    plist = readPlist("example.plist")
59    print plist
60except (InvalidPlistException, NotBinaryPlistException), e:
61    print "Not a plist:", e
62```
63