{
"info": {
"author": "S Anand",
"author_email": "root.node@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "===============================\nxmljson\n===============================\n\n.. image:: https://img.shields.io/travis/sanand0/xmljson.svg\n :target: https://travis-ci.org/sanand0/xmljson\n\n.. image:: https://img.shields.io/pypi/v/xmljson.svg\n :target: https://pypi.python.org/pypi/xmljson\n\n\nxmljson converts XML into Python dictionary structures (trees, like in JSON) and vice-versa.\n\nAbout\n-----\n\nXML can be converted to a data structure (such as JSON) and back. For example::\n\n
Hellobold
')]\n\n.. _etree.Element: http://effbot.org/zone/element-index.htm\n\nThe result can be inserted into any existing root `etree.Element`_::\n\n >>> from xml.etree.ElementTree import Element, tostring\n >>> result = bf.etree({'p': {'@id': 'main'}}, root=Element('root'))\n >>> tostring(result)\n 'Hellobold
'))\n {\"p\": {\"$\": \"Hello\", \"@id\": \"main\", \"b\": {\"$\": \"bold\"}}}\n\nTo convert this to JSON, use::\n\n >>> from json import dumps\n >>> dumps(bf.data(fromstring('Hellobold
')))\n '{\"p\": {\"b\": {\"$\": \"bold\"}, \"@id\": \"main\", \"$\": \"Hello\"}}'\n\nTo preserve the order of attributes and children, specify the ``dict_type`` as\n``OrderedDict`` (or any other dictionary-like type) in the constructor::\n\n >>> from collections import OrderedDict\n >>> from xmljson import BadgerFish # import the class\n >>> bf = BadgerFish(dict_type=OrderedDict) # pick dict class\n\nBy default, values are parsed into boolean, int or float where possible (except\nin the Yahoo method). Override this behaviour using ``xml_fromstring``::\n\n >>> dumps(bf.data(fromstring('