--- id: msgspec-m version: "0.19.3" license: BSD license_treatment: permissive maintenance: aging --- # msgspec-m — A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML. License: permissive · Maintenance: aging · Downloads: 74.8K/mo ## What it is and what it does msgspec-m is a community-maintained fork of msgspec packaged as a PyPI wheel for easier installation. It provides high-performance encoders and decoders for JSON, MessagePack, YAML, and TOML, combined with zero-cost schema validation using standard Python type annotations. The library includes a Struct type for representing structured data with performance characteristics significantly faster than dataclasses or attrs for common operations. The package is designed to handle the full serialization and validation workflow: you define schemas using type annotations, encode messages to one of the supported protocols, and decode them back with optional schema validation. It has no runtime dependencies and is intended as a drop-in replacement for slower serialization libraries when performance matters. However, the fork explicitly accepts only minimal maintenance and packaging updates, not new features. Use it for: - Replace slower JSON libraries in performance-critical applications that need fast encoding and decoding. - Validate incoming API payloads or configuration files against Python type schemas without separate validation overhead. - Serialize structured data to MessagePack, YAML, or TOML for interoperability with non-Python systems. - Use Struct types as lightweight, fast alternatives to dataclasses when defining message or data transfer objects. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. msgspec-m is a fast serialization and validation library supporting JSON, MessagePack, YAML, and TOML with zero-cost schema validation using Python type annotations. Yes, if you need fast serialization with schema validation and accept the trade-off of a community fork in maintenance mode. The package offers genuine performance gains and is well-suited for latency-sensitive services, data pipelines, and API layers. However, be aware that it receives only minimal maintenance and packaging updates—not new features—so evaluate whether upstream msgspec or the original fork better fits your long-term needs. ## Install pip install msgspec-m uv add msgspec-m poetry add msgspec-m ## Installing msgspec-m Before you install: Medium install friction due to compiled wheels; however, prebuilt binaries are available for common platforms (macOS, Linux, Windows) across Python 3.10–3.14. The package is aging (273 days since last release) and explicitly states it accepts only minimal maintenance and packaging updates, not new features. License in practice: BSD license (permissive) imposes no significant restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install msgspec-m import msgspec class User(msgspec.Struct): name: str email: str | None = None alice = User("alice", email="alice@example.com") msg = msgspec.json.encode(alice) decoded = msgspec.json.decode(msg, type=User) Requires Python 3.9 or later; compiled wheels are provided but source builds require a C compiler. Verify before relying: - Whether this fork receives timely security patches or bug fixes relative to the upstream jcrist/msgspec repository. - Whether the fork's wheel availability on PyPI is stable long-term or subject to maintenance gaps. ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: medium - Maintenance: aging - Downloads: 74.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fast JSON serialization Python, MessagePack encoder decoder, schema validation type annotations, YAML TOML serialization, high-performance serialization library, serialization, validation, performance [View on SkillFed](https://skillfed.io/packages/msgspec-m) · [View on PyPI](https://pypi.org/project/msgspec-m/)