This is an experiment to port the popular ujson module to HPy.
Below there is the original README.
UltraJSON
UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 2.5+ and 3.
For a more painless day to day C/C++ JSON decoder experience please checkout ujson4c, based on UltraJSON.
Please checkout the rest of the projects in the Ultra series:
To install it just run Pip as usual:
$ pip install ujson
Usage
May be used as a drop in replacement for most other JSON parsers for Python:
>>> import ujson >>> ujson.dumps([{"key": "value"}, 81, True]) '[{"key":"value"},81,true]' >>> ujson.loads("""[{"key": "value"}, 81, true]""") [{u'key': u'value'}, 81, True]
Encoder options
encode_html_chars
Used to enable special encoding of "unsafe" HTML characters into safer Unicode sequences. Default is False:
">>> ujson.dumps("