Back to directory

msgspec

A fast Python library for serializing and validating data as JSON, MessagePack, YAML, and TOML using standard type annotations.

msgspec

msgspec is a serialization and validation library for Python with built-in support for JSON, MessagePack, YAML, and TOML. It defines message schemas using ordinary Python type annotations and a Struct type, then encodes and decodes messages to and from those formats.

Decoding can validate input against the declared schema at the same time, catching type mismatches such as an integer where a string is expected. The project reports its JSON and MessagePack encoders and decoders as among the fastest available for Python, faster in combined encode-and-validate benchmarks than some libraries that only decode.

msgspec has no required dependencies and is distributed under the BSD license.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.