DeepFriedMarshmallow
A plug-and-play JIT implementation for Marshmallow to speed up data serialization and deserialization
What it is and what it does
Deep-Fried Marshmallow is a JIT compiler layer for Marshmallow that generates optimized serialization and deserialization code at runtime. Instead of relying on Marshmallow's reflection-heavy approach, it introspects your schema once and produces fast, specialized code paths for dump and load operations. The package is a maintained fork of the abandoned Toasted Marshmallow project, updated to work with modern Marshmallow versions (3.13+) without requiring modifications to Marshmallow itself.
You enable it by either inheriting from JitSchema instead of Schema, calling deep_fry_marshmallow() globally to patch all schemas, or using the JitSchemaMixin for custom base classes. It also supports a plugin system for custom field inliners and JIT behaviors. The generated code optimistically assumes valid input and falls back to standard Marshmallow behavior on errors, so it's designed to be a drop-in replacement with no API changes.
Use it for:
- High-throughput REST APIs where serializing thousands of objects per second matters for latency and throughput.
- Data pipelines that repeatedly dump and load the same schema structures, where JIT compilation amortizes well.
- Microservices with strict latency budgets that need faster JSON serialization without rewriting validation logic.
- Replacing Toasted Marshmallow in existing projects that need ongoing maintenance and compatibility with recent Marshmallow releases.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Accelerates Marshmallow schema serialization and deserialization by generating optimized code at runtime, achieving 3-5x speedup over vanilla Marshmallow without changing the API.
Yes, with conditions. Install if you have a Marshmallow-based codebase where serialization is a measured bottleneck and you can test the speedup on your actual schemas. The low install friction and permissive license make adoption easy. However, the aging maintenance status (10 stars, last commit 2025-09-03) and modest adoption signal mean you should verify compatibility with your Marshmallow version and monitor the project for future updates before relying on it in production.
Install
deepfriedmarshmallow on PyPI
pip
pip install deepfriedmarshmallowuv
uv add deepfriedmarshmallowpoetry
poetry add deepfriedmarshmallowInstalling DeepFriedMarshmallow
Before you install
Low install friction with three lightweight runtime dependencies (attrs, marshmallow, six). Maintenance status is aging—last commit was 2025-09-03 and the project has 10 stars, so adoption is modest and forward momentum unclear.
License in practice
Licensed under Apache-2.0 (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations.
Quickstart
pip install DeepFriedMarshmallow
from marshmallow import fields
from deepfriedmarshmallow import JitSchema
class ArtistSchema(JitSchema):
name = fields.Str()
schema = ArtistSchema()
result = schema.dump({"name": "Artist Name"})
Requires Python 3.11 or later; Marshmallow version 3.13 or newer.
Verify before relying
- Whether the 3-5x speedup claim is reproducible across real-world schemas and workloads beyond the benchmark shown.
- Current stability and compatibility with Marshmallow versions released after the package's last update.
- Whether the plugin system is actively used or documented in production deployments.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0.0,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — attrs, marshmallow, six |
| Maintenance | aging — 345 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 195,561/month — #9,813 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: deepfriedmarshmallow-1.1.2-py3-none-any.whl
Keywords: serialization, rest, json, api, marshal, marshalling, deserialization, validation, schema
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
marshmallowMarshmallow converts complex Python objects to…
permissive · top 1,000 on PyPI
marshmallow-fastoneofschemaExtends marshmallow to handle polymorphic…
permissive · top 15,000 on PyPI
marshmallow-oneofschemaExtends marshmallow to handle polymorphic…
permissive · top 5,000 on PyPI
marshmallow-unionAdds union field support to marshmallow,…
permissive · top 5,000 on PyPI
marshmallow-jsonapiProduces JSON API 1.0-compliant output from…
permissive · top 15,000 on PyPI
marshmallow-mongoengineGenerates marshmallow schemas automatically…
permissive · top 15,000 on PyPI
marshmallow-polyfieldExtends Marshmallow with a PolyField class that…
permissive · top 15,000 on PyPI
marshmallow-enumProvides an Enum field type for Marshmallow…
permissive · top 5,000 on PyPI
marshmallow-jsonschemaConverts marshmallow schemas into JSON Schema…
permissive · top 5,000 on PyPI
flask-marshmallowFlask-Marshmallow integrates Flask and…
permissive · top 5,000 on PyPI