Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
marshmallow 3.26.1 documentation
Light Logo Dark Logo
  • Home

Usage guide

  • Installation
  • Quickstart
  • Nesting schemas
  • Custom fields
  • Extending schemas
    • Pre-processing and post-processing methods
    • Schema-level validation
    • Using original input data
    • Overriding how attributes are accessed
    • Custom error handling
    • Custom class Meta options
    • Using context
    • Custom error messages
  • Examples
    • Validating package.json
    • Quotes API (Flask + SQLAlchemy)
    • Inflection (camel-cased keys)

API reference

  • Top-level API
  • Schema
  • Fields
  • Decorators
  • Validators
  • Utility functions
  • Exceptions
  • Private API
    • Types
    • Class registry
    • Error store

Project info

  • Why marshmallow?
  • Changelog
  • Upgrading to newer releases
  • Who’s using marshmallow?
  • License
  • Authors
  • Contributing guidelines
  • Code of Conduct
  • Kudos
  • Donate

Useful links

  • marshmallow @ PyPI
  • marshmallow @ GitHub
  • Issue Tracker
  • Ecosystem
Back to top
View this page

Examples¶

The below examples demonstrate how to use marshmallow in various contexts. To run each example, you will need to have uv installed. The examples use PEP 723 inline metadata to declare the dependencies of each script. uv will install the dependencies automatically when running these scripts.

  • Validating package.json
  • Quotes API (Flask + SQLAlchemy)
  • Inflection (camel-cased keys)
Next
Validating package.json
Previous
Custom error messages
Copyright © Steven Loria and contributors
Made with Sphinx and @pradyunsg's Furo