everysk-orjson is a high-performance JSON library for Python, forked from orjson. It provides fast serialization and deserialization, with additional features for handling big integers and special floating-point values.
-
Big Integer Support
Parse large integers without loss of precision using theOPT_BIG_INTEGERoption.import orjson result = orjson.dumps(100000000000000000001, option=orjson.OPT_BIG_INTEGER) print(result) # b'100000000000000000001' result = orjson.loads(b'100000000000000000001', option=orjson.OPT_BIG_INTEGER) print(result) # 100000000000000000001
-
NaN as Null
ConvertNaNvalues tonullduring deserialization with theOPT_NAN_AS_NULLoption.import orjson result = orjson.loads('{"x": nan}', option=orjson.OPT_NAN_AS_NULL) print(result) # {'x': None}
pip install everysk-orjsoneverysk-orjson is a drop-in replacement for orjson. Simply import and use the additional options as needed.
Available to you under either the Apache 2 license or MIT license at your choice. See LICENSE-APACHE or LICENSE-MIT for details.