oxjson
English | Русский
A JSON library for CPython with the orjson interface: loads returns dict / list, dumps returns bytes.
The parser kernel is x86-64 assembly (NASM, AVX2). A C version of the same code, with NEON on ARM64
and SSE2 on older x86-64 CPUs, runs everywhere else.
import oxjson
obj = oxjson.loads(b'{"id": 1, "tags": ["a", "b"], "score": 2.5}')
data = oxjson.dumps(obj) # b'{"id":1,"tags":["a","b"],"score":2.5}'
text = oxjson.dumps(obj, option=oxjson.OPT_INDENT_2 | oxjson.OPT_SORT_KEYS)
Status
Young project. It passes the public conformance suites and agrees with orjson on the checks listed under
Tests, but it has not been fuzzed and has no CI yet. Do not feed it untrusted input in production
before that is done.
Interface
loads(data) |
data is bytes, bytearray, memoryview or str. Raises JSONDecodeError (a subclass of json.JSONDecodeError) with .pos. |
dumps(obj, default=None, option=None) |
Returns bytes. option is a combination of the OPT_* constants, with the same names and values as in orjson. |
load(fp), dump(obj, fp) |
Read from and write to a binary file object. |
dumps writes str, int (−2^63 … 2^64−1), float, bool, None, list, tuple, dict, dataclasses,
datetime / date / time, enum.Enum, uuid.UUID, and numpy arrays and scalars with OPT_SERIALIZE_NUMPY.
Anything else goes to default.
Supported options: OPT_APPEND_NEWLINE, OPT_INDENT_2, OPT_NAIVE_UTC, OPT_NON_STR_KEYS,
OPT_OMIT_MICROSECONDS, OPT_PASSTHROUGH_DATACLASS, OPT_PASSTHROUGH_DATETIME, OPT_PASSTHROUGH_SUBCLASS,
OPT_SERIALIZE_NUMPY, OPT_SORT_KEYS, OPT_STRICT_INTEGER, OPT_UTC_Z.
Differences from orjson
- Floats are written the way Python prints them:
1e-05,1e+16. orjson writes1e-5,1e16. The values are the same. loadshas no nesting limit; orjson stops at 1024 levels.dumpswithout layout options has no limit either; withOPT_INDENT_2,OPT_SORT_KEYS,OPT_NON_STR_KEYSorOPT_STRICT_INTEGERit stops at 254 levels, as orjson does.- No
orjson.Fragment. dumps(..., allow_nan=False)raisesValueErrorfor NaN and infinities instead of writingnull.- Errors from
dumpsareTypeError, notorjson.JSONEncodeError(which is a subclass ofTypeError).
Platforms
| target | code path |
|---|---|
| x86-64 with AVX2, Windows and Linux | assembly kernel |
| x86-64 without AVX2 | C with 16-byte SSE2 vectors, chosen when the module is imported |
| ARM64 (Apple Silicon, Linux) | C with 16-byte NEON vectors. Cross-compiles cleanly for Linux and macOS but has not been run on ARM hardware yet; run tests/vec16_selftest.c and the tests there first. |
| anything else | plain C |
Python 3.10 – 3.14. The extension uses a few private CPython functions, so a new Python release may need a fix. The free-threaded build and sub-interpreters are not supported: the key cache is shared by the process.
Set OXJSON_NO_AVX2=1 before the import to force the portable path.
Build
Needs gcc and, on x86-64, nasm 2.16 or newer.
python make_ext.py
That builds oxjson/oxjson.pyd (or .so) for the interpreter that runs the script.
python make_ext.py <dir> puts a copy of the package into <dir>/oxjson instead.
For a wheel / sdist (PyPI):
python -m pip install build
python -m build
GitHub Actions builds wheels on push (.github/workflows/wheels.yml). Publishing to
PyPI is .github/workflows/publish.yml on a v* tag after Trusted Publishing is
configured for this repo (see PyPI docs).
Checking a new machine
One script builds the extension, runs every test and the benchmark, and writes a single report file:
python -m pip install -r requirements-dev.txt
python tests/run_all.py
The report is report-<system>-<machine>-py<XY>.txt in the repository root; the benchmark numbers go to
bench/results/ and into docs/benchmarks.md.
Tests
python tests/check_versions.py
Compares loads with orjson on the files in testdata/ and on 30 000 random documents, and checks that
repeated calls do not leak.
python tests/check_dumps_orjson.py
Compares dumps with orjson byte for byte over the supported types and option combinations.
python tests/check_portable.py
Checks that the assembly path and the portable path produce identical output.
tests/vec16_selftest.c is a stand-alone C program that checks the SSE2 / NEON helpers against plain C;
the build command is in its header.
python tests/check_conformance.py <dir>
Runs JSONTestSuite,
nativejson-benchmark and
json_test_data cloned into <dir>; the file header lists the commands.
tests/check_loads.py and tests/check_dumps.py compare with the standard json module on random data.
Benchmarks
docs/benchmarks.md: speed, peak memory and installed size against orjson, msgspec, ssrjson, yyjson, pysimdjson, ujson, python-rapidjson and the standard library, on Python 3.10 – 3.14.
python bench/bench.py
python bench/report.py
Layout
src/jl_kernel.asm loads kernel, NASM, AVX2
src/jl_loads.c builds Python objects for the kernel; the same kernel in C
src/jl_portable.c jl_loads.c compiled as the portable build
src/json_dumps_walk.c dumps
src/json_dumps_ext.inc dataclass, datetime, enum, UUID, numpy and the layout options
src/json_dumps_portable.c json_dumps_walk.c compiled as the portable build
include/json_vec16.h 16-byte vector helpers of the portable build: NEON and SSE2
src/json_module.c the Python module
tools/ generators of the tables in include/
License
MPL-2.0, see LICENSE. Copyright (c) 2026 Lev Berezkin.
Third-party code and test documents (Zmij float digits, JSON fixtures) are under
their own MIT licenses; see THIRD_PARTY.md and licenses/.
Metadata
Release files for oxjson 0.4.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 | |
|---|---|---|---|
| oxjson-0.4.0.tar.gz | 3.3 MB | Details |
Built distributions (wheels)
Total release size: 4.2 MB
Release files / oxjson-0.4.0.tar.gz
| Download URL | oxjson-0.4.0.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bc25bc86f224dd7846decc7284ac9c13ac0e68037fe0a1519f82848cfe0dc56
|
|
BLAKE2b-256 checksum How to use checksums |
52061f3a37fd1e6d3817f0c79bf8d6398e1fc0c645786c150ff5fd6bdcd92978
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | oxjson-0.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 103.3 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
12c1f6e63a199faf89af0b7bb08de034512960162fe60db8a915c10ed2da3936
|
|
BLAKE2b-256 checksum How to use checksums |
a573bb03c7b174027cf34df72ff118bfbfb17a19da2754729cef65d5b2eeb748
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | oxjson-0.4.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 63.4 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ddde1df8831846df2bf2c92823eedfc28e4205c4d4714214b8652d9efb061af1
|
|
BLAKE2b-256 checksum How to use checksums |
b09e72abadb7b2a9ecb8cefe27c282384d8cc04ea72fd192e6c665c6f157ef2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | oxjson-0.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 104.0 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1a72a55b2983f954c4b7c5ecc29afbf52777e56b11966afb6692591619a68750
|
|
BLAKE2b-256 checksum How to use checksums |
85b39040fc5384e3fa8f416f1b50a5186da0ae0b0c16d6a8967ffc0d519f32ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | oxjson-0.4.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 63.6 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
eac3c4e7f74a7c6baec5cbd4a781c2dad2bc8ea4802bd8a43f4cbded600cef0c
|
|
BLAKE2b-256 checksum How to use checksums |
96c101a8d65e0034e8cedc79bedf3d271b6b0baf0bf243f4692a40683b0ed88d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp312-cp312-win_amd64.whl
| Download URL | oxjson-0.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 114.5 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4df4934b033a62d0b9b741f975a1658b13694f545f9b78245f0027e60e5a11b9
|
|
BLAKE2b-256 checksum How to use checksums |
554ad94a3783c01792f191762d472d3c5406f9a289eb814d1786b2e843bc8e5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | oxjson-0.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 106.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f132325f5be3bae240f3f1195ad0c9558a4dc8de5075f0ab37a130922f1a0f4a
|
|
BLAKE2b-256 checksum How to use checksums |
f91fad0e1351e28287c9aec9661dcda00617b543324e1168122943f837dd2b94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | oxjson-0.4.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 63.8 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
06298cf0005f57b4c7feadcab79c4019524ae5e5fb27da068abeca233fb1488c
|
|
BLAKE2b-256 checksum How to use checksums |
1c9da8744593aaa6b3851b8fc15eb410fed941fd67c859c69d6fce915a8e17ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | oxjson-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 98.9 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a1673c5835473a6f4bd5ee84af4a9b6ad91786a044a6c1bd86bac642f7c7f716
|
|
BLAKE2b-256 checksum How to use checksums |
2d993eae2af25ab4a888df81dd6bbd8967ab7646f254acaf62ffc8dc2fcda23f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | oxjson-0.4.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 61.5 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c129d5688046d5aa06e8ab98dc590521fb66a62c89677f33a341667af09e006e
|
|
BLAKE2b-256 checksum How to use checksums |
aa564aa4469610b3946024e6e06cbaa32358c4ad899abbd2207bea17c438859d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | oxjson-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 99.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c983879e83a8abffc51b3f33b051978ba381413a3abc57283d335a9c713d1d33
|
|
BLAKE2b-256 checksum How to use checksums |
1b4c5978dbf721630ac4f5594c62f04efd0e65cb9f2e46a6ecdf26d829255f29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / oxjson-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | oxjson-0.4.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 61.7 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e5640b58a97f48911eb3431c617aadec191155125a15633a4f358cf21a85fa78
|
|
BLAKE2b-256 checksum How to use checksums |
b0f9223c6cc5e8b74018e803dbda466ac851a715a207ed9eecf3076f2cb3f6cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency log