1
1
# orjson
2
2
3
3
orjson is a fast, correct JSON library for Python. It
4
- [ benchmarks] ( https://github.com/ijl/orjson#performance ) as the fastest Python
4
+ [ benchmarks] ( https://github.com/ijl/orjson?tab=readme-ov-file #performance ) as the fastest Python
5
5
library for JSON and is more correct than the standard json library or other
6
6
third-party libraries. It serializes
7
- [ dataclass] ( https://github.com/ijl/orjson#dataclass ) ,
8
- [ datetime] ( https://github.com/ijl/orjson#datetime ) ,
9
- [ numpy] ( https://github.com/ijl/orjson#numpy ) , and
10
- [ UUID] ( https://github.com/ijl/orjson#uuid ) instances natively.
7
+ [ dataclass] ( https://github.com/ijl/orjson?tab=readme-ov-file #dataclass ) ,
8
+ [ datetime] ( https://github.com/ijl/orjson?tab=readme-ov-file #datetime ) ,
9
+ [ numpy] ( https://github.com/ijl/orjson?tab=readme-ov-file #numpy ) , and
10
+ [ UUID] ( https://github.com/ijl/orjson?tab=readme-ov-file #uuid ) instances natively.
11
11
12
12
Its features and drawbacks compared to other Python JSON libraries:
13
13
@@ -33,7 +33,7 @@ support for 64-bit
33
33
file-like objects
34
34
35
35
orjson supports CPython 3.8, 3.9, 3.10, 3.11, and 3.12. It distributes
36
- amd64/x86_64, aarch64/armv8, POWER/ppc64le, and s390x wheels for Linux,
36
+ amd64/x86_64, aarch64/armv8, arm7, POWER/ppc64le, and s390x wheels for Linux,
37
37
amd64 and aarch64 wheels for macOS, and amd64 and i686/x86 wheels for Windows.
38
38
orjson does not and will not support PyPy. orjson does not and will not
39
39
support PEP 554 subinterpreters. Releases follow semantic versioning and
@@ -47,32 +47,32 @@ submitted there. There is a
47
47
[ CHANGELOG] ( https://github.com/ijl/orjson/blob/master/CHANGELOG.md )
48
48
available in the repository.
49
49
50
- 1 . [ Usage] ( https://github.com/ijl/orjson#usage )
51
- 1 . [ Install] ( https://github.com/ijl/orjson#install )
52
- 2 . [ Quickstart] ( https://github.com/ijl/orjson#quickstart )
53
- 3 . [ Migrating] ( https://github.com/ijl/orjson#migrating )
54
- 4 . [ Serialize] ( https://github.com/ijl/orjson#serialize )
55
- 1 . [ default] ( https://github.com/ijl/orjson#default )
56
- 2 . [ option] ( https://github.com/ijl/orjson#option )
57
- 3 . [ Fragment] ( https://github.com/ijl/orjson#fragment )
58
- 5 . [ Deserialize] ( https://github.com/ijl/orjson#deserialize )
59
- 2 . [ Types] ( https://github.com/ijl/orjson#types )
60
- 1 . [ dataclass] ( https://github.com/ijl/orjson#dataclass )
61
- 2 . [ datetime] ( https://github.com/ijl/orjson#datetime )
62
- 3 . [ enum] ( https://github.com/ijl/orjson#enum )
63
- 4 . [ float] ( https://github.com/ijl/orjson#float )
64
- 5 . [ int] ( https://github.com/ijl/orjson#int )
65
- 6 . [ numpy] ( https://github.com/ijl/orjson#numpy )
66
- 7 . [ str] ( https://github.com/ijl/orjson#str )
67
- 8 . [ uuid] ( https://github.com/ijl/orjson#uuid )
68
- 3 . [ Testing] ( https://github.com/ijl/orjson#testing )
69
- 4 . [ Performance] ( https://github.com/ijl/orjson#performance )
70
- 1 . [ Latency] ( https://github.com/ijl/orjson#latency )
71
- 2 . [ Memory] ( https://github.com/ijl/orjson#memory )
72
- 3 . [ Reproducing] ( https://github.com/ijl/orjson#reproducing )
73
- 5 . [ Questions] ( https://github.com/ijl/orjson#questions )
74
- 6 . [ Packaging] ( https://github.com/ijl/orjson#packaging )
75
- 7 . [ License] ( https://github.com/ijl/orjson#license )
50
+ 1 . [ Usage] ( https://github.com/ijl/orjson?tab=readme-ov-file #usage )
51
+ 1 . [ Install] ( https://github.com/ijl/orjson?tab=readme-ov-file #install )
52
+ 2 . [ Quickstart] ( https://github.com/ijl/orjson?tab=readme-ov-file #quickstart )
53
+ 3 . [ Migrating] ( https://github.com/ijl/orjson?tab=readme-ov-file #migrating )
54
+ 4 . [ Serialize] ( https://github.com/ijl/orjson?tab=readme-ov-file #serialize )
55
+ 1 . [ default] ( https://github.com/ijl/orjson?tab=readme-ov-file #default )
56
+ 2 . [ option] ( https://github.com/ijl/orjson?tab=readme-ov-file #option )
57
+ 3 . [ Fragment] ( https://github.com/ijl/orjson?tab=readme-ov-file #fragment )
58
+ 5 . [ Deserialize] ( https://github.com/ijl/orjson?tab=readme-ov-file #deserialize )
59
+ 2 . [ Types] ( https://github.com/ijl/orjson?tab=readme-ov-file #types )
60
+ 1 . [ dataclass] ( https://github.com/ijl/orjson?tab=readme-ov-file #dataclass )
61
+ 2 . [ datetime] ( https://github.com/ijl/orjson?tab=readme-ov-file #datetime )
62
+ 3 . [ enum] ( https://github.com/ijl/orjson?tab=readme-ov-file #enum )
63
+ 4 . [ float] ( https://github.com/ijl/orjson?tab=readme-ov-file #float )
64
+ 5 . [ int] ( https://github.com/ijl/orjson?tab=readme-ov-file #int )
65
+ 6 . [ numpy] ( https://github.com/ijl/orjson?tab=readme-ov-file #numpy )
66
+ 7 . [ str] ( https://github.com/ijl/orjson?tab=readme-ov-file #str )
67
+ 8 . [ uuid] ( https://github.com/ijl/orjson?tab=readme-ov-file #uuid )
68
+ 3 . [ Testing] ( https://github.com/ijl/orjson?tab=readme-ov-file #testing )
69
+ 4 . [ Performance] ( https://github.com/ijl/orjson?tab=readme-ov-file #performance )
70
+ 1 . [ Latency] ( https://github.com/ijl/orjson?tab=readme-ov-file #latency )
71
+ 2 . [ Memory] ( https://github.com/ijl/orjson?tab=readme-ov-file #memory )
72
+ 3 . [ Reproducing] ( https://github.com/ijl/orjson?tab=readme-ov-file #reproducing )
73
+ 5 . [ Questions] ( https://github.com/ijl/orjson?tab=readme-ov-file #questions )
74
+ 6 . [ Packaging] ( https://github.com/ijl/orjson?tab=readme-ov-file #packaging )
75
+ 7 . [ License] ( https://github.com/ijl/orjson?tab=readme-ov-file #license )
76
76
77
77
## Usage
78
78
@@ -85,7 +85,7 @@ pip install --upgrade "pip>=20.3" # manylinux_x_y, universal2 wheel support
85
85
pip install --upgrade orjson
86
86
```
87
87
88
- To build a wheel, see [ packaging] ( https://github.com/ijl/orjson#packaging ) .
88
+ To build a wheel, see [ packaging] ( https://github.com/ijl/orjson?tab=readme-ov-file #packaging ) .
89
89
90
90
### Quickstart
91
91
@@ -155,7 +155,7 @@ The global interpreter lock (GIL) is held for the duration of the call.
155
155
It raises ` JSONEncodeError ` on an unsupported type. This exception message
156
156
describes the invalid object with the error message
157
157
` Type is not JSON serializable: ... ` . To fix this, specify
158
- [ default] ( https://github.com/ijl/orjson#default ) .
158
+ [ default] ( https://github.com/ijl/orjson?tab=readme-ov-file #default ) .
159
159
160
160
It raises ` JSONEncodeError ` on a ` str ` that contains invalid UTF-8.
161
161
@@ -496,18 +496,18 @@ OPT_NON_STR_KEYS.
496
496
497
497
This is deprecated and has no effect in version 3. In version 2 this was
498
498
required to serialize ` dataclasses.dataclass ` instances. For more, see
499
- [ dataclass] ( https://github.com/ijl/orjson#dataclass ) .
499
+ [ dataclass] ( https://github.com/ijl/orjson?tab=readme-ov-file #dataclass ) .
500
500
501
501
##### OPT_SERIALIZE_NUMPY
502
502
503
503
Serialize ` numpy.ndarray ` instances. For more, see
504
- [ numpy] ( https://github.com/ijl/orjson#numpy ) .
504
+ [ numpy] ( https://github.com/ijl/orjson?tab=readme-ov-file #numpy ) .
505
505
506
506
##### OPT_SERIALIZE_UUID
507
507
508
508
This is deprecated and has no effect in version 3. In version 2 this was
509
509
required to serialize ` uuid.UUID ` instances. For more, see
510
- [ UUID] ( https://github.com/ijl/orjson#UUID ) .
510
+ [ UUID] ( https://github.com/ijl/orjson?tab=readme-ov-file #UUID ) .
511
511
512
512
##### OPT_SORT_KEYS
513
513
@@ -554,7 +554,7 @@ simplejson, and ujson.
554
554
##### OPT_STRICT_INTEGER
555
555
556
556
Enforce 53-bit limit on integers. The limit is otherwise 64 bits, the same as
557
- the Python standard library. For more, see [ int] ( https://github.com/ijl/orjson#int ) .
557
+ the Python standard library. For more, see [ int] ( https://github.com/ijl/orjson?tab=readme-ov-file #int ) .
558
558
559
559
##### OPT_UTC_Z
560
560
@@ -1205,11 +1205,11 @@ It benefits from also having a C build environment to compile a faster
1205
1205
deserialization backend. See this project's ` manylinux_2_28 ` builds for an
1206
1206
example using clang and LTO.
1207
1207
1208
- The project's own CI tests against ` nightly-2024-06-10 ` and stable 1.72. It
1208
+ The project's own CI tests against ` nightly-2024-07-02 ` and stable 1.72. It
1209
1209
is prudent to pin the nightly version because that channel can introduce
1210
1210
breaking changes.
1211
1211
1212
- orjson is tested for amd64, aarch64, ppc64le, and s390x on Linux. It
1212
+ orjson is tested for amd64, aarch64, arm7, ppc64le, and s390x on Linux. It
1213
1213
is tested for either aarch64 or amd64 on macOS and cross-compiles for the other,
1214
1214
depending on version. For Windows it is tested on amd64 and i686.
1215
1215
0 commit comments