- Fix crash serializing when using musl libc.
- Make
python-dateutil
optional in tests. - Handle failure to load system timezones in tests.
- Fix
orjson.dumps()
invalid output on Windows.
- Improve performance.
orjson.dumps()
acceptsoption=None
perOptional[int]
type.
- Fix tests on 32-bit for
numpy.intp
andnumpy.uintp
.
- Build now depends on rustc 1.60 or later.
- Support building with maturin 0.13 or 0.14.
- Build maintenance for Python 3.11.
- Support serializing
numpy.int16
andnumpy.uint16
.
- Fix datetime regression tests for tzinfo 2022b.
- Improve performance.
- Revert
dict
iterator implementation introduced in 3.7.9.
- Fix serializing
dict
with deleted final item. This was introduced in 3.7.9.
- Improve performance of serializing.
- Improve performance of serializing pretty-printed (
orjson.OPT_INDENT_2
) to be much nearer to compact. - Improve performance of deserializing
str
input. - orjson now requires Rust 1.57 instead of 1.54 to build.
- Build makes best effort instead of requiring "--features".
- Build using maturin 0.13.
- Support Python 3.11.
- Handle unicode changes in CPython 3.12.
- Build PyPI macOS wheels on 10.15 instead of 12 for compatibility.
- Fix issue serializing dicts that had keys popped and replaced. This was introduced in 3.7.4.
- Improve performance.
- Fix deallocation of
orjson.JSONDecodeError
.
- Improve build.
- Publish aarch64 musllinux wheels.
- Improve deserialization performance.
- Type stubs for
orjson.JSONDecodeError
now inherit fromjson.JSONDecodeError
instead ofValueError
- Null-terminate the internal buffer of
orjson.dumps()
output.
- Improve deserialization performance significantly through the use of a new backend. PyPI wheels for manylinux_2_28 and macOS have it enabled. Packagers are advised to see the README.
- Improve serialization and deserialization performance.
- Fix serialization of
numpy.datetime64("NaT")
to raise on an unsupported type.
- Improve performance of deserializing almost-empty documents.
- Publish arm7l
manylinux_2_17
wheels to PyPI. - Publish amd4
musllinux_1_1
wheels to PyPI.
- Fix build requiring
python
onPATH
.
- Improve performance of serializing
datetime.datetime
usingtzinfo
that arezoneinfo.ZoneInfo
.
- Fix invalid indexing in line and column number reporting in
JSONDecodeError
. - Fix
orjson.OPT_STRICT_INTEGER
not raising an error on values exceeding a 64-bit integer maximum.
- Fix build on macOS aarch64 CPython 3.10.
- Fix build issue on 32-bit.
- Fix serialization of
dataclass
inheriting fromabc.ABC
and using__slots__
. - Decrement refcount for numpy
PyArrayInterface
. - Fix build on recent versions of Rust nightly.
- Fix build on aarch64 using the Rust stable channel.
orjson
now compiles on Rust stable 1.54.0 or above. Use of some SIMD usage is now disabled by default and packagers are advised to add--cargo-extra-args="--features=unstable-simd"
to thematurin build
command if they continue to use nightly.orjson
built with--features=unstable-simd
adds UTF-8 validation implementations that use AVX2 or SSE4.2.- Drop support for Python 3.6.
orjson
now includes apyi
type stubs file.- Publish manylinux_2_24 wheels instead of manylinux2014.
- Fix compilation on latest Rust nightly.
orjson.dumps()
serializesnumpy.datetime64
instances as RFC 3339 strings.
- Fix memory leak serializing
datetime.datetime
withtzinfo
. - Fix wrong error message when serializing an unsupported numpy type without default specified.
- Publish python3.10 and python3.9 manylinux_2_24 wheels.
orjson.JSONDecodeError
now haspos
,lineno
, andcolno
.- Fix build on recent versions of Rust nightly.
- Improve serialization and deserialization performance.
orjson.dumps()
serializes individualnumpy.bool_
objects.
- Publish
universal2
wheels for macOS supporting Apple Silicon (aarch64).
orjson.loads()
supports reading frommemoryview
objects.
datetime.datetime
anddatetime.date
zero pad years less than 1000 to four digits.- sdist pins maturin 0.9.0 to avoid breaks in later 0.9.x.
orjson.dumps()
when given a non-C contiguousnumpy.ndarray
has an error message suggesting to usedefault
.
- aarch64 manylinux2014 wheels are now compatible with glibc 2.17.
- Fix build warnings on ppcle64.
- Use vectorcall APIs for method calls on python3.9 and above.
- Publish python3.10 wheels for Linux on amd64 and aarch64.
- Fix compatibility with debug builds of CPython.
- Fix deserializing long strings on processors without AVX2.
orjson.dumps()
serializes integers up to a 64-bit unsigned integer's maximum. It was previously the maximum of a 64-bit signed integer.
- Fix regression in parsing similar
dict
keys.
- Improve deserialization performance.
- Publish Windows python3.9 wheel.
- Disable unsupported SIMD features on non-x86, non-ARM targets
- Fix
orjson.dumps.__module__
andorjson.loads.__module__
not being thestr
"orjson".
- Publish macos python3.9 wheel.
- More packaging documentation.
- Serialize
numpy.uint8
andnumpy.int8
instances.
- Fix serializing
numpy.empty()
instances.
- No longer publish
manylinux1
wheels due to tooling dropping support.
- Fix failure to deserialize some latin1 strings on some platforms. This was introduced in 3.2.0.
- Fix annotation of optional parameters on
orjson.dumps()
forhelp()
.
- Publish
manylinux2014
wheels for amd64 in addition tomanylinux1
.
orjson.dumps()
now serializes individual numpy floats and integers, e.g.,numpy.float64(1.0)
.orjson.OPT_PASSTHROUGH_DATACLASS
causesorjson.dumps()
to passdataclasses.dataclass
instances todefault
.
- Fix serializing
dataclasses.dataclass
that have no attributes.
- Improve deserialization performance of
str
.
- Fix
orjson.dumps(..., **{})
raisingTypeError
on python3.6.
orjson.OPT_APPEND_NEWLINE
appends a newline to output.
- Improve deserialization performance of
str
.
- Fix serializing zero-dimension
numpy.ndarray
.
- Fix repeated serialization of
str
that are ASCII-only and have a legacy (non-compact) layout.
orjson.OPT_PASSTHROUGH_SUBCLASS
causesorjson.dumps()
to pass subclasses of builtin types todefault
so the caller can customize the output.orjson.OPT_PASSTHROUGH_DATETIME
causesorjson.dumps()
to passdatetime
objects todefault
so the caller can customize the output.
orjson.dumps()
does not serializedataclasses.dataclass
attributes that begin with a leading underscore, e.g.,_attr
. This is because of the Python idiom that a leading underscores marks an attribute as "private."orjson.dumps()
does not serializedataclasses.dataclass
attributes that areInitVar
orClassVar
whether using__slots__
or not.
orjson.dumps()
raises an exception if the object to be serialized is not given as a positional argument.orjson.dumps({})
is intended and ok whileorjson.dumps(obj={})
is an error. This makes it consistent with the documentation,help()
annotation, and type annotation.- Fix orphan reference in exception creation that leaks memory until the garbage collector runs.
- Improve serialization performance marginally by using the fastcall/vectorcall calling convention on python3.7 and above.
- Reduce build time.
orjson.dumps()
serializes subclasses ofstr
,int
,list
, anddict
.
orjson.dumps()
serializesdataclasses.dataclass
anduuid.UUID
instances by default. The optionsOPT_SERIALIZE_DATACLASS
andOPT_SERIALIZE_UUID
can still be specified but have no effect.
- The source distribution vendors a forked dependency.
- Fix integer overflows in debug builds.
- The source distribution sets the recommended RUSTFLAGS in
.cargo/config
.
- Import
numpy
only on first use ofOPT_SERIALIZE_NUMPY
to reduce interpreter start time when not used. - Reduce build time by half.
- Fix deserialization raising
JSONDecodeError
on some valid negative floats with large exponents.
- Improve deserialization performance of floats by about 40%.
- Serialize
enum.Enum
objects. - Minor performance improvements.
- Publish python3.9
manylinux2014
wheel instead ofmanylinux1
forx86_64
. - Publish python3.9
manylinux2014
wheel foraarch64
.
- Fix compilation failure on 32-bit.
- Serialization is 10-20% faster and uses about 50% less memory by writing
directly to the returned
bytes
object.
orjson.dumps()
pretty prints with an indentation of two spaces ifoption=orjson.OPT_INDENT_2
is specified.
- Publish
manylinux2014
wheels foraarch64
. - numpy support now includes
numpy.uint32
andnumpy.uint64
.
manylinux1
wheels for 3.6, 3.7, and 3.8 are now compliant with the spec by not depending on glibc 2.18.
orjson.dumps()
serializesdict
keys of type other thanstr
ifoption=orjson.OPT_NON_STR_KEYS
is specified.
orjson.dumps()
serializesnumpy.ndarray
instances ifoption=orjson.OPT_SERIALIZE_NUMPY
is specified.
- Fix
dataclasses.dataclass
attributes that aredict
to be effected byorjson.OPT_SORT_KEYS
.
orjson.dumps()
serializesdict
instances sorted by keys, equivalent tosort_keys
in other implementations, ifoption=orjson.OPT_SORT_KEYS
is specified.
dataclasses.dataclass
instances without__slots__
now serialize faster.
- Fix documentation on
default
, in particular documenting the need to raise an exception if the type cannot be handled.
- Performance improvements to serializing a list containing elements of the same type.
orjson.loads()
rejects floats that do not have a digit following the decimal, e.g.,-2.
,2.e-3
.
- Build Linux, macOS, and Windows wheels on more recent distributions.
orjson.dumps()
serializesuuid.UUID
instances ifoption=orjson.OPT_SERIALIZE_UUID
is specified.
- Minor performance improvements.
- Publish Python 3.9 wheel for Linux.
- Specify a text signature for
orjson.loads()
.
- Improve documentation.
- Publish Python 3.8 wheels for macOS and Windows.
- The recursion limit of
default
onorjson.dumps()
has been increased from 5 to 254.
- Publish
manylinux1
wheels instead ofmanylinux2010
.
orjson.dumps()
serializesdataclasses.dataclass
instances ifoption=orjson.OPT_SERIALIZE_DATACLASS
is specified.orjson.dumps()
acceptsorjson.OPT_UTC_Z
to serialize UTC as "Z" instead of "+00:00".orjson.dumps()
acceptsorjson.OPT_OMIT_MICROSECONDS
to not serialize themicroseconds
attribute ofdatetime.datetime
anddatetime.time
instances.orjson.loads()
acceptsbytearray
.
- Drop support for Python 3.5.
- Publish
manylinux2010
wheels instead ofmanylinux1
.
- Publish Python 3.8 wheel for Linux.
- Performance improvements and lower memory usage in deserialization
by creating only one
str
object for repeated map keys.
- Minor performance improvements.
- Fix inaccurate zero padding in serialization of microseconds on
datetime.time
objects.
- Fix inaccurate zero padding in serialization of microseconds on
datetime.datetime
objects.
- Publish PEP 517 source distribution.
orjson.dumps()
raisesJSONEncodeError
on circular references.
- Performance improvements.
- Fix inaccuracy in deserializing some
float
values, e.g., 31.245270191439438 was parsed to 31.24527019143944. Serialization was unaffected.
orjson.dumps()
now serializesdatetime.datetime
objects without atzinfo
rather than raisingJSONEncodeError
.
orjson.loads()
uses SSE2 to validatebytes
input.
- Support Python 3.5.
- Publish Windows wheel.
orjson.dumps()
accepts adefault
callable to serialize arbitrary types.orjson.dumps()
acceptsdatetime.datetime
,datetime.date
, anddatetime.time
. Each is serialized to an RFC 3339 string.orjson.dumps(..., option=orjson.OPT_NAIVE_UTC)
allows serializingdatetime.datetime
objects that do not have a timezone set as UTC.orjson.dumps(..., option=orjson.OPT_STRICT_INTEGER)
available to raise an error on integer values outside the 53-bit range of all JSON implementations.
orjson.dumps()
no longer acceptsbytes
.
- Handle invalid UTF-8 in str.
- Performance improvements of 15-25% on serialization, 10% on deserialization.
- Fix memory leak in deserializing dict.
- Performance improvements.
- Performance improvements.
- Dict key can only be str.
- pyo3 bugfix update.
orjson.dumps()
function.orjson.loads()
function.