Python module for binary plist
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 iPhon开发者_C百科e, 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.
I was afraid I might have to learn SWIG, implement this myself, or switch to another language for this hobby project that involves parsing binary plists -- but after a quick pip search plist
, I found biplist.
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.
精彩评论