xmljson


Namexmljson JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/sanand0/xmljson
SummaryConverts XML into JSON/Python dicts/arrays and vice-versa.
upload_time2020-04-25 04:10:32
maintainer
docs_urlNone
authorS Anand
requires_python
licenseMIT
keywords xmljson
VCS
bugtrack_url
requirements wheel
Travis-CI
coveralls test coverage No coveralls.
            ===============================
xmljson
===============================

.. image:: https://img.shields.io/travis/sanand0/xmljson.svg
        :target: https://travis-ci.org/sanand0/xmljson

.. image:: https://img.shields.io/pypi/v/xmljson.svg
        :target: https://pypi.python.org/pypi/xmljson

This library is not actively maintained. Alternatives are `xmltodict`_ and `untangle`_.
Use only if you need to parse using specific XML to JSON `conventions`_.

.. _conventions: http://wiki.open311.org/JSON_and_XML_Conversion/
.. _xmltodict: https://github.com/martinblech/xmltodict
.. _untangle: https://untangle.readthedocs.io/en/latest/

xmljson converts XML into Python dictionary structures (trees, like in JSON) and vice-versa.

About
-----

XML can be converted to a data structure (such as JSON) and back. For example::

    <employees>
        <person>
            <name value="Alice"/>
        </person>
        <person>
            <name value="Bob"/>
        </person>
    </employees>

can be converted into this data structure (which also a valid JSON object)::

    {
        "employees": [{
            "person": {
                "name": {
                    "@value": "Alice"
                }
            }
        }, {
            "person": {
                "name": {
                    "@value": "Bob"
                }
            }
        }]
    }

This uses the `BadgerFish`_ convention that prefixes attributes with ``@``.
The conventions supported by this library are:

* `Abdera`_: Use ``"attributes"`` for attributes, ``"children"`` for nodes
* `BadgerFish`_: Use ``"$"`` for text content, ``@`` to prefix attributes
* `Cobra`_: Use ``"attributes"`` for sorted attributes (even when empty), ``"children"`` for nodes, values are strings
* `GData`_: Use ``"$t"`` for text content, attributes added as-is
* `Parker`_: Use tail nodes for text content, ignore attributes
* `Yahoo`_ Use ``"content"`` for text content, attributes added as-is

.. _Abdera: http://wiki.open311.org/JSON_and_XML_Conversion/#the-abdera-convention
.. _BadgerFish: http://www.sklar.com/badgerfish/
.. _Cobra: http://wiki.open311.org/JSON_and_XML_Conversion/#the-cobra-convention
.. _GData: http://wiki.open311.org/JSON_and_XML_Conversion/#the-gdata-convention
.. _Parker: https://developer.mozilla.org/en-US/docs/JXON#The_Parker_Convention
.. _Yahoo: https://developer.yahoo.com/javascript/json.html#xml


Convert data to XML
-------------------

To convert from a data structure to XML using the BadgerFish convention::

    >>> from xmljson import badgerfish as bf
    >>> bf.etree({'p': {'@id': 'main', '$': 'Hello', 'b': 'bold'}})

This returns an **array** of `etree.Element`_ structures. In this case, the
result is identical to::

    >>> from xml.etree.ElementTree import fromstring
    >>> [fromstring('<p id="main">Hello<b>bold</b></p>')]

.. _etree.Element: http://effbot.org/zone/element-index.htm

The result can be inserted into any existing root `etree.Element`_::

    >>> from xml.etree.ElementTree import Element, tostring
    >>> result = bf.etree({'p': {'@id': 'main'}}, root=Element('root'))
    >>> tostring(result)
    '<root><p id="main"/></root>'

This includes `lxml.html <http://lxml.de/lxmlhtml.html>`_ as well::

    >>> from lxml.html import Element, tostring
    >>> result = bf.etree({'p': {'@id': 'main'}}, root=Element('html'))
    >>> tostring(result, doctype='<!DOCTYPE html>')
    '<!DOCTYPE html>\n<html><p id="main"></p></html>'

For ease of use, strings are treated as node text. For example, both the
following are the same::

    >>> bf.etree({'p': {'$': 'paragraph text'}})
    >>> bf.etree({'p': 'paragraph text'})

By default, non-string values are converted to strings using Python's ``str``,
except for booleans -- which are converted into ``true`` and ``false`` (lower
case). Override this behaviour using ``xml_fromstring``::

    >>> tostring(bf.etree({'x': 1.23, 'y': True}, root=Element('root')))
    '<root><y>true</y><x>1.23</x></root>'
    >>> from xmljson import BadgerFish              # import the class
    >>> bf_str = BadgerFish(xml_tostring=str)       # convert using str()
    >>> tostring(bf_str.etree({'x': 1.23, 'y': True}, root=Element('root')))
    '<root><y>True</y><x>1.23</x></root>'

If the data contains invalid XML keys, these can be dropped via
``invalid_tags='drop'`` in the constructor::

    >>> bf_drop = BadgerFish(invalid_tags='drop')
    >>> data = bf_drop.etree({'$': '1', 'x': '1'}, root=Element('root'))    # Drops invalid <$> tag
    >>> tostring(data)
    '<root>1<x>1</x></root>'


Convert XML to data
-------------------

To convert from XML to a data structure using the BadgerFish convention::

    >>> bf.data(fromstring('<p id="main">Hello<b>bold</b></p>'))
    {"p": {"$": "Hello", "@id": "main", "b": {"$": "bold"}}}

To convert this to JSON, use::

    >>> from json import dumps
    >>> dumps(bf.data(fromstring('<p id="main">Hello<b>bold</b></p>')))
    '{"p": {"b": {"$": "bold"}, "@id": "main", "$": "Hello"}}'

To preserve the order of attributes and children, specify the ``dict_type`` as
``OrderedDict`` (or any other dictionary-like type) in the constructor::

    >>> from collections import OrderedDict
    >>> from xmljson import BadgerFish              # import the class
    >>> bf = BadgerFish(dict_type=OrderedDict)      # pick dict class

By default, values are parsed into boolean, int or float where possible (except
in the Yahoo method). Override this behaviour using ``xml_fromstring``::

    >>> dumps(bf.data(fromstring('<x>1</x>')))
    '{"x": {"$": 1}}'
    >>> bf_str = BadgerFish(xml_fromstring=False)   # Keep XML values as strings
    >>> dumps(bf_str.data(fromstring('<x>1</x>')))
    '{"x": {"$": "1"}}'
    >>> bf_str = BadgerFish(xml_fromstring=repr)    # Custom string parser
    '{"x": {"$": "\'1\'"}}'

``xml_fromstring`` can be any custom function that takes a string and returns a
value. In the example below, only the integer ``1`` is converted to an integer.
Everything else is retained as a float::

    >>> def convert_only_int(val):
    ...     return int(val) if val.isdigit() else val
    >>> bf_int = BadgerFish(xml_fromstring=convert_only_int)
    >>> dumps(bf_int.data(fromstring('<p><x>1</x><y>2.5</y><z>NaN</z></p>')))
    '{"p": {"x": {"$": 1}, "y": {"$": "2.5"}, "z": {"$": "NaN"}}}'


Conventions
-----------

To use a different conversion method, replace ``BadgerFish`` with one of the
other classes. Currently, these are supported::

    >>> from xmljson import abdera          # == xmljson.Abdera()
    >>> from xmljson import badgerfish      # == xmljson.BadgerFish()
    >>> from xmljson import cobra           # == xmljson.Cobra()
    >>> from xmljson import gdata           # == xmljson.GData()
    >>> from xmljson import parker          # == xmljson.Parker()
    >>> from xmljson import yahoo           # == xmljson.Yahoo()


Options
-------

Conventions may support additional options.

