ujson (original) (raw)

Project description

UltraJSON

PyPI version Supported Python versions PyPI downloads GitHub Actions status codecov DOI Code style: Black

UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.8+.

Install with pip:

python -m pip install ujson

Project status

[!WARNING] UltraJSON's architecture is fundamentally ill-suited to making changes without risk of introducing new security vulnerabilities. As a result, this library has been put into a maintenance-only mode. Support for new Python versions will be added and critical bugs and security issues will still be fixed but all other changes will be rejected. Users are encouraged to migrate to orjson which is both much faster and less likely to introduce a surprise buffer overflow vulnerability in the future.

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]""") [{'key': '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("