Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wbolster/jsonx
Python library for JSONx, an XML representation of the JSON data model
https://github.com/wbolster/jsonx
Last synced: about 2 months ago
JSON representation
Python library for JSONx, an XML representation of the JSON data model
- Host: GitHub
- URL: https://github.com/wbolster/jsonx
- Owner: wbolster
- Created: 2014-10-02T16:54:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T09:18:57.000Z (about 4 years ago)
- Last Synced: 2023-04-09T12:18:24.470Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
=====
JSONx
=====This is a Python module implementing JSONx, an XML representation of the JSON
data model. The format is defined by IBM, and documentation is available on the
IBM website: `JSONx conversion rules
`_Note: currently only writing support has been implemented; there's no parser
yet!Example
=======JSON:
.. code-block:: json
{"foo": [1, "bar", []]}
JSONx:
.. code-block:: xml
1
bar
WHAT? WHY WOULD I NEED THIS?
============================You probably don't want to use this. But, hey, remember, using XML makes your
product ready for the enterprise!Installation
============Install using ``pip``::
pip install jsonx
Usage
=====The interface mimics the familiar `json` module::
import jsonx
obj = {
"name": "John Doe",
"age": 12,
}# To obtain a byte string, use dumps()
value = jsonx.dumps(obj)# To write directly to a file-like object, use dump()
with open("output.xml") as fp:
jsonx.dump(obj, fp)