How marshmallow-code/marshmallow works
marshmallow is a Python serialization library: application code defines schemas and uses them to dump objects to primitive data or load input into application-level objects, with validation and structured errors. Schema fields provide typed conversion, nesting, and field-level validation; schema hooks and schema validators support custom processing. The runtime also includes schema-class lookup and experimental context support. Relationships are based on the README workflow and the source index’s import references; unsampled implementation details are not assumed.
Main entry points: schema.py Schema runtime · fields.py Typed fields · exceptions.py Validation errors · class_registry.py Schema registry
Components 14
Schema API
- Schema runtime
src/marshmallow/schema.py
Conversion and Validation
- Typed fields
src/marshmallow/fields.py - Validators
src/marshmallow/validate.py
Runtime Support
- Error aggregation
src/marshmallow/error_store.py - Validation errors
src/marshmallow/exceptions.py - Schema registry
src/marshmallow/class_registry.py - Data utilities
src/marshmallow/utils.py - Ordered sets
src/marshmallow/orderedset.py - Missing values
src/marshmallow/constants.py
Extensions
- Processing hooks
src/marshmallow/decorators.py - Context manager
src/marshmallow/experimental/context.py
Other components
- Application code
- Primitive data
- Application objects
Connections 20
- Application code → Schema runtime: uses schema
README.rst - Schema runtime → Primitive data: dumps to
README.rst - Schema runtime → Application objects: loads to
README.rst - Schema runtime → Typed fields: uses fields
src/marshmallow/schema.py - Schema runtime → Processing hooks: runs hooks
src/marshmallow/schema.py - Schema runtime → Error aggregation: stores errors
src/marshmallow/schema.py - Schema runtime → Schema registry: looks up schemas
src/marshmallow/schema.py - Schema runtime → Validation errors: raises errors
src/marshmallow/schema.py - Schema runtime → Ordered sets: uses ordering
src/marshmallow/schema.py - Schema runtime → Data utilities: uses helpers
src/marshmallow/schema.py - Schema runtime → Missing values: uses constants
src/marshmallow/schema.py - Typed fields → Validators: runs validators
src/marshmallow/fields.py - Typed fields → Schema registry: resolves nested schemas
src/marshmallow/fields.py - Typed fields → Schema runtime: creates nested schemas
src/marshmallow/fields.py - Typed fields → Data utilities: uses helpers
src/marshmallow/fields.py - Typed fields → Validation errors: raises errors
src/marshmallow/fields.py - Validators → Validation errors: raises errors
src/marshmallow/validate.py - Error aggregation → Validation errors: uses error key
src/marshmallow/error_store.py - Schema registry → Validation errors: raises registry errors
src/marshmallow/class_registry.py - Context manager → Typed fields: supports field use
src/marshmallow/experimental/context.py