Serialization in Python
6 projects in Database & Storage. Most starred: orjson, marshmallow and msgspec.
For JSON, orjson is a fast Rust-backed library that natively serializes dataclasses, datetimes and NumPy arrays; it returns bytes rather than str. msgspec handles JSON and MessagePack and validates against typed Struct classes as it decodes, which makes it a fast combined parser and validator. The msgpack package implements MessagePack, a compact binary format that is a good fit for caches and internal messages. marshmallow uses explicit schemas to convert objects to and from primitive types with validation, and is common in Flask projects.
Data Formats4
A lightweight library for converting complex objects to and from simple Python datatypes.
A fast serialization and validation library supporting JSON, MessagePack, YAML, and TOML.
Object Pickling2
Extends pickle to functions, lambdas, and interactively defined classes, for shipping code to remote workers.
Extends pickle to serialize almost any object, including closures and interpreter sessions.