
msgspec
Fast serialization and validation library for Python, with built-in JSON, MessagePack, YAML and TOML support.
msgspec is a Python library that encodes and decodes JSON, MessagePack, YAML and TOML, and validates messages against schemas written as Python type annotations while decoding. It has no required dependencies. The project’s homepage lists projects that use it, including Litestar and Sanic.
Worth knowing
The TOML and YAML protocols need optional extras that the install page names: tomli and tomli_w for TOML, and PyYAML for YAML. The docs include a porting guide from orjson.
Identity
Rendering and deploy
- Install with
- pip install msgspec, conda install msgspec -c conda-forge6
Releases
Adoption
Sources
- 2026-11-16: links
msgspec.dev/ - 2026-11-16: links, Written in, License, GitHub stars
api.github.com/repos/msgspec/msgspec - 2026-11-16: Maintainer
github.com/msgspec/msgspec/blob/main/LICENSE - 2026-11-16: First release, Current major version
api.github.com/repos/msgspec/msgspec/releases?per_page=100 - 2026-11-16: Categories, License model
github.com/msgspec/msgspec/blob/main/README.md - 2026-11-16: Runtime, Minimum runtime, Install with
msgspec.dev/install.html - 2026-11-16: Last release
api.github.com/repos/msgspec/msgspec/releases/latest - 2026-11-16: Contributors
api.github.com/repos/msgspec/msgspec/contributors?per_page=1 - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/pypi.org/packages/msgspec