The `Parker`_ convention absorbs the root element by default.
``parker.data(preserve_root=True)`` preserves the root instance::

    >>> from xmljson import parker, Parker
    >>> from xml.etree.ElementTree import fromstring
    >>> from json import dumps
    >>> dumps(parker.data(fromstring('<x><a>1</a><b>2</b></x>')))
    '{"a": 1, "b": 2}'
    >>> dumps(parker.data(fromstring('<x><a>1</a><b>2</b></x>'), preserve_root=True))
    '{"x": {"a": 1, "b": 2}}'


Installation
------------

This is a pure-Python package built for Python 2.7+ and Python 3.0+. To set up::

    pip install xmljson


Simple CLI utility
------------------

After installation, you can benefit from using this package as simple CLI utility. By now only XML to JSON conversion supported. Example::

    $ python -m xmljson -h
    usage: xmljson [-h] [-o OUT_FILE]
                [-d {abdera,badgerfish,cobra,gdata,parker,xmldata,yahoo}]
                [in_file]

    positional arguments:
    in_file               defaults to stdin

    optional arguments:
    -h, --help            show this help message and exit
    -o OUT_FILE, --out_file OUT_FILE
                            defaults to stdout
    -d {abdera,badgerfish,...}, --dialect {...}
                            defaults to parker

    $ python -m xmljson -d parker tests/mydata.xml
    {
      "foo": "spam",
      "bar": 42
    }

This is a typical UNIX filter program: it reads file (or ``stdin``), processes it in some way (convert XML to JSON in this case), then prints it to ``stdout`` (or file). Example with pipe::

    $ some-xml-producer | python -m xmljson | some-json-processor

There is also ``pip``'s ``console_script`` entry-point, you can call this utility as ``xml2json``::

    $ xml2json -d abdera mydata.xml

Roadmap
-------

* Test cases for Unicode
* Support for namespaces and namespace prefixes
* Support XML comments




History
-------
0.2.1 (25 Apr 2020)
~~~~~~~~~~~~~~~~~~~~~

- Bugfix: Don't strip whitespace in xml text values (@imoore76)
- Bugfix: Yahoo convention should convert ``<x>0</x>`` into ``{x: 0}``. Empty elements become ``''`` not ``{}``
- Suggest alternate libraries in documentation


