This is a package for reading, writing and managing Apple plist files.
pip install plists
import plists
obj = plists.v1parser.Parser().parseFile("path_to_file")
# ... use obj as a normal python object
import plists
obj = plists.v1parser.Parser().parse("some_loaded_string")
# ... use obj as a normal python object
from plists import xmlparser
obj = xmlparser.parseFile("path_to_file")
# ... use obj as a normal python object
from plists import xmlparser
obj = xmlparser.parse("some_loaded_string")
# ... use obj as a normal python object
Coming Soon
Objects can be written to old style plists with:
from plists import v1parser
from plists import v1writer
obj = v1parser.parseFile(<path_to_plist_file>)
v1writer.write(obj, outstream, indentString, level)
The parameters are:
- obj - The object being serialized
- outstream - The output stream to which the object will be serialized. If this is None, then a new string outputstream is written to and returned.
- indentString - Indentation string to be used. If this value is None then no indentation or pretification is applied. Otherwise this is used.
- level - The level to start with when serializing. Each child node is indented an extra level (if indentString is not None).
Objects can be written to xml plists with:
from plists import xmlparser
from plists import xmlwriter
obj = xmlparser.parseFile(<path_to_plist_file>)
xmlwriter.write(obj, outstream, indentString, level)
The parameters are:
- obj - The object being serialized
- outstream - The output stream to which the object will be serialized. If this is None, then a new string outputstream is written to and returned.
- indentString - Indentation string to be used. If this value is None then no indentation or pretification is applied. Otherwise this is used.
- level - The level to start with when serializing. Each child node is indented an extra level (if indentString is not None).
Coming Soon.