views:

87

answers:

1

Hi guys,

Is there any Python project/module working on a binary plist writer? I need one for a REST implementation I'm doing. I would like the server to send a HTTP REsponse containing a binary plist instead of json, for example. The server is Apache with mod_python and django installed. Considering adding bplist format alongside json as output formats, just inorder to simplify parsing on the iPhone, plus cutting the data transfers down.

I'm thinking of writing my own, but contributing to an existing project would be prefereable.

Thanks in advance.

A: 

What about plistlib in the default Python distribution? It is available for all platforms since Python 2.6; before Python 2.6, it was included in the Mac version, but I guess you can simply grab the source from Python 2.6 and backport it if you really need to support older Python versions.

Update: Sorry, I've just realised that you need to support the binary plist format. In that case, use libplist, which supports both the binary and the XML format. It is written in C++, but they provide a SWIG interface definition file with which SWIG can easily generate a Python module for it. Ubuntu/Debian also includes a package called python-plist which contains precompiled binaries.

Tamás
Hi Tamás, I was under the impression that plistlib only handles textual plists, not binary plists. I need to transfer a .plist in the .bplist format.
George André
Sorry, I've missed that and I've updated my answer accordingly.
Tamás
Outstanding, exactly what I needed! Thanks!
George André