Storing the configuration in XML files – PLIST and others

As we noted in Chapter 9, Serializing and Saving – JSON, YAML, Pickle, CSV, and XML, Python's xml package includes numerous modules that parse the XML files. Because of the wide adoption of the XML files, it often becomes necessary to convert between XML documents and Python objects. Unlike JSON or YAML, the mapping from XML is not simple.

One common way to represent the configuration data in XML is the .plist file. For more information on the .plist format, see this: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/plist.5.html

Macintosh users can perform man plist to see this man page. The advantages of the .plist format are that it uses a few, very general tags. ...

Get Mastering Object-oriented Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.