Registry /
serialization / marshmallow3-annotations
Install & Compatibility
Where this runs
tested against v1.1.0 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
annotation_schema
✓ from marshmallow3_annotations import annotation_schema
✗ from marshmallow3_annotations import annotation_schema
Decorate a dataclass with type annotations, then call annotation_schema to generate a marshmallow Schema.
from marshmallow import Schema, fields
from marshmallow3_annotations import annotation_schema
from dataclasses import dataclass
@dataclass
class User:
name: str
email: str
UserSchema = annotation_schema(User)
# Use UserSchema like any marshmallow Schema
schema = UserSchema()
result = schema.dump(User(name='John', email='john@example.com'))
print(result) # {'name': 'John', 'email': 'john@example.com'}
Upgrade
Version history
1.1.0latest on PyPI · released May 31, 2022
Audit
Dependencies
marshmallowrequiredCore dependency; generates marshmallow schemas
dataclassesoptionalUsed for defining annotated models