marshmallow-fastoneofschema
fast marshmallow multiplexing schema
Decision gist · record as of 2026-08-14
Yes, if you need polymorphic schema support in marshmallow and want a drop-in replacement for marshmallow-oneofschema. The low install friction, permissive license, and zero known vulnerabilities make it a straightforward choice. However, the aging maintenance status (no updates since initial release on 2025-09-02) and very low repository stars (1) suggest limited community adoption and testing; evaluate whether the performance claims and stability are suitable for your use case before committing to production.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- If marshmallow-oneofschema is installed alongside this package, set FASTONEOFSCHEMA_DISABLE_PTH=1 to avoid import redirection.
- Low install friction with a single runtime dependency on marshmallow.
License · maintenance · safety
permissive license (permissive) — MIT licensed with permissive terms. You can use, modify, and distribute the package freely with minimal restrictions, provided you retain the copyright notice and license text.
last release 2025-09-02 (346 days) · last repo commit 2025-09-02 · 1 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 194,570 downloads/mo, #9,831 on PyPI
Alternatives
Verify before relying
pip install marshmallow-fastoneofschema
from marshmallow_fastoneofschema import OneOfSchema
import marshmallow
class MyUberSchema(OneOfSchema):
type_schemas = {"Foo": FooSchema, "Bar": BarSchema}
MyUberSchema().dump([Foo(foo="hello"), Bar(bar=123)], many=True)- Whether the performance improvements over the upstream marshmallow-oneofschema are measurable in typical workloads.
- Stability and maturity of the DeepFriedMarshmallow plugin integration for production use.
- Real-world compatibility with complex nested schema hierarchies beyond the documented examples.
What it is and what it does
marshmallow-fastoneofschema is a drop-in replacement for marshmallow-oneofschema that adds polymorphic schema support to marshmallow. It lets you define a single schema that can serialize and deserialize multiple object types by routing each object to the appropriate sub-schema based on its type. During serialization, it inspects the object type, selects the matching schema, and adds a discriminator field (by default named 'type') to the output. During deserialization, it reads the discriminator field to determine which schema to use for reconstruction.
The package is designed as a performance-optimized fork with aggressive instance caching and reduced overhead for batch operations. It includes a .pth hook that redirects imports of the original marshmallow-oneofschema to this fork, allowing it to work as a transparent replacement. It also ships a DeepFriedMarshmallow plugin for JIT inlining of nested OneOfSchema fields. Configuration is available via environment variables (FOO_DISABLE_AGGRESSIVE_MODE, FOO_CONTEXT_ISOLATION) and per-schema class attributes.
Use it for
- Serialize heterogeneous lists of objects (e.g., different event types) to JSON with automatic type tagging for deserialization.
- Build REST API responses that contain polymorphic data structures without manual type-checking logic.
- Deserialize incoming JSON payloads that include a type discriminator into the correct Python object instances.
- Replace an existing marshmallow-oneofschema installation with a performance-optimized version without code changes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need polymorphic schema support in marshmallow and want a drop-in replacement for marshmallow-oneofschema.
The low install friction, permissive license, and zero known vulnerabilities make it a straightforward choice. However, the aging maintenance status (no updates since initial release on 2025-09-02) and very low repository stars (1) suggest limited community adoption and testing; evaluate whether the performance claims and stability are suitable for your use case before committing to production.
Install
marshmallow-fastoneofschema on PyPI
Before you install
Low install friction with a single runtime dependency on marshmallow. Maintenance status is aging—the package was first released on 2025-09-02 with no updates since, though the repository remains active and unarchived.
Requires Python 3.11 or later. If marshmallow-oneofschema is installed alongside this package, set FASTONEOFSCHEMA_DISABLE_PTH=1 to avoid import redirection.
License in practice
MIT licensed with permissive terms. You can use, modify, and distribute the package freely with minimal restrictions, provided you retain the copyright notice and license text.
Quickstart
pip install marshmallow-fastoneofschema
from marshmallow_fastoneofschema import OneOfSchema
import marshmallow
class MyUberSchema(OneOfSchema):
type_schemas = {"Foo": FooSchema, "Bar": BarSchema}
MyUberSchema().dump([Foo(foo="hello"), Bar(bar=123)], many=True)
Verify before relying
- Whether the performance improvements over the upstream marshmallow-oneofschema are measurable in typical workloads.
- Stability and maturity of the DeepFriedMarshmallow plugin integration for production use.
- Real-world compatibility with complex nested schema hierarchies beyond the documented examples.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagemarshmallow |
| Maintenance | Aging 346 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 194,570 / month, #9,831 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13 |
Evidence: marshmallow_fastoneofschema-2025.9.2.1.dev7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “type-based schema multiplexing”
- marshmallow-fastoneofschemaExtends marshmallow to handle polymorphic schema (de)serialization by…
- marshmallow-oneofschemaExtends marshmallow to handle polymorphic serialization and…
- schematicsSchematics defines, validates, and transforms Python data structures…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also DeepFriedMarshmallow · marshmallow-oneofschema · apispec-oneofschema · marshmallow-polyfield · marshmallow-jsonschema · marshmallow-union · marshmallow-mongoengine · marshmallow · flask-marshmallow