pyxml2objConvert XML to Python object and vice versa | |
Download |
pyxml2obj Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Matsumoto Taichi
- Publisher web site:
- http://github.com/taichino/
pyxml2obj Tags
pyxml2obj Description
Convert XML to Python object and vice versa pyxml2obj is a library that provides only 2 methods, XMLin and XMLout. XMLin convert xml to python object, and XMLout Python object to XML.This module is inspired by XML::Simple in CPAN, but some options of XML::Simple are not supported.Simple example of usage is followings:>>> from pyxml2obj import XMLin, XMLout>>> xml = '''.....: < world >.....: < country area="Asia" lang="ja" >Japan< /country >.....: < country area="Europe" lang="fr" >France< /country >.....: < country area="Oceania" lang="en" >Australia< /country >.....: < /world >.....: '''>>> world = XMLin(xml)>>> world{u'country': }>>>>>> reverse = XMLout(world)>>> print reverse< root > < country area="Asia" lang="ja" >Japan< /country > < country area="Europe" lang="fr" >France< /country > < country area="Oceania" lang="en" >Australia< /country >< /root >In current version, following options are supported:keyattr keeproot forcecontent contentkey noattr forcearray grouptags normalizespace valueattrkeyattr keeproot contentkey noattr rootname xmldecl noescape grouptags valueattr Requirements: · Python
pyxml2obj Related Software