$npx skillfedfor your agent

marshmallow-union

Union fields for marshmallow.

With conditionsPyPI UtilitiesReleased Jun 20201.2M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — marshmallow_union-0.1.15.post1-py2.py3-none-any.whl
v0.1.15.post1 · released 2020-06-24 · 1 runtime deps: marshmallow

Yes, if you are already using marshmallow and need union field support with low friction. The package is stable and permissively licensed, but be aware that it has not been actively maintained since 2020 and relies on field-order heuristics rather than strict type matching—test your specific use case carefully, especially if field order could cause unexpected coercion.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with a single runtime dependency on marshmallow.
  • Maintenance is aging—last release was 2020-06-24 and the repository shows no recent commits, though it remains unarchived and has received no security vulnerabilities.

License · maintenance · safety

permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, making it safe for both open-source and commercial projects.

last release 2020-06-24 (2242 days) · last repo commit 2025-12-22 · 19 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,182,494 downloads/mo, #4,254 on PyPI

Verify before relying

pip install marshmallow-union

from marshmallow import Schema, fields
from marshmallow_union import Union

class MySchema(Schema):
    value = Union([fields.Integer(), fields.String()])

schema = MySchema()
result = schema.load({'value': 'example'})
  • Whether the package works reliably with recent marshmallow versions (last tested in 2020)
  • Current Python version support beyond the 3.6 and 3.7 classifiers listed
  • Whether field ordering in the union list significantly impacts real-world performance
Same gist for agents: .md · .json

What it is and what it does

marshmallow-union extends marshmallow's schema validation by providing a Union field that can accept multiple field types. Instead of defining a schema field as strictly one type, you pass a list of candidate fields, and the union tries each one in order during deserialization and serialization, using the first field that succeeds without raising an error.

The library is straightforward but has a documented caveat: because it relies on trial-and-error field matching rather than type inspection, field order matters and unexpected type coercion can occur. The documentation notes that an Integer field accepting string representations will deserialize string inputs as integers. The package suggests marshmallow-polyfield as an alternative if you need stricter type control.

Use it for

  • Accept API payloads where a field may be either an integer ID or a full object representation
  • Handle legacy data where a field type changed over time but both formats must be supported
  • Deserialize configuration files with flexible value types across multiple formats
  • Build schemas that tolerate multiple input formats without explicit type conversion logic
  • Serialize polymorphic data structures where the same logical field holds different types

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 and need union field support with low friction.

The package is stable and permissively licensed, but be aware that it has not been actively maintained since 2020 and relies on field-order heuristics rather than strict type matching—test your specific use case carefully, especially if field order could cause unexpected coercion.

Install

marshmallow-union on PyPI

Before you install

Low install friction with a single runtime dependency on marshmallow. Maintenance is aging—last release was 2020-06-24 and the repository shows no recent commits, though it remains unarchived and has received no security vulnerabilities.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, making it safe for both open-source and commercial projects.

Quickstart

pip install marshmallow-union

from marshmallow import Schema, fields
from marshmallow_union import Union

class MySchema(Schema):
    value = Union([fields.Integer(), fields.String()])

schema = MySchema()
result = schema.load({'value': 'example'})

Verify before relying

  • Whether the package works reliably with recent marshmallow versions (last tested in 2020)
  • Current Python version support beyond the 3.6 and 3.7 classifiers listed
  • Whether field ordering in the union list significantly impacts real-world performance

Package facts

Licensepermissive license permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
marshmallow
MaintenanceAging 2,242 days since the last release
Last repo commit
First released
Downloads1,182,494 / month, #4,254 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Utilities

Evidence: marshmallow_union-0.1.15.post1-py2.py3-none-any.whl

Tags

Capabilities
marshmallow union fieldspolymorphic serialization marshmallowmultiple field types marshmallowunion type validationmarshmallow flexible fieldsdeserialize multiple typesmarshmallow schema unions
Topics
marshmallow-pluginschema-validation

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 › “marshmallow union fields”

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

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also marshmallow-polyfield · marshmallow-enum · flask-marshmallow · marshmallow-mongoengine · marshmallow · marshmallow-oneofschema · marshmallow-fastoneofschema · DeepFriedMarshmallow · amundsen-common · djangorestframework-queryfields