A fast, correct JSON library for Python with native support for dataclasses, datetimes, and numpy.
orjson is a fast and correct JSON library for Python that provides significant performance improvements over the standard json module. It natively serializes and deserializes common Python types like dataclasses, datetime objects, UUIDs, and numpy arrays while maintaining strict compliance with JSON standards.
Python developers working with JSON in performance-sensitive applications, such as web APIs, data processing pipelines, or scientific computing, who need faster serialization and strict UTF-8/RFC 8259 compliance.
Developers choose orjson because it is the fastest JSON library for Python, offers native support for important data types without custom serializers, and is more correct than other libraries by rejecting invalid JSON inputs.
Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show serialization up to 10x faster and deserialization 2x faster than Python's standard json library, making it ideal for data-intensive applications.
Supports dataclasses, datetime objects, UUIDs, and numpy arrays natively without custom handlers, reducing boilerplate code and improving speed.
Enforces UTF-8 and RFC 8259 standards, rejecting invalid JSON that other libraries might accept, which ensures data correctness and security.
Returns bytes instead of strings and caches map keys, reducing memory overhead in large-scale serialization tasks.
Serialization always returns bytes, not strings, which can be inconvenient for interoperability with systems expecting string JSON and requires extra decoding steps.
Lacks direct functions for reading from or writing to JSON files, forcing developers to handle file I/O manually compared to the standard library's json.load()/json.dump().
Only supports CPython 3.10 and above, with no plans to support PyPy, embedded builds, or older Python versions, restricting deployment options.
Rejects invalid UTF-8 and non-compliant JSON outright, which can break workflows with malformed data that other libraries like json might silently handle.