UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.6+.
Install with pip:
python -m 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]""")
[{'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("<script>John&Doe", encode_html_chars=True)
'"\\u003cscript\\u003eJohn\\u0026Doe"'
ensure_ascii
Limits output to ASCII and escapes all extended characters above 127. Default is True. If your end format supports UTF-8, setting this option to false is highly recommended to save space:
>>> ujson.dumps("åäö")
'"\\u00e5\\u00e4\\u00f6"'
>>> ujson.dumps("åäö", ensure_ascii=False)
'"åäö"'
escape_forward_slashes
Controls whether forward slashes (/) are escaped. Default is True:
>>> ujson.dumps("http://esn.me")
'"http:\\/\\/esn.me"'
>>> ujson.dumps("http://esn.me", escape_forward_slashes=False)
'"http://esn.me"'
indent
Controls whether indentation (“pretty output”) is enabled. Default is 0 (disabled):
>>> ujson.dumps({"foo": "bar"})
'{"foo":"bar"}'
>>> print(ujson.dumps({"foo": "bar"}, indent=4))
{
"foo":"bar"
}
Benchmarks
UltraJSON calls/sec compared to other popular JSON parsers with performance gain specified below each.
Test machine:
Linux 5.0.0-1032-azure x86_64 #34-Ubuntu SMP Mon Feb 10 19:37:25 UTC 2020
Versions:
CPython 3.8.2 (default, Feb 28 2020, 14:28:43) [GCC 7.4.0]
nujson : 1.35.2
orjson : 2.6.1
simplejson: 3.17.0
ujson : 2.0.2
ujson |
nujson |
orjson |
simplejson |
json |
|
|---|---|---|---|---|---|
Array with 256 doubles |
|||||
encode |
22,082 |
4,282 |
76,975 |
5,328 |
5,436 |
decode |
24,127 |
34,349 |
29,059 |
14,174 |
13,822 |
Array with 256 UTF-8 strings |
|||||
encode |
3,557 |
2,528 |
24,300 |
3,061 |
2,068 |
decode |
2,030 |
2,490 |
931 |
406 |
358 |
Array with 256 strings |
|||||
encode |
39,041 |
31,769 |
76,403 |
16,615 |
16,910 |
decode |
25,185 |
24,287 |
34,437 |
32,388 |
27,999 |
Medium complex object |
|||||
encode |
10,382 |
11,427 |
32,995 |
3,959 |
5,275 |
decode |
9,785 |
9,796 |
11,515 |
5,898 |
7,200 |
Array with 256 True values |
|||||
encode |
114,341 |
101,039 |
344,256 |
62,382 |
72,872 |
decode |
149,367 |
151,615 |
181,123 |
114,597 |
130,392 |
Array with 256 dict{string, int} pairs |
|||||
encode |
13,715 |
14,420 |
51,942 |
3,271 |
6,584 |
decode |
12,670 |
11,788 |
12,176 |
6,743 |
8,278 |
Dict with 256 arrays with 256 dict{string, int} pairs |
|||||
encode |
50 |
54 |
216 |
10 |
23 |
decode |
32 |
32 |
30 |
20 |
23 |
Dict with 256 arrays with 256 dict{string, int} pairs, outputting sorted keys |
|||||
encode |
46 |
41 |
8 |
24 |
|
Complex object |
|||||
encode |
533 |
582 |
408 |
431 |
|
decode |
466 |
454 |
154 |
164 |
Metadata
Release files for ujson 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ujson-4.1.0.tar.gz | 7.1 MB | Details |
Built distributions (wheels)
Total release size: 9.7 MB
Release files / ujson-4.1.0.tar.gz
| Download URL | ujson-4.1.0.tar.gz |
|---|---|
| Size | 7.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22b63ec4409f0d2f2c4c9d5aa331997e02470b7a15a3233f3cc32f2f9b92d58c
|
|
BLAKE2b-256 checksum How to use checksums |
2c8d63b4afe82d646a606cef838855a6110c7a3a012622e656bd29fb2d15f1d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
|
Release files / ujson-4.1.0-cp39-cp39-win_amd64.whl
| Download URL | ujson-4.1.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 44.3 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
44db30b8fc52e70a6f67def11804f74818addafef0a65cd7f0abb98b7830920f
|
|
BLAKE2b-256 checksum How to use checksums |
f256ca8596b3f243f8e71a102e7997e47375b7bc86bc6e4b01f040d677d8d952
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
|
Release files / ujson-4.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ujson-4.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 214.1 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
8e8fe9bbeca130debb10eea7910433a0714c8efc057fad36353feccb87c1d07f
|
|
BLAKE2b-256 checksum How to use checksums |
378dae02dd5dfe7c9a414ea8b31d64cb7666973b2a931fa0a081fa6f3d70505a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | ujson-4.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 179.5 kB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
1fb2455e62f20ab4a6d49f78b5dc4ff99c72fdab9466e761120e9757fa35f4d7
|
|
BLAKE2b-256 checksum How to use checksums |
733b91845701986868a6c96cb45789cc928879666330a4884456562e0d12c565
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | ujson-4.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 170.6 kB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
81a49dbf176ae041fc86d2da564f5b9b46faf657306035632da56ecfd7203193
|
|
BLAKE2b-256 checksum How to use checksums |
f52e02865dfb4d79675d623825bee8fa260c25045a66cd90bc7a376f1e67a3e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp39-cp39-macosx_10_14_x86_64.whl
| Download URL | ujson-4.1.0-cp39-cp39-macosx_10_14_x86_64.whl |
|---|---|
| Size | 45.5 kB |
| Tags | CPython 3.9 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
a873c93d43f9bd14d9e9a6d2c6eb7aae4aad9717fe40c748d0cd4b6ed7767c62
|
|
BLAKE2b-256 checksum How to use checksums |
a15080f72f53e8cfce71403ffc3303b4c2cb44d3b66240cc58e483e2e01c758a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
|
Release files / ujson-4.1.0-cp38-cp38-win_amd64.whl
| Download URL | ujson-4.1.0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 44.3 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d2955dd5cce0e76ba56786d647aaedca2cebb75eda9f0ec1787110c3646751a8
|
|
BLAKE2b-256 checksum How to use checksums |
191c8628275ca5ed0aef391d3f283a9ab7978531d19e626052eee4b3b0cfad3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
|
Release files / ujson-4.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ujson-4.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 214.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
be6013cda610c5149fb80a84ee815b210aa2e7fe4edf1d2bce42c02336715208
|
|
BLAKE2b-256 checksum How to use checksums |
8532a9abe6269b3f05c78c6b2a44d496d28297ab851a6c127b748712e9b14092
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | ujson-4.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 180.8 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
807bb0585f30a650ec981669827721ed3ee1ee24f2c6f333a64982a40eb66b82
|
|
BLAKE2b-256 checksum How to use checksums |
c382dc77bc179d570379157985b12cc0c9b7fd9b3bb8ac8967eeec2df5833cd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | ujson-4.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 171.8 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
41b7e5422184249b5b94d1571206f76e5d91e8d721ce51abe341a88f41dd6692
|
|
BLAKE2b-256 checksum How to use checksums |
4bb6f5ab54a222ceb6dc068e04f882805fa18c14d40d9e7aefc87f8f7ee33874
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp38-cp38-macosx_10_14_x86_64.whl
| Download URL | ujson-4.1.0-cp38-cp38-macosx_10_14_x86_64.whl |
|---|---|
| Size | 45.4 kB |
| Tags | CPython 3.8 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
9e962df227fd1d851ff095382a9f8432c2470c3ee640f02ae14231dc5728e6f3
|
|
BLAKE2b-256 checksum How to use checksums |
7715cfe20a794cabf9794722e03e72d1dcac748cfd1dae9b7534f4e4ecfd99cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp37-cp37m-win_amd64.whl
| Download URL | ujson-4.1.0-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 44.2 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
44993136fd2ecade747b6db95917e4f015a3279e09a08113f70cbbd0d241e66a
|
|
BLAKE2b-256 checksum How to use checksums |
18966f2146fe414631eda522b9eba1a939b07693bf640c702acc8b47f586d7e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.9
|
Release files / ujson-4.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ujson-4.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 212.7 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
9005d0d952d0c1b3dff5cdb79df2bde35a3499e2de3f708a22c45bbb4089a1f6
|
|
BLAKE2b-256 checksum How to use checksums |
879228f0a5e50c86a249c297a31bca67bfbe6f8e93424b863c50684b7a3fd595
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | ujson-4.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 178.9 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
989bed422e7e20c7ba740a4e1bbeb28b3b6324e04f023ea238a2e5449fc53668
|
|
BLAKE2b-256 checksum How to use checksums |
4398b051616067405dfe434abe617a033551dfb7c40274b8221f08818fab737a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | ujson-4.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 169.9 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
117855246a9ea3f61f3b69e5ca1b1d11d622b3126f50a0ec08b577cb5c87e56e
|
|
BLAKE2b-256 checksum How to use checksums |
b79c8450f38168c3627c189617200a897b1be149f3b8456a733880afa01ca4f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp37-cp37m-macosx_10_14_x86_64.whl
| Download URL | ujson-4.1.0-cp37-cp37m-macosx_10_14_x86_64.whl |
|---|---|
| Size | 45.3 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
2251fc9395ba4498cbdc48136a179b8f20914fa8b815aa9453b20b48ad120f43
|
|
BLAKE2b-256 checksum How to use checksums |
120708f8905682c54d05dedf17fb47376dc7a213e4bd035677f1598397d562fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.11
|
Release files / ujson-4.1.0-cp36-cp36m-win_amd64.whl
| Download URL | ujson-4.1.0-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 44.2 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f135db442e5470d9065536745968efc42a60233311c8509b9327bcd59a8821c7
|
|
BLAKE2b-256 checksum How to use checksums |
59bbf1ce78fbd136a2c22249c4800a7409ae79da756de61d1950d53a7d187a65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.8
|
Release files / ujson-4.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ujson-4.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 212.6 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
d1c2fb32976982e4e75ca0843a1e7b2254b8c5d8c45d979ebf2db29305b4fa31
|
|
BLAKE2b-256 checksum How to use checksums |
e4c49b66e27d40f493bd0e2393ef45f5f5be47f08f6ecc17b0b53b92fb5e756f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | ujson-4.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 178.9 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
f453480b275192ae40ef350a4e8288977f00b02e504ed34245ebd12d633620cb
|
|
BLAKE2b-256 checksum How to use checksums |
448fb73d27b70deb0de7a3efcea774153842baf6d10091788995e50673d69197
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | ujson-4.1.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 169.9 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
971d4b450e689bfec8ad6b22060fb9b9bec1e0860dbdf0fa7cfe4068adbc5f58
|
|
BLAKE2b-256 checksum How to use checksums |
5f880d9082aa0c574d6ecc2a54f5b0fd864ba110f683e00c25d1cb5b70e5c8cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
|
Release files / ujson-4.1.0-cp36-cp36m-macosx_10_14_x86_64.whl
| Download URL | ujson-4.1.0-cp36-cp36m-macosx_10_14_x86_64.whl |
|---|---|
| Size | 45.3 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
148680f2bc6e52f71c56908b65f59b36a13611ac2f75a86f2cb2bce2b2c2588c
|
|
BLAKE2b-256 checksum How to use checksums |
e9ceab4e61820ab2542c179832d620250e794c43c5ae691c9f715386d8f63712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.14
|