{"categories":[{"label":"Application Frameworks","url":"https://skillfed.io/packages/category/software-development-libraries-application-frameworks"}],"enrichment":{"capability":"Extends marshmallow to handle polymorphic serialization and deserialization by routing objects to type-specific schemas based on object type.","skillfed_tags":["serialization","polymorphism","data-validation"],"use_cases":["Serialize and deserialize REST API responses containing multiple object types under a single endpoint.","Handle database records of different entity types (e.g., User, Admin, Guest) with a single schema interface.","Build event systems where events can be of different types but need uniform serialization.","Implement discriminated union types in data pipelines that process heterogeneous object streams.","Validate and transform polymorphic data structures in configuration or data migration tools."],"what_it_does":"marshmallow-oneofschema is a plugin for the marshmallow serialization library that adds support for polymorphic schemas\u2014schemas that can serialize and deserialize objects of different types by routing each object to the appropriate type-specific schema. When serializing, it inspects the object type, looks up the corresponding schema from a type-to-schema mapping, and adds a discriminator field (by default named 'type') to the output. Deserialization reverses this: it reads the discriminator field to determine which schema to use for reconstructing the object.\n\nThe library is designed to integrate seamlessly with marshmallow's existing API, allowing OneOfSchema instances to be nested within other schemas and used anywhere a standard marshmallow schema would work. It requires only marshmallow as a runtime dependency and supports Python 3.9 and later. The project is actively maintained, has no known security vulnerabilities, and is widely used in the Python ecosystem.","worth_installing":"Yes. The package solves a genuine gap in marshmallow's core functionality (polymorphic schema support), has low install friction, active maintenance, no security issues, and permissive licensing. Install it if you need to serialize or deserialize multiple object types through a single schema interface."},"id":"marshmallow-oneofschema","links":{"html":"https://skillfed.io/packages/marshmallow-oneofschema","md":"https://skillfed.io/packages/marshmallow-oneofschema.md","pypi":"https://pypi.org/project/marshmallow-oneofschema/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-05-08","license_spdx":null,"license_treatment":"permissive","name":"marshmallow-oneofschema","python_support":"supports_current","summary":"marshmallow multiplexing schema"},"popularity":{"monthly_downloads":6637373,"position":1877,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.2.0"}
