Registry / serialization / deepfriedmarshmallow

deepfriedmarshmallow

JSON →
library1.1.2pypypi✓ verified 85d ago

A plug-and-play JIT compilation library for Marshmallow schemas that speeds up serialization and deserialization by generating optimized Python code. Current version is 1.1.2, compatible with Python >=3.11 and <4.0.0. The library is actively maintained with a plugin system and built-in inliners for common field types.

pip install deepfriedmarshmallow
INSTALL
IMPORT
SIG · DEEPFRIEDMARSHMALL
D
deepfriedmarshmallow
serializationpythonv1.1.2
Install
1.9s avg
Import
150ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0b2 · 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.154s · 19.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.146s · 20MB
17MB installed
● package 17MB
Code
Verified usage

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

jit
from deepfriedmarshmallow import jit
Decorator to JIT-compile a schema. Incorrect usage is importing from 'marshmallow' which doesn't exist.
JitSerializer
from deepfriedmarshmallow import JitSerializer
Class for manual JIT serialization.
JitDeserializer
from deepfriedmarshmallow import JitDeserializer
Class for manual JIT deserialization.

Create a Marshmallow schema, then create a subclass decorated with @jit to enable JIT compilation for faster load/dump.

from marshmallow import Schema, fields from deepfriedmarshmallow import jit class UserSchema(Schema): name = fields.String() age = fields.Integer() @jit class JitUserSchema(UserSchema): pass schema = JitUserSchema() data = {"name": "Alice", "age": 30} result = schema.load(data) print(result) # {'name': 'Alice', 'age': 30} result = schema.dump(result) print(result) # {'name': 'Alice', 'age': 30}
Debug
Known issues
breakingDeepFriedMarshmallow requires Python >=3.11. Using Python 3.10 or older will cause import errors.
fix
Upgrade Python to 3.11 or later.
affects: <=1.1.2
gotchaThe @jit decorator must be applied to a class that inherits from a Marshmallow Schema. Applying it to a standalone class or a non-Schema will not work.
fix
Ensure the decorated class is a subclass of marshmallow.Schema.
affects: all
gotchaThe plugin system via DFM_PLUGINS environment variable or entry points may conflict if multiple plugins define the same inliner. The library prefers inliners in a specific order; custom plugins may be overridden.
fix
Check plugin documentation and ensure unique inliner definitions.
affects: >=1.1.0
deprecatedIn version 1.0.0beta2, the API was unstable. The current stable API (1.1.x) uses the @jit decorator; the older API may have used different symbols.
fix
Upgrade to version 1.1.x and use @jit decorator.
affects: 1.0.0beta1 - 1.0.0beta2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'deepfriedmarshmallow'
Library not installed or installed in a different environment.
fix
Run 'pip install deepfriedmarshmallow'. Ensure you are using Python 3.11+.
TypeError: jit() missing 1 required positional argument: 'schema_class'
Used @jit on a function or incorrectly imported jit.
fix
Use @jit as a class decorator on a Schema subclass, not on a function. Example: @jit class MySchema(Schema): ...
AttributeError: 'NoneType' object has no attribute 'fields'
The @jit decorator was applied to a class that does not inherit from Schema, or the schema was not defined correctly.
fix
Ensure the decorated class inherits from marshmallow.Schema.
ValidationError: Unknown field.
When unknown=RAISE and the input contains a field not defined in the schema, the JIT deserializer may raise a ValidationError.
fix
Handle the exception or set unknown=RAISE explicitly in schema Meta.
Upgrade
Version history
1.1.2latest on PyPI · released Sep 3, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
deepfriedmarshmallow — pip install deepfriedmarshmallow · libregistry