Registry / serialization / msgspec-m

msgspec-m

JSON →
library0.19.3pypypi✓ verified 85d ago

A fast serialization and validation library with builtin support for JSON, MessagePack, YAML, and TOML. Currently at version 0.19.3. This is a community fork of the original msgspec library, providing Python 3.14 and free-threading support. Release cadence is irregular.

pip install msgspec-m
INSTALL
IMPORT
SIG · MSGSPEC-M
M
msgspec-m
serializationpythonv0.19.3
Install
1.6s avg
Import
58ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.19.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.060s · 18.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.056s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

msgspec
import msgspec
import msgspec_m as msgspec
Since version 0.19.2, the package name was reverted to 'msgspec'; no alias needed.
JSON
from msgspec import json
from msgspec_m import json
This fork uses the same module structure as the original msgspec.

Basic usage: define a struct and encode/decode JSON.

import msgspec # Define a struct (similar to dataclass) class Person(msgspec.Struct): name: str age: int # Encode to JSON person = Person(name="Alice", age=30) encoded = msgspec.json.encode(person) print(encoded) # b'{"name":"Alice","age":30}' # Decode from JSON decoded = msgspec.json.decode(encoded, type=Person) print(decoded) # Person(name='Alice', age=30)
Debug
Known issues
breakingVersion 0.19.1 required 'import msgspec_m as msgspec'. Version 0.19.2 reverted to 'import msgspec'. If you were using 0.19.1, you must change all imports back to 'import msgspec'.
fix
Change 'import msgspec_m as msgspec' to 'import msgspec' and update any usage of 'msgspec_m' module path to 'msgspec'.
affects: >=0.19.1, <0.19.2
gotchaThe package is named 'msgspec-m' on PyPI, but the import name is 'msgspec'. Ensure you install 'msgspec-m' but import as 'import msgspec'.
fix
Run 'pip install msgspec-m' and in code use 'import msgspec'.
affects: all
deprecatedUsing 'import msgspec_m' directly is deprecated since version 0.19.2 and will likely be removed in a future release.
fix
Use 'import msgspec' instead.
affects: >=0.19.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'msgspec'
You installed the original 'msgspec' package via pip, but it may be outdated or you need this fork. The fork is installed as 'msgspec-m'.
fix
Install this fork: pip install msgspec-m
ModuleNotFoundError: No module named 'msgspec_m'
You are trying to import 'msgspec_m', but since version 0.19.2 the import name is 'msgspec'.
fix
Change your import to: import msgspec
AttributeError: module 'msgspec' has no attribute 'Struct'
You may have accidentally installed the original 'msgspec' package instead of 'msgspec-m', or the version is too old. The original msgspec may not include Struct.
fix
Uninstall both: pip uninstall msgspec msgspec-m, then reinstall: pip install msgspec-m
Upgrade
Version history
0.19.3latest on PyPI · released Nov 14, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
msgspec-m — pip install msgspec-m · libregistry