$npx skillfedfor your agent

marshmallow-polyfield

An unofficial extension to Marshmallow to allow for polymorphic fields

With conditionsPyPI Application FrameworksReleased Oct 2022174.9K downloads / moApache 2.0Source build

Decision gist · record as of 2026-08-14

sdist only — marshmallow-polyfield-5.11.tar.gz · builds from source
v5.11 · released 2022-10-26 · Python >=3.5

Yes, if you are already using Marshmallow 3.0+ and need polymorphic field support. The package is permissively licensed, has no external dependencies, and is stable for its intended use. However, it has been dormant since 2022-10-26 with no active maintenance—install only if you can tolerate potential incompatibilities with future Marshmallow releases.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Marshmallow 3.0 or above; requires Python >= 3.5.
  • You must define both serialization_schema_selector and deserialization_schema_selector functions.
  • High install friction; no runtime dependencies but the package has been dormant since 2022-10-26 (over 1388 days without release).

License · maintenance · safety

Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions. No license-based barriers to adoption.

last release 2022-10-26 (1388 days) · last repo commit 2024-07-01 · 59 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 174,935 downloads/mo, #10,275 on PyPI

Verify before relying

pip install marshmallow-polyfield

from marshmallow_polyfield import PolyField
from marshmallow import Schema

class MySchema(Schema):
    field = PolyField(
        serialization_schema_selector=my_serializer,
        deserialization_schema_selector=my_deserializer
    )
  • Whether the package works correctly with recent Marshmallow versions given the long maintenance gap.
  • Whether critical bugs would receive fixes under current maintenance status.
  • Compatibility with Python versions beyond 3.7 (classifiers only list up to 3.7).
Same gist for agents: .md · .json

What it is and what it does

Marshmallow-Polyfield is an unofficial extension to Marshmallow that adds support for polymorphic fields—fields that can hold objects of different types and serialize/deserialize them appropriately. Instead of defining a single schema for a field, you provide two selector functions: one that examines an object during serialization and returns the correct schema, and another that examines incoming data during deserialization and returns the correct schema. This allows you to handle heterogeneous data structures where a single field might contain different object types that each need their own serialization logic.

The package integrates with Marshmallow's standard field properties like `required`, `allow_none`, and `many`, so polymorphic fields behave like any other Marshmallow field in your schema. It targets Marshmallow 3.0 and above and supports Python >= 3.5. The package has no external runtime dependencies beyond Marshmallow itself.

Use it for

  • Serialize REST API responses where a single field holds different object types.
  • Build schemas for heterogeneous collections where each item's schema depends on its type.
  • Handle polymorphic data in JSON APIs where type discrimination is based on attributes.
  • Implement type-aware serialization in inheritance hierarchies with custom per-type handling.
  • Deserialize incoming data by inspecting its structure to determine which schema to apply.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are already using Marshmallow 3.0+ and need polymorphic field support.

The package is permissively licensed, has no external dependencies, and is stable for its intended use. However, it has been dormant since 2022-10-26 with no active maintenance—install only if you can tolerate potential incompatibilities with future Marshmallow releases.

Install

marshmallow-polyfield on PyPI

Before you install

High install friction; no runtime dependencies but the package has been dormant since 2022-10-26 (over 1388 days without release). Last commit was 2024-07-01. Suitable for projects already committed to Marshmallow 3.0+ that can tolerate lack of active maintenance.

Requires Marshmallow 3.0 or above; requires Python >= 3.5. You must define both serialization_schema_selector and deserialization_schema_selector functions.

License in practice

Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions. No license-based barriers to adoption.

Quickstart

pip install marshmallow-polyfield

from marshmallow_polyfield import PolyField
from marshmallow import Schema

class MySchema(Schema):
    field = PolyField(
        serialization_schema_selector=my_serializer,
        deserialization_schema_selector=my_deserializer
    )

Verify before relying

  • Whether the package works correctly with recent Marshmallow versions given the long maintenance gap.
  • Whether critical bugs would receive fixes under current maintenance status.
  • Compatibility with Python versions beyond 3.7 (classifiers only list up to 3.7).

Package facts

LicenseApache 2.0 permissive
Python supportSupports the current Python release >=3.5
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceDormant 1,388 days since the last release
Last repo commit
First released
Downloads174,935 / month, #10,275 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: marshmallow-polyfield-5.11.tar.gz

Tags

Capabilities
polymorphic serialization marshmallowmarshmallow polymorphic fieldspolymorphic type handlingschema selection by typemarshmallow extension polymorphismdynamic schema selectionpolymorphic deserialization
Topics
serializationpolymorphismmarshmallow-extension
PyPI keywords
serializationrestjsonapimarshalmarshallingdeserializationvalidationschema

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 › “polymorphic serialization marshmallow”

Give your agent the search over MCP, or paste the wish link into any chat.

More Application Frameworks packages

fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

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.

MITpure Python · 3.9+
456.2Mdownloads / mo
textual Worth it
PyPI · Application Frameworks · released Jun 2026

Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.

Install it if you're developing CLI tools, dashboards, or interactive terminal applications.

MITpure Python
443.6Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

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.

MITpure Python · 3.10+
369.3Mdownloads / mo
mcp Worth it
PyPI · Application Frameworks · released Jul 2026

Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.

Install it if you need to build or connect to servers.

MITpure Python · 3.10+
319.3Mdownloads / mo
Werkzeug Worth it
PyPI · Application Frameworks · released Apr 2026

Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.

BSD-3-Clausepure Python · 3.9+
268.1Mdownloads / mo

See also marshmallow-oneofschema · marshmallow-union · marshmallow-fastoneofschema · marshmallow · marshmallow-enum · apispec-oneofschema · marshmallow-mongoengine · flask-marshmallow · DeepFriedMarshmallow · marshmallow-jsonapi