0.2.0 (21 Nov 2018)
~~~~~~~~~~~~~~~~~~~~~
- ``xmljson`` command line script converts from XML to JSON (@tribals)
- ``invalid_tags='drop'`` in the constructor drops invalid XML tags in ``.etree()`` (@Zurga)
- Bugfix: Parker converts ``{'x': null}`` to ``<x></x>`` instead of ``<x>None</x>`` (@jorndoe #29)

0.1.9 (1 Aug 2017)
~~~~~~~~~~~~~~~~~~

- Bugfix and test cases for multiple nested children in Abdera_ convention

Thanks to @mukultaneja

0.1.8 (9 May 2017)
~~~~~~~~~~~~~~~~~~

- Add Abdera_ and Cobra_ conventions
- Add ``Parker.data(preserve_root=True)`` option to preserve root element in
  Parker convention.

Thanks to @dagwieers

.. _Abdera: http://wiki.open311.org/JSON_and_XML_Conversion/#the-abdera-convention
.. _Cobra: http://wiki.open311.org/JSON_and_XML_Conversion/#the-cobra-convention

0.1.6 (18 Feb 2016)
~~~~~~~~~~~~~~~~~~~

- Add ``xml_fromstring=`` and ``xml_tostring=`` parameters to constructor to
  customise string conversion from and to XML.


0.1.5 (23 Sep 2015)
~~~~~~~~~~~~~~~~~~~

- Add the Yahoo_ XML to JSON conversion method.

.. _Yahoo: https://developer.yahoo.com/javascript/json.html#xml

0.1.4 (20 Sep 2015)
~~~~~~~~~~~~~~~~~~~

- Fix ``GData.etree()`` conversion of attributes. (They were ignored. They
  should be added as-is.)

0.1.3 (20 Sep 2015)
~~~~~~~~~~~~~~~~~~~

- Simplify ``{'p': {'$': 'text'}}`` to ``{'p': 'text'}`` in BadgerFish and GData
  conventions.
- Add test cases for ``.etree()`` -- mainly from the `MDN JXON article`_.
- ``dict_type``/``list_type`` do not need to inherit from ``dict``/``list``

.. _MDN JXON article: https://developer.mozilla.org/en-US/docs/JXON#In_summary

0.1.2 (18 Sep 2015)
~~~~~~~~~~~~~~~~~~~

- Always use the ``dict_type`` class to create dictionaries (which defaults to
  ``OrderedDict`` to preserve order of keys)
- Update documentation, test cases
- Remove support for Python 2.6 (since we need ``collections.Counter``)
- Make the `Travis CI build`_ pass

.. _Travis CI build: https://travis-ci.org/sanand0/xmljson

0.1.1 (18 Sep 2015)
~~~~~~~~~~~~~~~~~~~

- Convert ``true``, ``false`` and numeric values from strings to Python types
- ``xmljson.parker.data()`` is compliant with Parker convention (bugs resolved)

0.1.0 (15 Sep 2015)
~~~~~~~~~~~~~~~~~~~

- Two-way conversions via BadgerFish, GData and Parker conventions.
- First release on PyPI.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sanand0/xmljson",
    "name": "xmljson",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "xmljson",
    "author": "S Anand",
    "author_email": "root.node@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e8/6f/d9f109ba19be510fd3098bcb72143c67ca6743cedb48ac75aef05ddfe960/xmljson-0.2.1.tar.gz",
    "platform": "",
    "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\nThis library is not actively maintained. Alternatives are `xmltodict`_ and `untangle`_.\nUse only if you need to parse using specific XML to JSON `conventions`_.\n\n.. _conventions: http://wiki.open311.org/JSON_and_XML_Conversion/\n.. _xmltodict: https://github.com/martinblech/xmltodict\n.. _untangle: https://untangle.readthedocs.io/en/latest/\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    <employees>\n        <person>\n            <name value=\"Alice\"/>\n        </person>\n        <person>\n            <name value=\"Bob\"/>\n        </person>\n    </employees>\n\ncan be converted into this data structure (which also a valid JSON object)::\n\n    {\n        \"employees\": [{\n            \"person\": {\n                \"name\": {\n                    \"@value\": \"Alice\"\n                }\n            }\n        }, {\n            \"person\": {\n                \"name\": {\n                    \"@value\": \"Bob\"\n                }\n            }\n        }]\n    }\n\nThis uses the `BadgerFish`_ convention that prefixes attributes with ``@``.\nThe conventions supported by this library are:\n\n* `Abdera`_: Use ``\"attributes\"`` for attributes, ``\"children\"`` for nodes\n* `BadgerFish`_: Use ``\"$\"`` for text content, ``@`` to prefix attributes\n* `Cobra`_: Use ``\"attributes\"`` for sorted attributes (even when empty), ``\"children\"`` for nodes, values are strings\n* `GData`_: Use ``\"$t\"`` for text content, attributes added as-is\n* `Parker`_: Use tail nodes for text content, ignore attributes\n* `Yahoo`_ Use ``\"content\"`` for text content, attributes added as-is\n\n.. _Abdera: http://wiki.open311.org/JSON_and_XML_Conversion/#the-abdera-convention\n.. _BadgerFish: http://www.sklar.com/badgerfish/\n.. _Cobra: http://wiki.open311.org/JSON_and_XML_Conversion/#the-cobra-convention\n.. _GData: http://wiki.open311.org/JSON_and_XML_Conversion/#the-gdata-convention\n.. _Parker: https://developer.mozilla.org/en-US/docs/JXON#The_Parker_Convention\n.. _Yahoo: https://developer.yahoo.com/javascript/json.html#xml\n\n\nConvert data to XML\n-------------------\n\nTo convert from a data structure to XML using the BadgerFish convention::\n\n    >>> from xmljson import badgerfish as bf\n    >>> bf.etree({'p': {'@id': 'main', '$': 'Hello', 'b': 'bold'}})\n\nThis returns an **array** of `etree.Element`_ structures. In this case, the\nresult is identical to::\n\n    >>> from xml.etree.ElementTree import fromstring\n    >>> [fromstring('<p id=\"main\">Hello<b>bold</b></p>')]\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    '<root><p id=\"main\"/></root>'\n\nThis includes `lxml.html <http://lxml.de/lxmlhtml.html>`_ as well::\n\n    >>> from lxml.html import Element, tostring\n    >>> result = bf.etree({'p': {'@id': 'main'}}, root=Element('html'))\n    >>> tostring(result, doctype='<!DOCTYPE html>')\n    '<!DOCTYPE html>\\n<html><p id=\"main\"></p></html>'\n\nFor ease of use, strings are treated as node text. For example, both the\nfollowing are the same::\n\n    >>> bf.etree({'p': {'$': 'paragraph text'}})\n    >>> bf.etree({'p': 'paragraph text'})\n\nBy default, non-string values are converted to strings using Python's ``str``,\nexcept for booleans -- which are converted into ``true`` and ``false`` (lower\ncase). Override this behaviour using ``xml_fromstring``::\n\n    >>> tostring(bf.etree({'x': 1.23, 'y': True}, root=Element('root')))\n    '<root><y>true</y><x>1.23</x></root>'\n    >>> from xmljson import BadgerFish              # import the class\n    >>> bf_str = BadgerFish(xml_tostring=str)       # convert using str()\n    >>> tostring(bf_str.etree({'x': 1.23, 'y': True}, root=Element('root')))\n    '<root><y>True</y><x>1.23</x></root>'\n\nIf the data contains invalid XML keys, these can be dropped via\n``invalid_tags='drop'`` in the constructor::\n\n    >>> bf_drop = BadgerFish(invalid_tags='drop')\n    >>> data = bf_drop.etree({'$': '1', 'x': '1'}, root=Element('root'))    # Drops invalid <$> tag\n    >>> tostring(data)\n    '<root>1<x>1</x></root>'\n\n\nConvert XML to data\n-------------------\n\nTo convert from XML to a data structure using the BadgerFish convention::\n\n    >>> bf.data(fromstring('<p id=\"main\">Hello<b>bold</b></p>'))\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('<p id=\"main\">Hello<b>bold</b></p>')))\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('<x>1</x>')))\n    '{\"x\": {\"$\": 1}}'\n    >>> bf_str = BadgerFish(xml_fromstring=False)   # Keep XML values as strings\n    >>> dumps(bf_str.data(fromstring('<x>1</x>')))\n    '{\"x\": {\"$\": \"1\"}}'\n    >>> bf_str = BadgerFish(xml_fromstring=repr)    # Custom string parser\n    '{\"x\": {\"$\": \"\\'1\\'\"}}'\n\n``xml_fromstring`` can be any custom function that takes a string and returns a\nvalue. In the example below, only the integer ``1`` is converted to an integer.\nEverything else is retained as a float::\n\n    >>> def convert_only_int(val):\n    ...     return int(val) if val.isdigit() else val\n    >>> bf_int = BadgerFish(xml_fromstring=convert_only_int)\n    >>> dumps(bf_int.data(fromstring('<p><x>1</x><y>2.5</y><z>NaN</z></p>')))\n    '{\"p\": {\"x\": {\"$\": 1}, \"y\": {\"$\": \"2.5\"}, \"z\": {\"$\": \"NaN\"}}}'\n\n\nConventions\n-----------\n\nTo use a different conversion method, replace ``BadgerFish`` with one of the\nother classes. Currently, these are supported::\n\n    >>> from xmljson import abdera          # == xmljson.Abdera()\n    >>> from xmljson import badgerfish      # == xmljson.BadgerFish()\n    >>> from xmljson import cobra           # == xmljson.Cobra()\n    >>> from xmljson import gdata           # == xmljson.GData()\n    >>> from xmljson import parker          # == xmljson.Parker()\n    >>> from xmljson import yahoo           # == xmljson.Yahoo()\n\n\nOptions\n-------\n\nConventions may support additional options.\n\nThe `Parker`_ convention absorbs the root element by default.\n``parker.data(preserve_root=True)`` preserves the root instance::\n\n    >>> from xmljson import parker, Parker\n    >>> from xml.etree.ElementTree import fromstring\n    >>> from json import dumps\n    >>> dumps(parker.data(fromstring('<x><a>1</a><b>2</b></x>')))\n    '{\"a\": 1, \"b\": 2}'\n    >>> dumps(parker.data(fromstring('<x><a>1</a><b>2</b></x>'), preserve_root=True))\n    '{\"x\": {\"a\": 1, \"b\": 2}}'\n\n\nInstallation\n------------\n\nThis is a pure-Python package built for Python 2.7+ and Python 3.0+. To set up::\n\n    pip install xmljson\n\n\nSimple CLI utility\n------------------\n\nAfter installation, you can benefit from using this package as simple CLI utility. By now only XML to JSON conversion supported. Example::\n\n    $ python -m xmljson -h\n    usage: xmljson [-h] [-o OUT_FILE]\n                [-d {abdera,badgerfish,cobra,gdata,parker,xmldata,yahoo}]\n                [in_file]\n\n    positional arguments:\n    in_file               defaults to stdin\n\n    optional arguments:\n    -h, --help            show this help message and exit\n    -o OUT_FILE, --out_file OUT_FILE\n                            defaults to stdout\n    -d {abdera,badgerfish,...}, --dialect {...}\n                            defaults to parker\n\n    $ python -m xmljson -d parker tests/mydata.xml\n    {\n      \"foo\": \"spam\",\n      \"bar\": 42\n    }\n\nThis is a typical UNIX filter program: it reads file (or ``stdin``), processes it in some way (convert XML to JSON in this case), then prints it to ``stdout`` (or file). Example with pipe::\n\n    $ some-xml-producer | python -m xmljson | some-json-processor\n\nThere is also ``pip``'s ``console_script`` entry-point, you can call this utility as ``xml2json``::\n\n    $ xml2json -d abdera mydata.xml\n\nRoadmap\n-------\n\n* Test cases for Unicode\n* Support for namespaces and namespace prefixes\n* Support XML comments\n\n\n\n\nHistory\n-------\n0.2.1 (25 Apr 2020)\n~~~~~~~~~~~~~~~~~~~~~\n\n- Bugfix: Don't strip whitespace in xml text values (@imoore76)\n- Bugfix: Yahoo convention should convert ``<x>0</x>`` into ``{x: 0}``. Empty elements become ``''`` not ``{}``\n- Suggest alternate libraries in documentation\n\n\n0.2.0 (21 Nov 2018)\n~~~~~~~~~~~~~~~~~~~~~\n- ``xmljson`` command line script converts from XML to JSON (@tribals)\n- ``invalid_tags='drop'`` in the constructor drops invalid XML tags in ``.etree()`` (@Zurga)\n- Bugfix: Parker converts ``{'x': null}`` to ``<x></x>`` instead of ``<x>None</x>`` (@jorndoe #29)\n\n0.1.9 (1 Aug 2017)\n~~~~~~~~~~~~~~~~~~\n\n- Bugfix and test cases for multiple nested children in Abdera_ convention\n\nThanks to @mukultaneja\n\n0.1.8 (9 May 2017)\n~~~~~~~~~~~~~~~~~~\n\n- Add Abdera_ and Cobra_ conventions\n- Add ``Parker.data(preserve_root=True)`` option to preserve root element in\n  Parker convention.\n\nThanks to @dagwieers\n\n.. _Abdera: http://wiki.open311.org/JSON_and_XML_Conversion/#the-abdera-convention\n.. _Cobra: http://wiki.open311.org/JSON_and_XML_Conversion/#the-cobra-convention\n\n0.1.6 (18 Feb 2016)\n~~~~~~~~~~~~~~~~~~~\n\n- Add ``xml_fromstring=`` and ``xml_tostring=`` parameters to constructor to\n  customise string conversion from and to XML.\n\n\n0.1.5 (23 Sep 2015)\n~~~~~~~~~~~~~~~~~~~\n\n- Add the Yahoo_ XML to JSON conversion method.\n\n.. _Yahoo: https://developer.yahoo.com/javascript/json.html#xml\n\n0.1.4 (20 Sep 2015)\n~~~~~~~~~~~~~~~~~~~\n\n- Fix ``GData.etree()`` conversion of attributes. (They were ignored. They\n  should be added as-is.)\n\n0.1.3 (20 Sep 2015)\n~~~~~~~~~~~~~~~~~~~\n\n- Simplify ``{'p': {'$': 'text'}}`` to ``{'p': 'text'}`` in BadgerFish and GData\n  conventions.\n- Add test cases for ``.etree()`` -- mainly from the `MDN JXON article`_.\n- ``dict_type``/``list_type`` do not need to inherit from ``dict``/``list``\n\n.. _MDN JXON article: https://developer.mozilla.org/en-US/docs/JXON#In_summary\n\n0.1.2 (18 Sep 2015)\n~~~~~~~~~~~~~~~~~~~\n\n- Always use the ``dict_type`` class to create dictionaries (which defaults to\n  ``OrderedDict`` to preserve order of keys)\n- Update documentation, test cases\n- Remove support for Python 2.6 (since we need ``collections.Counter``)\n- Make the `Travis CI build`_ pass\n\n.. _Travis CI build: https://travis-ci.org/sanand0/xmljson\n\n0.1.1 (18 Sep 2015)\n~~~~~~~~~~~~~~~~~~~\n\n- Convert ``true``, ``false`` and numeric values from strings to Python types\n- ``xmljson.parker.data()`` is compliant with Parker convention (bugs resolved)\n\n0.1.0 (15 Sep 2015)\n~~~~~~~~~~~~~~~~~~~\n\n- Two-way conversions via BadgerFish, GData and Parker conventions.\n- First release on PyPI.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Converts XML into JSON/Python dicts/arrays and vice-versa.",
    "version": "0.2.1",
    "split_keywords": [
        "xmljson"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "527685fc40c28fd696124737840389ca",
                "sha256": "8f1d7aba2c0c1bfa0203b577f21a1d95fde4485205ff638b854cb4d834e639b0"
            },
            "downloads": -1,
            "filename": "xmljson-0.2.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "527685fc40c28fd696124737840389ca",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 10145,
            "upload_time": "2020-04-25T04:10:30",
            "upload_time_iso_8601": "2020-04-25T04:10:30.731967Z",
            "url": "https://files.pythonhosted.org/packages/91/2d/7191efe15406b8b99e2b5905ca676a8a3dc2936416ade7ed17752902c250/xmljson-0.2.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "fc4df2390ad209928ee4311a3540cb17",
                "sha256": "b4158e66aa1e62ee39f7f80eb2fe4f767670ba3c0d5de9804420dc53427fdec8"
            },
            "downloads": -1,
            "filename": "xmljson-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fc4df2390ad209928ee4311a3540cb17",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29195,
            "upload_time": "2020-04-25T04:10:32",
            "upload_time_iso_8601": "2020-04-25T04:10:32.623860Z",
            "url": "https://files.pythonhosted.org/packages/e8/6f/d9f109ba19be510fd3098bcb72143c67ca6743cedb48ac75aef05ddfe960/xmljson-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-04-25 04:10:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "sanand0",
    "github_project": "xmljson",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.23.0"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "xmljson"
}
        
Elapsed time: 0.01889s