Full Code of marshmallow-code/marshmallow for AI

dev 546be2f728fa cached
100 files
785.1 KB
194.6k tokens
1109 symbols
1 requests
Download .txt
Showing preview only (820K chars total). Download the full file or copy to clipboard to get everything.
Repository: marshmallow-code/marshmallow
Branch: dev
Commit: 546be2f728fa
Files: 100
Total size: 785.1 KB

Directory structure:
gitextract_t8h8nw0o/

├── .github/
│   ├── FUNDING.yml
│   ├── dependabot.yml
│   └── workflows/
│       └── build-release.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yml
├── AUTHORS.rst
├── CHANGELOG.rst
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.rst
├── LICENSE
├── NOTICE
├── README.rst
├── RELEASING.md
├── SECURITY.md
├── docs/
│   ├── .gitignore
│   ├── _static/
│   │   └── custom.css
│   ├── api_reference.rst
│   ├── authors.rst
│   ├── changelog.rst
│   ├── code_of_conduct.rst
│   ├── conf.py
│   ├── contributing.rst
│   ├── custom_fields.rst
│   ├── dashing.json
│   ├── donate.rst
│   ├── examples/
│   │   ├── index.rst
│   │   ├── inflection.rst
│   │   ├── quotes_api.rst
│   │   └── validating_package_json.rst
│   ├── extending/
│   │   ├── custom_error_handling.rst
│   │   ├── custom_error_messages.rst
│   │   ├── custom_options.rst
│   │   ├── index.rst
│   │   ├── overriding_attribute_access.rst
│   │   ├── pre_and_post_processing_methods.rst
│   │   ├── schema_validation.rst
│   │   └── using_original_input_data.rst
│   ├── index.rst
│   ├── install.rst
│   ├── kudos.rst
│   ├── license.rst
│   ├── marshmallow.class_registry.rst
│   ├── marshmallow.decorators.rst
│   ├── marshmallow.error_store.rst
│   ├── marshmallow.exceptions.rst
│   ├── marshmallow.experimental.context.rst
│   ├── marshmallow.fields.rst
│   ├── marshmallow.schema.rst
│   ├── marshmallow.types.rst
│   ├── marshmallow.utils.rst
│   ├── marshmallow.validate.rst
│   ├── nesting.rst
│   ├── quickstart.rst
│   ├── top_level.rst
│   ├── upgrading.rst
│   ├── whos_using.rst
│   └── why.rst
├── examples/
│   ├── flask_example.py
│   ├── inflection_example.py
│   ├── invalid_package.json
│   ├── package.json
│   └── package_json_example.py
├── performance/
│   └── benchmark.py
├── pyproject.toml
├── src/
│   └── marshmallow/
│       ├── __init__.py
│       ├── class_registry.py
│       ├── constants.py
│       ├── decorators.py
│       ├── error_store.py
│       ├── exceptions.py
│       ├── experimental/
│       │   ├── __init__.py
│       │   └── context.py
│       ├── fields.py
│       ├── orderedset.py
│       ├── py.typed
│       ├── schema.py
│       ├── types.py
│       ├── utils.py
│       └── validate.py
├── tests/
│   ├── __init__.py
│   ├── base.py
│   ├── conftest.py
│   ├── foo_serializer.py
│   ├── mypy_test_cases/
│   │   ├── test_class_registry.py
│   │   ├── test_schema.py
│   │   └── test_validation_error.py
│   ├── test_context.py
│   ├── test_decorators.py
│   ├── test_deserialization.py
│   ├── test_error_store.py
│   ├── test_exceptions.py
│   ├── test_fields.py
│   ├── test_options.py
│   ├── test_registry.py
│   ├── test_schema.py
│   ├── test_serialization.py
│   ├── test_utils.py
│   └── test_validate.py
└── tox.ini

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
open_collective: "marshmallow"
tidelift: "pypi/marshmallow"


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: pip
  directory: "/"
  schedule:
    interval: daily
  open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
  directory: "/"
  schedule:
    interval: "monthly"


================================================
FILE: .github/workflows/build-release.yml
================================================
name: build
on:
  push:
    branches: ["dev", "*.x-line"]
    tags: ["*"]
  pull_request:

jobs:
  docs:
    name: docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.14"
      - run: pip install tox
      - run: tox -e docs
  tests:
    name: ${{ matrix.name }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - { name: "3.10", python: "3.10", tox: py310 }
          - { name: "3.14", python: "3.14", tox: py314 }
          - { name: "mypy", python: "3.13", tox: mypy }
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python }}
          allow-prereleases: true
      - run: python -m pip install tox
      - run: python -m tox -e ${{ matrix.tox }}
  build:
    name: Build package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.14"
      - name: Install pypa/build
        run: python -m pip install build
      - name: Build a binary wheel and a source tarball
        run: python -m build
      - name: Install twine
        run: python -m pip install twine
      - name: Check build
        run: python -m twine check --strict dist/*
      - name: Store the distribution packages
        uses: actions/upload-artifact@v7
        with:
          name: python-package-distributions
          path: dist/
  # this duplicates pre-commit.ci, so only run it on tags
  # it guarantees that linting is passing prior to a release
  lint-pre-release:
    if: startsWith(github.ref, 'refs/tags')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.14"
      - run: python -m pip install tox
      - run: python -m tox -e lint
  publish-to-pypi:
    name: PyPI release
    if: startsWith(github.ref, 'refs/tags/')
    needs: [build, tests, lint-pre-release]
    runs-on: ubuntu-latest
    environment:
      name: pypi
      url: https://pypi.org/p/marshmallow
    permissions:
      id-token: write
    steps:
      - name: Download all the dists
        uses: actions/download-artifact@v8
        with:
          name: python-package-distributions
          path: dist/
      - name: Publish distribution to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1


================================================
FILE: .gitignore
================================================
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
pip-wheel-metadata

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
htmlcov
.tox
nosetests.xml
.cache
.pytest_cache

# Translations
*.mo

# Mr Developer
.mr.developer.cfg

# IDE
.project
.pydevproject
.idea

# Coverage
cover
.coveragerc

# Sphinx
docs/_build
README.html

*.ipynb
.ipynb_checkpoints

Vagrantfile
.vagrant

*.db
*.ai
.konchrc
_sandbox
pylintrc

# Virtualenvs
env
venv

# pyenv
.python-version

# pytest
.pytest_cache

# Other
.directory
*.pprof

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# ruff
.ruff_cache


================================================
FILE: .pre-commit-config.yaml
================================================
ci:
  autoupdate_schedule: monthly
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.15.4
  hooks:
    - id: ruff-check
    - id: ruff-format
- repo: https://github.com/python-jsonschema/check-jsonschema
  rev: 0.37.0
  hooks:
    - id: check-github-workflows
    - id: check-readthedocs
# TODO: Remove blacken-docs when https://github.com/astral-sh/ruff/issues/8237 is implemented
- repo: https://github.com/asottile/blacken-docs
  rev: 1.20.0
  hooks:
  - id: blacken-docs
    additional_dependencies: [black==25.1.0]


================================================
FILE: .readthedocs.yml
================================================
version: 2
sphinx:
  configuration: docs/conf.py
formats:
  - pdf
build:
  os: ubuntu-22.04
  tools:
    python: "3.13"
python:
  install:
    - method: pip
      path: .
      extra_requirements:
        - docs


================================================
FILE: AUTHORS.rst
================================================
*******
Authors
*******

Leads
=====

- Steven Loria `@sloria <https://github.com/sloria>`_
- Jérôme Lafréchoux  `@lafrech <https://github.com/lafrech>`_
- Jared Deckard `@deckar01 <https://github.com/deckar01>`_

Contributors (chronological)
============================

- Sebastian Vetter `@elbaschid <https://github.com/elbaschid>`_
- Eduard Carreras `@ecarreras <https://github.com/ecarreras>`_
- Joakim Ekberg `@kalasjocke <https://github.com/kalasjocke>`_
- Mark Grey `@DeaconDesperado <https://github.com/DeaconDesperado>`_
- Anders Steinlein `@asteinlein <https://github.com/asteinlein>`_
- Cyril Thomas `@Ketouem <https://github.com/Ketouem>`_
- Austin Macdonald `@asmacdo <https://github.com/asmacdo>`_
- Josh Carp `@jmcarp <https://github.com/jmcarp>`_
- `@amikholap <https://github.com/amikholap>`_
- Sven-Hendrik Haase `@svenstaro <https://github.com/svenstaro>`_
- Eric Wang `@ewang <https://github.com/ewang>`_
- `@philtay <https://github.com/philtay>`_
- `@malexer <https://github.com/malexer>`_
- Andriy Yurchuk `@Ch00k <https://github.com/Ch00k>`_
- Vesa Uimonen `@vesauimonen <https://github.com/vesauimonen>`_
- David Lord `@davidism <https://github.com/davidism>`_
- Daniel Castro `@0xDCA <https://github.com/0xDCA>`_
- Ben Jones `@RealSalmon <https://github.com/RealSalmon>`_
- Patrick Woods `@hakjoon <https://github.com/hakjoon>`_
- Lukas Heiniger `@3rdcycle <https://github.com/3rdcycle>`_
- Ryan Lowe `@ryanlowe0 <https://github.com/ryanlowe0>`_
- Jimmy Jia `@taion <https://github.com/taion>`_
- `@lustdante <https://github.com/lustdante>`_
- Sergey Aganezov, Jr. `@sergey-aganezov-jr <https://github.com/sergey-aganezov-jr>`_
- Kevin Stone `@kevinastone <https://github.com/kevinastone>`_
- Alex Morken `@alexmorken <https://github.com/alexmorken>`_
- Sergey Polzunov `@traut <https://github.com/traut>`_
- Kelvin Hammond `@kelvinhammond <https://github.com/kelvinhammond>`_
- Matt Stobo `@mwstobo <https://github.com/mwstobo>`_
- Max Orhai `@max-orhai <https://github.com/max-orhai>`_
- Praveen `@praveen-p <https://github.com/praveen-p>`_
- Stas Sușcov `@stas <https://github.com/stas>`_
- Florian `@floqqi <https://github.com/floqqi>`_
- Evgeny Sureev `@evgeny-sureev <https://github.com/evgeny-sureev>`_
- Matt Bachmann `@Bachmann1234 <https://github.com/Bachmann1234>`_
- Daniel Imhoff `@dwieeb <https://github.com/dwieeb>`_
- Juan Rossi `@juanrossi <https://github.com/juanrossi>`_
- Andrew Haigh `@nelfin <https://github.com/nelfin>`_
- `@Mise <https://github.com/Mise>`_
- Taylor Edmiston `@tedmiston <https://github.com/tedmiston>`_
- Francisco Demartino `@franciscod <https://github.com/franciscod>`_
- Eric Wang `@ewang <https://github.com/ewang>`_
- Eugene Prikazchikov `@eprikazc <https://github.com/eprikazc>`_
- Damian Heard `@DamianHeard <https://github.com/DamianHeard>`_
- Alec Reiter `@justanr <https://github.com/justanr>`_
- Dan Sutherland `@d-sutherland <https://github.com/d-sutherland>`_
- Jeff Widman `@jeffwidman <https://github.com/jeffwidman>`_
- Simeon Visser `@svisser <https://github.com/svisser>`_
- Taylan Develioglu `@tdevelioglu <https://github.com/tdevelioglu>`_
- Danilo Akamine `@daniloakamine <https://github.com/daniloakamine>`_
- Maxim Kulkin `@maximkulkin <https://github.com/maximkulkin>`_
- `@immerrr <https://github.com/immerrr>`_
- Mike Yumatov `@yumike <https://github.com/yumike>`_
- Tim Mundt `@Tim-Erwin <https://github.com/Tim-Erwin>`_
- Russell Davies `@russelldavies <https://github.com/russelldavies>`_
- Jared Deckard `@deckar01 <https://github.com/deckar01>`_
- David Thornton `@davidthornton <https://github.com/davidthornton>`_
- Vuong Hoang `@vuonghv <https://github.com/vuonghv>`_
- David Bertouille `@dbertouille <https://github.com/dbertouille>`_
- Alexandre Bonnetain `@Shir0kamii <https://github.com/Shir0kamii>`_
- Tuukka Mustonen `@tuukkamustonen <https://github.com/tuukkamustonen>`_
- Tero Vuotila `@tvuotila <https://github.com/tvuotila>`_
- Paul Zumbrun `@pauljz <https://github.com/pauljz>`_
- Gary Wilson Jr. `@gdub <https://github.com/gdub>`_
- Sabine Maennel `@sabinem <https://github.com/sabinem>`_
- Victor Varvaryuk `@mindojo-victor <https://github.com/mindojo-victor>`_
- Jāzeps Baško `@jbasko <https://github.com/jbasko>`_
- `@podhmo <https://github.com/podhmo>`_
- Dmitry Orlov `@mosquito <https://github.com/mosquito>`_
- Yuri Heupa `@YuriHeupa <https://github.com/YuriHeupa>`_
- Roy Williams `@rowillia <https://github.com/rowillia>`_
- Vlad Frolov `@frol <https://github.com/frol>`_
- Erling Børresen `@erlingbo <https://github.com/erlingbo>`_
- Jérôme Lafréchoux  `@lafrech <https://github.com/lafrech>`_
- Roy Williams `@rowillia <https://github.com/rowillia>`_
- `@dradetsky <https://github.com/dradetsky>`_
- Michal Kononenko `@MichalKononenko <https://github.com/MichalKononenko>`_
- Yoichi NAKAYAMA `@yoichi <https://github.com/yoichi>`_
- Bernhard M. Wiedemann `@bmwiedemann <https://github.com/bmwiedemann>`_
- Scott Werner `@scottwernervt <https://github.com/scottwernervt>`_
- Leonardo Fedalto `@Fedalto <https://github.com/Fedalto>`_
- `@sduthil <https://github.com/sduthil>`_
- Steven Sklar `@sklarsa <https://github.com/sklarsa>`_
- Alisson Silveira `@4lissonsilveira <https://github.com/4lissonsilveira>`_
- Harlov Nikita `@harlov <https://github.com/harlov>`_
- `@stj <https://github.com/stj>`_
- Tomasz Magulski `@magul <https://github.com/magul>`_
- Suren Khorenyan `@mahenzon <https://github.com/mahenzon>`_
- Jeffrey Berger `@JeffBerger <https://github.com/JeffBerger>`_
- Felix Yan `@felixonmars <https://github.com/felixonmars>`_
- Prasanjit Prakash `@ikilledthecat <https://github.com/ikilledthecat>`_
- Guillaume Gelin `@ramnes <https://github.com/ramnes>`_
- Maxim Novikov `@m-novikov <https://github.com/m-novikov>`_
- James Remeika `@remeika <https://github.com/remeika>`_
- Karandeep Singh Nagra `@knagra <https://github.com/knagra>`_
- Dushyant Rijhwani `@dushr <https://github.com/dushr>`_
- Viktor Kerkez `@alefnula <https://github.com/alefnula>`_
- Victor Gavro `@vgavro <https://github.com/vgavro>`_
- Kamil Gałuszka `@galuszkak <https://github.com/galuszkak>`_
- David Watson `@arbor-dwatson <https://github.com/arbor-dwatson>`_
- Jan Margeta `@jmargeta <https://github.com/jmargeta>`_
- AlexV `@asmodehn <https://github.com/asmodehn>`_
- `@toffan <https://github.com/toffan>`_
- Hampus Dunström `@Dunstrom <https://github.com/Dunstrom>`_
- Robert Jensen `@r1b <https://github.com/r1b>`_
- Arijit Basu `@sayanarijit <https://github.com/sayanarijit>`_
- Sanjay P `@snjypl <https://github.com/snjypl>`_
- Víctor Zabalza `@zblz <https://github.com/zblz>`_
- Riley Gibbs `@rileyjohngibbs <https://github.com/rileyjohngibbs>`_
- Henry Doupe `@hdoupe <https://github.com/hdoupe>`_
- `@miniscruff <https://github.com/miniscruff>`_
- `@maxalbert <https://github.com/maxalbert>`_
- Kim Gustyr `@khvn26 <https://github.com/khvn26>`_
- Bryce Drennan `@brycedrennan <https://github.com/brycedrennan>`_
- Tim Shaffer `@timster <https://github.com/timster>`_
- Hugo van Kemenade `@hugovk <https://github.com/hugovk>`_
- Maciej Urbański `@rooterkyberian <https://github.com/rooterkyberian>`_
- Kostas Konstantopoulos `@kdop <https://github.com/kdop>`_
- Stephen J. Fuhry `@fuhrysteve <https://github.com/fuhrysteve>`_
- `@dursk <https://github.com/dursk>`_
- Ezra MacDonald `@macdonaldezra <https://github.com/macdonaldezra>`_
- Stanislav Rogovskiy `@atmo <https://github.com/atmo>`_
- Cristi Scoarta `@cristi23 <https://github.com/cristi23>`_
- Anthony Sottile `@asottile <https://github.com/asottile>`_
- Charles-Axel Dein `@charlax <https://github.com/charlax>`_
- `@phrfpeixoto <https://github.com/phrfpeixoto>`_
- `@jceresini <https://github.com/jceresini>`_
- Nikolay Shebanov `@killthekitten <https://github.com/killthekitten>`_
- Taneli Hukkinen `@hukkinj1 <https://github.com/hukkinj1>`_
- `@Reskov <https://github.com/Reskov>`_
- Albert Tugushev `@atugushev <https://github.com/atugushev>`_
- `@dfirst <https://github.com/dfirst>`_
- Tim Gates `@timgates42 <https://github.com/timgates42>`_
- Nathan `@nbanmp <https://github.com/nbanmp>`_
- Ronan Murphy `@Resinderate <https://github.com/Resinderate>`_
- Laurie Opperman `@EpicWink <https://github.com/EpicWink>`_
- Ram Rachum `@cool-RR <https://github.com/cool-RR>`_
- `@weeix <https://github.com/weeix>`_
- Juan Norris `@juannorris <https://github.com/juannorris>`_
- 장준영 `@jun0jang <https://github.com/jun0jang>`_
- `@ebargtuo <https://github.com/ebargtuo>`_
- Michał Getka `@mgetka <https://github.com/mgetka>`_
- Nadège Michel `@nadege <https://github.com/nadege>`_
- Tamara `@infinityxxx <https://github.com/infinityxxx>`_
- Stephen Rosen `@sirosen <https://github.com/sirosen>`_
- Vladimir Mikhaylov `@vemikhaylov <https://github.com/vemikhaylov>`_
- Stephen Eaton `@madeinoz67 <https://github.com/madeinoz67>`_
- Antonio Lassandro `@lassandroan <https://github.com/lassandroan>`_
- Javier Fernández `@jfernandz <https://github.com/jfernandz>`_
- Michael Dimchuk  `@michaeldimchuk <https://github.com/michaeldimchuk>`_
- Jochen Kupperschmidt  `@homeworkprod <https://github.com/homeworkprod>`_
- `@yourun-proger <https://github.com/yourun-proger>`_
- Ryan Morehart `@traherom <https://github.com/traherom>`_
- Ben Windsor `@bwindsor <https://github.com/bwindsor>`_
- Kevin Kirsche `@kkirsche <https://github.com/kkirsche>`_
- Isira Seneviratne `@Isira-Seneviratne <https://github.com/Isira-Seneviratne>`_
- Karthikeyan Singaravelan `@tirkarthi  <https://github.com/tirkarthi>`_
- Marco Satti `@marcosatti  <https://github.com/marcosatti>`_
- Ivo Reumkens `@vanHoi <https://github.com/vanHoi>`_
- Aditya Tewary `@aditkumar72 <https://github.com/aditkumar72>`_
- Sebastien Lovergne `@TheBigRoomXXL <https://github.com/TheBigRoomXXL>`_
- Peter C `@somethingnew2-0 <https://github.com/somethingnew2-0>`_
- Marcel Jackwerth `@mrcljx` <https://github.com/mrcljx>`_
- Fares Abubaker `@Fares-Abubaker <https://github.com/Fares-Abubaker>`_
- Dharanikumar Sekar `@dharani7998 <https://github.com/dharani7998>`_
- Nicolas Simonds `@0xDEC0DE <https://github.com/0xDEC0DE>`_
- Florian Laport `@Florian-Laport <https://github.com/Florian-Laport>`_
- `@agentgodzilla <https://github.com/agentgodzilla>`_
- Xiao `@T90REAL <https://github.com/T90REAL>`_
- jfo `@jafournier <https://github.com/jafournier>`_
- thanhlecongg `@thanhlecongg <https://github.com/thanhlecongg>`_
- Emmanuel Ferdman  `@emmanuel-ferdman  <https://github.com/emmanuel-ferdman>`_


================================================
FILE: CHANGELOG.rst
================================================
Changelog
=========

4.2.2 (2026-02-04)
------------------

Bug fixes:

- Fix behavior of ``fields.Contant(None)`` (:issue:`2868`).
  Thanks :user:`T90REAL` for reporting and `emmanuel-ferdman` for the fix.


4.2.1 (2026-01-23)
------------------

Bug fixes:

- Fix validation of URLs beginning with uppercare `FILE` (:issue:`2891`).
  Thanks :user:`thanhlecongg` for reporting and fixing.

4.2.0 (2026-01-04)
------------------

Other changes:

- ``many`` argument of ``Nested`` properly overrides schema instance
  value (:pr:`2854`). Thanks :user:`jafournier` for the PR.

4.1.2 (2025-12-19)
------------------

Bug fixes:

- :cve:`2025-68480`: Merge error store messages without rebuilding collections.
  Thanks 카푸치노 for reporting and :user:`deckar01` for the fix.

4.1.1 (2025-11-05)
------------------

Bug fixes:

- Ensure ``URL`` validator is case-insensitive when using custom schemes (:pr:`2874`).
  Thanks :user:`T90REAL` for the PR.

4.1.0 (2025-11-01)
------------------

Other changes:

- Add `__len__` implementation to `missing` so that it can be used with
  `validate.Length <marshmallow.validate.Length>` (:pr:`2861`).
  Thanks :user:`agentgodzilla` for the PR.
- Drop support for Python 3.9 (:pr:`2363`).
- Test against Python 3.14 (:pr:`2864`).

4.0.1 (2025-08-28)
------------------

Bug fixes:

- Fix wildcard import of ``from marshmallow import *`` (:pr:`2823`).
  Thanks :user:`Florian-Laport` for the PR.


4.0.0 (2025-04-16)
------------------

See :ref:`upgrading_4_0` for a guide on updating your code.

Features:

- Typing: Add types to all `Field <marshmallow.fields.Field>` constructor kwargs (:issue:`2285`).
  Thanks :user:`navignaw` for the suggestion.
- `DateTime <marshmallow.fields.DateTime>`, `Date <marshmallow.fields.Date>`, `Time <marshmallow.fields.Time>`,
  `TimeDelta <marshmallow.fields.TimeDelta>`, and `Enum <marshmallow.fields.Enum>`
  accept their internal value types as valid input (:issue:`1415`).
  Thanks :user:`bitdancer` for the suggestion.
- `@validates <marshmallow.validates>` accepts multiple field names (:issue:`1960`).
  *Backwards-incompatible*: Decorated methods now receive ``data_key`` as a keyword argument.
  Thanks :user:`dpriskorn` for the suggestion and :user:`dharani7998` for the PR.

Other changes:

- Typing: `Field <marshmallow.fields.Field>` is now a generic type with a type argument for the internal value type.
- `marshmallow.fields.UUID` no longer subclasses `marshmallow.fields.String`.
- `marshmallow.Schema.load` no longer silently fails to call schema validators when a generator is passed (:issue:`1898`).
  The typing of `data` is also updated to be more accurate.
  Thanks :user:`ziplokk1` for reporting.
- *Backwards-incompatible*: Use `datetime.date.fromisoformat`, `datetime.time.fromisoformat`, and `datetime.datetime.fromisoformat` from the standard library to deserialize dates, times and datetimes (:pr:`2078`).
As a consequence of this change:
  - Time with time offsets are now supported.
  - YYYY-MM-DD is now accepted as a datetime and deserialized as naive 00:00 AM.
  - `from_iso_date`, `from_iso_time` and `from_iso_datetime` are removed from `marshmallow.utils`.
- Remove `isoformat`, `to_iso_time` and `to_iso_datetime` from `marshmallow.utils` (:pr:`2766`).
- Remove `from_rfc`, and `rfcformat` from `marshmallow.utils` (:pr:`2767`).
- Remove `is_keyed_tuple` from `marshmallow.utils` (:pr:`2768`).
- Remove `get_fixed_timezone` from `marshmallow.utils` (:pr:`2773`).

- *Backwards-incompatible*: `marshmallow.fields.Boolean` no longer serializes non-boolean values (:pr:`2725`).
- *Backwards-incompatible*: Rename ``schema`` parameter to ``parent`` in `marshmallow.fields.Field._bind_to_schema` (:issue:`1360`).
- *Backwards-incompatible*: Rename ``pass_many`` parameter to ``pass_collection`` in pre/post processing methods (:issue:`1369`).
- *Backwards-incompatible*: `marshmallow.fields.TimeDelta` no longer truncates float values when
  deserializing (:pr:`2654`). This allows microseconds to be preserved, e.g.

.. code-block:: python

    from marshmallow import fields

    field = fields.TimeDelta()

    # Before
    field.deserialize(12.9)
    datetime.timedelta(seconds=12)
    # datetime.timedelta(seconds=12)

    # After
    field.deserialize(12.9)
    # datetime.timedelta(seconds=12, microseconds=900000)

- Improve performance and minimize float precision loss of `marshmallow.fields.TimeDelta` serialization (:pr:`2654`).
- *Backwards-incompatible*: Remove ``serialization_type`` parameter from
  `marshmallow.fields.TimeDelta` (:pr:`2654`).

Thanks :user:`ddelange` for the PR.

- *Backwards-incompatible*: Remove `Schema <marshmallow.schema.Schema>`'s ``context`` attribute (deprecated since 3.24.0). Passing a context
  should be done using `contextvars.ContextVar` (:issue:`1826`).
  marshmallow 4 provides an experimental `Context <marshmallow.experimental.context.Context>`
  manager class that can be used to both set and retrieve context.

.. code-block:: python

    import typing

    from marshmallow import Schema, fields
    from marshmallow.experimental.context import Context


    class UserContext(typing.TypedDict):
        suffix: str


    class UserSchema(Schema):
        name_suffixed = fields.Function(
            lambda obj: obj["name"] + Context[UserContext].get()["suffix"]
        )


    with Context[UserContext]({"suffix": "bar"}):
        UserSchema().dump({"name": "foo"})
        # {'name_suffixed': 'foobar'}

- Methods decorated with `marshmallow.pre_load`, `marshmallow.post_load`, `marshmallow.validates_schema`,
  receive ``unknown`` as a keyword argument (:pr:`1632`).
  Thanks :user:`jforand` for the PR.
- *Backwards-incompatible*: Arguments to `decorators <marshmallow.decorators>` are keyword-only arguments.
- *Backwards-incompatible*: Rename ``json_data`` parameter of `marshmallow.Schema.loads` to ``s``
  for compatibility with most render module implementations (`json`, ``simplejson``, etc.) (:pr:`2764`).
  Also make it a positional-only argument.
- Incorrectly declaring a field using a field class rather than instance
  errors at class declaration time (previously happended when the schema was instantiated) (:pr:`2772`).
- Passing invalid values for ``unknown`` will cause an error in type checkers (:pr:`2771`).

Deprecations/Removals:

- *Backwards-incompatible*: Remove implicit field creation, i.e. using the ``fields`` or ``additional`` class Meta options with undeclared fields (:issue:`1356`).
- The `ordered` class Meta option is removed  (:issue:`2146`). Field order is already preserved by default.
  Set `Schema.dict_class` to `OrderedDict` to maintain the previous behavior.
- The `marshmallow.base` module is removed (:pr:`2722`).

Previously-deprecated APIs have been removed, including:

- The ``ordered`` `class Meta <marshmallow.Schema.Meta>` option is removed  (:issue:`2146`) (deprecated in 3.26.0).
- *Backwards-incompatible*: `marshmallow.fields.Number` is no longer usable as a field in a schema (deprecated in 3.24.0).
  Use `marshmallow.fields.Integer`, `marshmallow.fields.Float`, or `marshmallow.fields.Decimal` instead.
- *Backwards-incompatible*: `marshmallow.fields.Mapping` is no longer usable as a field in a schema (deprecated in 3.24.0).
- *Backwards-incompatible*: Custom validators must raise a `ValidationError <marshmallow.exceptions.ValidationError>` for invalid values (deprecated in 3.24.0).
  Returning `False` is no longer supported (:issue:`1775`).
  Use `marshmallow.fields.Dict` instead.
- Remove ``__version__``, ``__parsed_version__``, and ``__version_info__`` attributes (deprecated in 3.21.0).
- `default` and `missing` parameters, which were replaced by `dump_default` and `load_default` in 3.13.0 (:pr:`1742`, :pr:`2700`).
- Passing field metadata via keyword arguments (deprecated in 3.10.0). Use the explicit ``metadata=...``
  argument instead (:issue:`1350`).
- `marshmallow.utils.pprint` (deprecated in 3.7.0). Use `pprint.pprint` instead.
- Passing `"self"` to `fields.Nested` (deprecated in 3.3.0). Use a callable instead.
- ``Field.fail``, which was replaced by ``Field.make_error`` in 3.0.0.
- `json_module` class Meta option (deprecated in 3.0.0b3). Use `render_module` instead.

3.26.2 (2025-12-19)
-------------------

Bug fixes:

- :cve:`2025-68480`: Merge error store messages without rebuilding collections.
  Thanks 카푸치노 for reporting and :user:`deckar01` for the fix.

3.26.1 (2025-02-03)
-------------------

Bug fixes:

- Typing: Fix type annotations for `class Meta <marshmallow.Schema.Meta>` options (:issue:`2804`).
  Thanks :user:`lawrence-law` for reporting.

Other changes:

- Remove default value for the ``data`` param of `Nested._deserialize <marshmallow.fields.Nested._deserialize>` (:issue:`2802`).
  Thanks :user:`gbenson` for reporting.


3.26.0 (2025-01-22)
-------------------

Features:

- Typing: Add type annotations and improved documentation for `class Meta <marshmallow.Schema.Meta>` options (:pr:`2760`).
- Typing: Improve type coverage of `marshmallow.Schema.SchemaMeta` (:pr:`2761`).
- Typing: `marshmallow.Schema.loads` parameter allows `bytes` and `bytesarray` (:pr:`2769`).

Bug fixes:

- Respect ``data_key`` when schema validators raise a `ValidationError <marshmallow.exceptions.ValidationError>`
  with a ``field_name`` argument (:issue:`2170`). Thanks :user:`matejsp` for reporting.
- Correctly handle multiple `@post_load <marshmallow.post_load>` methods where one method appends to
  the data and another passes ``pass_original=True`` (:issue:`1755`).
  Thanks :user:`ghostwheel42` for reporting.
- ``URL`` fields now properly validate ``file`` paths (:issue:`2249`).
  Thanks :user:`0xDEC0DE` for reporting and fixing.

Documentation:

- Add :doc:`upgrading guides <upgrading>` for 3.24 and 3.26 (:pr:`2780`).
- Various documentation improvements (:pr:`2757`, :pr:`2759`, :pr:`2765`, :pr:`2774`, :pr:`2778`, :pr:`2783`, :pr:`2796`).

Deprecations:

- The ``ordered`` `class Meta <marshmallow.Schema.Meta>` option is deprecated (:issue:`2146`, :pr:`2762`).
  Field order is already preserved by default. Set `marshmallow.Schema.dict_class` to `collections.OrderedDict`
  to maintain the previous behavior.

3.25.1 (2025-01-11)
-------------------

Bug fixes:

- Typing: Fix type annotations for `Tuple <marshmallow.fields.Tuple>`,
  `Boolean <marshmallow.fields.Boolean>`, and `Pluck <marshmallow.fields.Pluck>`
  constructors (:pr:`2756`).
- Typing: Fix overload for `marshmallow.class_registry.get_class` (:pr:`2756`).

Documentation:

- Various documentation improvements (:pr:`2746`, :pr:`2747`, :pr:`2748`, :pr:`2749`, :pr:`2750`, :pr:`2751`).

3.25.0 (2025-01-09)
-------------------

Features:

- Typing: Improve type annotations for ``SchemaMeta.get_declared_fields`` (:pr:`2742`).

Bug fixes:

- Typing: Relax type annotation for ``Schema.opts`` to allow subclasses to define their own
  options classes (:pr:`2744`).

Other changes:

- Restore ``marshmallow.base.SchemaABC`` for backwards-compatibility (:issue:`2743`).
  Note that this class is deprecated and will be removed in marshmallow 4.
  Use `marshmallow.schema.Schema` as a base class for type-checking instead.

3.24.2 (2025-01-08)
-------------------

Changes:

- Don't override ``__new__`` to avoid breaking usages of `inspect.signature` with
  `Field <marshmallow.fields.Field>` classes.
  This allows marshmallow-sqlalchemy users to upgrade marshmallow without
  upgrading to marshmallow-sqlalchemy>=1.1.1.

Documentation:

- Add top-level API back to docs (:issue:`2739`).
  Thanks :user:`llucax` for reporting.

3.24.1 (2025-01-06)
-------------------

Bug fixes:

- Typing: Fix typing for `class_registry.get_class <marshmallow.class_registry.get_class>` (:pr:`2735`).

3.24.0 (2025-01-06)
-------------------

Features:

- Typing: Improve typings in `marshmallow.fields` (:pr:`2723`).
- Typing: Replace type comments with inline typings (:pr:`2718`).

Bug fixes:

- Typing: Fix type hint for ``nested`` parameter of `Nested <marshmallow.fields.Nested>` (:pr:`2721`).

Deprecations:

- Custom validators should raise a `ValidationError <marshmallow.exceptions.ValidationError>` for invalid values.
  Returning `False`` is no longer supported .
- Deprecate ``context`` parameter of `Schema <marshmallow.schema.Schema>` (:issue:`1826`).
  Use `contextVars.ContextVar` to pass context data instead.
- `Field <marshmallow.fields.Field>`, `Mapping <marshmallow.fields.Mapping>`,
  and `Number <marshmallow.fields.Number>` should no longer be used as fields within schemas.
  Use their subclasses instead.


3.23.3 (2025-01-03)
-------------------

Bug fixes:

- Typing: Fix typing for `Schema.from_dict <marshmallow.schema.Schema.from_dict>` (:issue:`1653`).
  Thanks :user:`SteadBytes` for reporting.

Support:

- Documentation: Various documentation cleanups, including more concise docs in the `marshmallow.fields` API reference (:issue:`2307`).
  Thanks :user:`AbdealiLoKo` for reporting.

3.23.2 (2024-12-18)
-------------------

Bug fixes:

- Improve type hint formatting for ``Field``, ``Nested``, and ``Function`` fields
  to resolve PyCharm warnings (:issue:`2268`).
  Thanks :user:`Fares-Abubaker` for reporting and fixing.


3.23.1 (2024-11-01)
-------------------

Support:

- Document ``absolute`` parameter of ``URL`` field (:pr:`2327`).
- Documentation: Remove (outdated) minimum Python 3 minor version in
  documentation and README (:pr:`2323`).

3.23.0 (2024-10-17)
-------------------

Features:

- Typing: replace "type" with specific metaclass for ``Schema`` and ``Field``.

Other changes:

- Officially support Python 3.13 (:pr:`2319`).
- Drop support for Python 3.8 (:pr:`2318`).

3.22.0 (2024-08-20)
-------------------

Features:

- Add ``many`` Meta option to ``Schema`` so it expects a collection by default (:issue:`2270`).
  Thanks :user:`himalczyk` for reporting and :user:`deckar01` for the PR.
- Refactor hooks (:pr:`2279`).
  Thanks :user:`deckar01` for the PR.

3.21.3 (2024-06-05)
-------------------

Bug fixes:

- Fix memory leak that prevented schema instances from getting GC'd (:pr:`2277`).
  Thanks :user:`mrcljx` for the PR.

3.21.2 (2024-05-01)
-------------------

Bug fixes:

- Allow timestamp 0 in ``fields.DateTime`` (:issue:`2133`).
  Thanks :user:`flydzen` for reporting.

3.21.1 (2024-03-04)
-------------------

Bug fixes:

- Fix error message when field is declared as a class and not an instance (:issue:`2245`).
  Thanks :user:`travnick` for reporting.

3.21.0 (2024-02-26)
-------------------

Bug fixes:

- Fix validation of ``URL`` fields to allow missing user field,
  per NWG RFC 3986 (:issue:`2232`). Thanks :user:`ddennerline3` for reporting
  and :user:`deckar01` for the PR.

Other changes:

- *Backwards-incompatible*: ``__version__``, ``__parsed_version__``, and ``__version_info__``
  attributes are deprecated (:issue:`2227`). Use feature detection or
  ``importlib.metadata.version("marshmallow")`` instead.

3.20.2 (2024-01-09)
-------------------

Bug fixes:

- Fix ``Nested`` field type hint for lambda ``Schema`` types (:pr:`2164`).
  Thanks :user:`somethingnew2-0` for the PR.

Other changes:

- Officially support Python 3.12 (:pr:`2188`).
  Thanks :user:`hugovk` for the PR.

3.20.1 (2023-07-20)
-------------------

Bug fixes:

- Fix call to ``get_declared_fields``: pass ``dict_cls`` again (:issue:`2152`).
  Thanks :user:`Cheaterman` for reporting.

3.20.0 (2023-07-20)
-------------------

Features:

- Add ``absolute`` parameter to ``URL`` validator and ``Url`` field (:pr:`2123`).
  Thanks :user:`sirosen` for the PR.
- Use Abstract Base Classes to define ``FieldABC`` and ``SchemaABC``
  (:issue:`1449`). Thanks :user:`aditkumar72` for the PR.
- Use `OrderedSet` as default `set_class`. Schemas are now ordered by default.
  (:issue:`1744`)

Bug fixes:

- Handle ``OSError`` and ``OverflowError`` in ``utils.from_timestamp`` (:pr:`2102`).
  Thanks :user:`TheBigRoomXXL` for the PR.
- Fix the default inheritance of nested partial schemas (:issue:`2149`).
  Thanks :user:`matejsp` for reporting.

Other changes:

- Officially support Python 3.11 (:pr:`2067`).
- Drop support for Python 3.7 (:pr:`2135`).

3.19.0 (2022-11-11)
-------------------

Features:

- Add ``timestamp`` and ``timestamp_ms`` formats to ``fields.DateTime``
  (:issue:`612`).
  Thanks :user:`vgavro` for the suggestion and thanks :user:`vanHoi` for
  the PR.

3.18.0 (2022-09-15)
-------------------

Features:

- Add ``Enum`` field (:pr:`2017`) and (:pr:`2044`).

Bug fixes:

- Fix typing in ``Field._serialize`` signature (:pr:`2046`).

3.17.1 (2022-08-22)
-------------------

Bug fixes:

- Add return type to ``fields.Email.__init__`` (:pr:`2018`).
  Thanks :user:`kkirsche` for the PR.
- Add missing type hint to IPInterface __init__ (:pr:`2036`).

3.17.0 (2022-06-26)
-------------------

Features:

- Support serialization as float in ``TimeDelta`` field (:pr:`1998`).
  Thanks :user:`marcosatti` for the PR.
- Add ``messages_dict`` property to ``ValidationError`` to facilitate type checking
  (:pr:`1976`).
  Thanks :user:`sirosen` for the PR.

3.16.0 (2022-05-29)
-------------------

Features:

- Raise ``ValueError`` if an invalid value is passed to the ``unknown``
  argument (:issue:`1721`, :issue:`1732`).
  Thanks :user:`sirosen` for the PR.

Other changes:

- Set lower bound for ``packaging`` requirement (:issue:`1957`).
  Thanks :user:`MatthewNicolTR` for reporting and thanks :user:`sirosen` for the PR.
- Improve warning messages by passing ``stacklevel`` (:pr:`1986`).
  Thanks :user:`tirkarthi` for the PR.

3.15.0 (2022-03-12)
-------------------

Features:

- Allow passing a ``dict`` to ``fields.Nested`` (:pr:`1935`).
  Thanks :user:`sirosen` for the PR.

Other changes:

- Address distutils deprecation warning in Python 3.10 (:pr:`1903`).
  Thanks :user:`kkirsche` for the PR.
- Add py310 to black target-version (:pr:`1921`).
- Drop support for Python 3.6 (:pr:`1923`).
- Use postponed evaluation of annotations (:pr:`1932`).
  Thanks :user:`Isira-Seneviratne` for the PR.

3.14.1 (2021-11-13)
-------------------

Bug fixes:

- Fix publishing type hints per `PEP-561 <https://www.python.org/dev/peps/pep-0561/>`_
  (:pr:`1905`). Thanks :user:`bwindsor` for the catch and patch.

3.14.0 (2021-10-17)
-------------------

Bug fixes:

- Fix ``fields.TimeDelta`` serialization precision (:issue:`1865`).
  Thanks :user:`yarsanich` for reporting.

Other changes:

- Fix type-hints for ``data`` arg in ``Schema.validate`` to accept
  list of dictionaries (:issue:`1790`, :pr:`1868`).
  Thanks  :user:`yourun-proger` for PR.
- Improve warning when passing metadata as keyword arguments (:pr:`1882`).
  Thanks :user:`traherom` for the PR.
- Don't build universal wheels. We don't support Python 2 anymore.
  (:issue:`1860`) Thanks :user:`YKdvd` for reporting.
- Make the build reproducible (:pr:`1862`).
- Drop support for Python 3.5 (:pr:`1863`).
- Test against Python 3.10 (:pr:`1888`).

3.13.0 (2021-07-21)
-------------------

Features:

- Replace ``missing``/``default`` field parameters with
  ``load_default``/``dump_default`` (:pr:`1742`).
  Thanks :user:`sirosen` for the PR.

Deprecations:

- The use of ``missing``/``default`` field parameters is deprecated and will be
  removed in marshmallow 4. ``load_default``/``dump_default`` should be used
  instead.

3.12.2 (2021-07-06)
-------------------

Bug fixes:

- Don't expose ``Field``\s as ``Schema`` attributes. This reverts a change
  introduced in 3.12.0 that causes issues when field names conflict with
  ``Schema`` attributes or methods. ``Fields``\s are still accessible on a
  ``Schema`` instance through the ``fields`` attribute. (:pr:`1843`)

3.12.1 (2021-05-10)
-------------------

Bug fixes:

- Fix bug that raised an ``AttributeError`` when instantiating a
  ``Schema`` with a field named ``parent`` (:issue:`1808`).
  Thanks :user:`flying-sheep` for reporting and helping with the fix.

3.12.0 (2021-05-09)
-------------------

Features:

- Add ``validate.And`` (:issue:`1768`).
  Thanks :user:`rugleb` for the suggestion.
- Add type annotations to ``marshmallow.decorators`` (:issue:`1788`, :pr:`1789`).
  Thanks :user:`michaeldimchuk` for the PR.
- Let ``Field``\s be accessed by name as ``Schema`` attributes (:pr:`1631`).

Other changes:

- Improve types in ``marshmallow.validate`` (:pr:`1786`).
- Make ``marshmallow.validate.Validator`` an abstract base class (:pr:`1786`).
- Remove unnecessary list cast (:pr:`1785`).

3.11.1 (2021-03-29)
-------------------

Bug fixes:

- Fix treatment of dotted keys when ``unknown=INCLUDE`` (:issue:`1506`).
  Thanks :user:`rbu` for reporting and thanks :user:`sirosen` for the fix (:pr:`1745`).

3.11.0 (2021-03-28)
-------------------

Features:

- Add ``fields.IPInterface``, ``fields.IPv4Interface``, and
  ``IPv6Interface`` (:issue:`1733`). Thanks :user:`madeinoz67`
  for the suggestion and the PR.
- Raise ``AttributeError`` for missing methods when using ``fields.Method`` (:pr:`1675`).
  Thanks :user:`lassandroan`.

Other changes:

- Remove unnecessary ``hasattr`` and ``getattr`` checks in ``Field`` (:pr:`1770`).

3.10.0 (2020-12-19)
-------------------

Deprecations:

- Passing field metadata via keyword arguments is deprecated and will be
  removed in marshmallow 4 (:issue:`1350`). Use the explicit ``metadata=...``
  argument instead. Thanks :user:`sirosen`.

3.9.1 (2020-11-07)
------------------

Bug fixes:

- Cast to mapping type in ``Mapping.serialize`` and ``Mapping.deserialize``
  (:pr:`1685`).
- Fix bug letting ``Dict`` pass invalid dict on deserialization when no key or
  value ``Field`` is specified (:pr:`1685`).

3.9.0 (2020-10-31)
------------------

Features:

- Add ``format`` argument to ``fields.Time`` and ``timeformat`` ``class Meta`` option (:issue:`686`).
  Thanks :user:`BennyAlex` for the suggestion and thanks :user:`infinityxxx` for the PR.

Other changes:

- Remove usage of implicit ``typing.Optional`` (:issue:`1663`).
  Thanks :user:`nadega` for the PR.

3.8.0 (2020-09-16)
------------------

Features:

- Add ``fields.IP``, ``fields.IPv4`` and ``fields.IPv6`` (:pr:`1485`). Thanks
  :user:`mgetka` for the PR.

Bug fixes:

- Fix typing in ``AwareDateTime`` (:pr:`1658`). Thanks :user:`adithyabsk` for
  reporting.

3.7.1 (2020-07-20)
------------------

Bug fixes:

- ``fields.Boolean`` correctly serializes non-hashable types (:pr:`1633`).
  Thanks :user:`jun0jang` for the PR.

3.7.0 (2020-07-08)
------------------

Deprecations:

- ``marshmallow.pprint`` is deprecated and will be removed in marshmallow 4 (:issue:`1588`).

Support:

- Document ``default_error_messages`` on field classes (:pr:`1619`). Thanks :user:`weeix`.

Bug fixes:

- Fix passing ``only`` and ``exclude`` to ``Nested`` with an ordered ``Schema`` (:pr:`1627`).
  Thanks :user:`juannorris` for the PR.

3.6.1 (2020-06-02)
------------------

No code changes--only docs and contributor-facing updates in this release.

Support:

- Documentation: improve custom fields example (:issue:`1538`).
  Thanks :user:`pablospizzamiglio` for reporting the problem with the
  old example and thanks :user:`Resinderate` for the PR.
- Documentation: Split up API reference into multiple pages and
  add summary tables (:pr:`1587`). Thanks :user:`EpicWink` for the PR.

3.6.0 (2020-05-08)
------------------

Features:

- Add ``validate.ContainsNoneOf`` (:issue:`1528`).
  Thanks :user:`Resinderate` for the suggestion and the PR.


3.5.2 (2020-04-30)
------------------

Bug fixes:

- Fix typing in ``class_registry`` (:pr:`1574`). Thanks :user:`mahenzon`.

3.5.1 (2020-03-05)
------------------

Bug fixes:

- Includes bug fix from 2.21.0.

3.5.0 (2020-02-19)
------------------

Bug fixes:

- Fix list of nullable nested fields ``List(Nested(Field, allow_none=True)``
  (:issue:`1497`). Because this fix reverts an optimization introduced to
  speed-up serialization and deserialization of lists of nested fields, a
  negative impact on performance in this specific case is expected.

3.4.0 (2020-02-02)
------------------

Features:

- Improve type coverage (:issue:`1479`). Thanks :user:`Reskov`.

Bug fixes:

- Fix typing for ``data`` param of ``Schema.load`` and ``ValidationError`` (:issue:`1492`).
  Thanks :user:`mehdigmira` for reporting and thanks :user:`dfirst` for the PR.

Other changes:

- Remove unnecessary typecasts (:pr:`1500`). Thanks :user:`hukkinj1`.
- Remove useless ``_serialize`` override in ``UUID`` field (:pr:`1489`).

3.3.0 (2019-12-05)
------------------

Features:

- ``fields.Nested`` may take a callable that returns a schema instance.
  Use this to resolve order-of-declaration issues when schemas nest each other (:issue:`1146`).

.. code-block:: python

    # <3.3
    class AlbumSchema(Schema):
        title = fields.Str()
        artist = fields.Nested("ArtistSchema", only=("name",))


    class ArtistSchema(Schema):
        name = fields.Str()
        albums = fields.List(fields.Nested(AlbumSchema))


    # >=3.3
    class AlbumSchema(Schema):
        title = fields.Str()
        artist = fields.Nested(lambda: ArtistSchema(only=("name",)))


    class ArtistSchema(Schema):
        name = fields.Str()
        albums = fields.List(fields.Nested(AlbumSchema))

Deprecations:

- Passing the string ``"self"`` to ``fields.Nested`` is deprecated.
  Use a callable instead.

.. code-block:: python

    from marshmallow import Schema, fields


    # <3.3
    class PersonSchema(Schema):
        partner = fields.Nested("self", exclude=("partner",))
        friends = fields.List(fields.Nested("self"))


    # >=3.3
    class PersonSchema(Schema):
        partner = fields.Nested(lambda: PersonSchema(exclude=("partner")))
        friends = fields.List(fields.Nested(lambda: PersonSchema()))

Other changes:

- Fix typing for ``Number._format_num`` (:pr:`1466`). Thanks :user:`hukkinj1`.
- Make mypy stricter and remove dead code (:pr:`1467`). Thanks again, :user:`hukkinj1`.

3.2.2 (2019-11-04)
------------------

Bug fixes:

- Don't load fields for which ``load_only`` and ``dump_only`` are both ``True`` (:pr:`1448`).
- Fix types in ``marshmallow.validate`` (:pr:`1446`).

Support:

- Test against Python 3.8 (:pr:`1431`).

3.2.1 (2019-09-30)
------------------

Bug fixes:

- Fix typing for ``Schema.dump[s]`` (:pr:`1416`).

3.2.0 (2019-09-17)
------------------

Features:

- Add type annotations to ``marshmallow.schema`` and ``marshmallow.validate`` (:pr:`1407`, :issue:`663`).

Bug fixes:

- Fix compatibility with Python < 3.5.3 (:issue:`1409`). Thanks :user:`lukaszdudek-silvair` for reporting.

Refactoring:

- Remove unnecessary ``BaseSchema`` superclass (:pr:`1406`).

3.1.1 (2019-09-16)
------------------

Bug fixes:

- Restore inheritance hierarchy of ``Number`` fields (:pr:`1403`).
  ``fields.Integer`` and ``fields.Decimal`` inherit from ``fields.Number``.
- Fix bug that raised an uncaught error when a nested schema instance had an unpickleable object in its context (:issue:`1404`).
  Thanks :user:`metheoryt` for reporting.

3.1.0 (2019-09-15)
------------------

Features:

- Add more type annotations (:issue:`663`).
  Type information is distributed per `PEP 561 <https://www.python.org/dev/peps/pep-0561/>`_ .
  Thanks :user:`fuhrysteve` for helping with this.

Bug fixes:

- Includes bug fix from 2.20.5.

3.0.5 (2019-09-12)
------------------

Bug fixes:

- Fix bug that raised an uncaught error when passing both a schema instance and ``only`` to ``Nested`` (:pr:`1395`).
  This bug also affected passing a schema instance to ``fields.Pluck``.


3.0.4 (2019-09-11)
------------------

Bug fixes:

- Fix propagating dot-delimited ``only`` and ``exclude`` parameters to nested schema instances (:issue:`1384`).
- Includes bug fix from 2.20.4 (:issue:`1160`).

3.0.3 (2019-09-04)
------------------

Bug fixes:

- Handle when ``data_key`` is an empty string (:issue:`1378`).
  Thanks :user:`jtrakk` for reporting.

3.0.2 (2019-09-04)
------------------

Bug fixes:

- Includes bug fix from 2.20.3 (:pr:`1376`).
- Fix incorrect ``super()`` call in ``SchemaMeta.__init__`` (:pr:`1362`).

3.0.1 (2019-08-21)
------------------

Bug fixes:

- Fix bug when nesting ``fields.DateTime`` within ``fields.List`` or ``fields.Tuple`` (:issue:`1357`).
  This bug was introduced in 3.0.0rc9. Thanks :user:`zblz` for reporting.

3.0.0 (2019-08-18)
------------------

Features:

- Optimize ``List(Nested(...))`` (:issue:`779`).
- Minor performance improvements and cleanup (:pr:`1328`).
- Add ``Schema.from_dict`` (:issue:`1312`).

Deprecations/Removals:

- ``Field.fail`` is deprecated. Use ``Field.make_error`` instead.
- Remove UUID validation from ``fields.UUID``, for consistency with other fields (:issue:`1132`).

Support:

- Various docs improvements (:pr:`1329`).

3.0.0rc9 (2019-07-31)
---------------------

Features:

- *Backwards-incompatible*: Validation does not occur on serialization (:issue:`1132`).
  This significantly improves serialization performance.
- *Backwards-incompatible*: ``DateTime`` does not affect timezone information
  on serialization and deserialization (:issue:`1234`, :pr:`1278`).
- Add ``NaiveDateTime`` and ``AwareDateTime`` to enforce timezone awareness
  (:issue:`1234`, :pr:`1287`).
- *Backwards-incompatible*: ``List`` does not wrap single values in a list on
  serialization (:pr:`1307`).
- *Backwards-incompatible*: ``Schema.handle_error`` receives ``many`` and ``partial`` as keyword arguments (:pr:`1321`).
- Use ``raise from`` more uniformly to improve stack traces (:pr:`1313`).
- Rename ``Nested.__schema`` to ``Nested._schema`` to prevent name mangling (:issue:`1289`).
- Performance improvements (:pr:`1309`).

Deprecations/Removals:

- ``LocalDateTime`` is removed (:issue:`1234`).
- ``marshmallow.utils.utc`` is removed. Use ``datetime.timezone.utc`` instead.

Bug fixes:

- Fix behavior of ``List(Nested("self"))`` (`#779 (comment) <https://github.com/marshmallow-code/marshmallow/issues/779#issuecomment-396354987>`_).

Support:

- Document usage of ``validate.Regexp``'s usage ``re.search`` (:issue:`1285`). Thanks :user:`macdonaldezra`.

3.0.0rc8 (2019-07-04)
---------------------

Features:

- Propagate ``only`` and ``exclude`` parameters to ``Nested`` fields
  within ``List`` and ``Dict`` (:issue:`779`, :issue:`946`).
- Use ``email.utils.parsedate_to_datetime`` instead of conditionally
  using dateutil for parsing RFC dates (:pr:`1246`).
- Use internal util functions instead of conditionally using dateutil
  for parsing  ISO 8601 datetimes, dates and times. Timezone info is now
  correctly deserialized whether or not dateutil is installed. (:pr:`1265`)
- Improve error messages for ``validate.Range``.
- Use ``raise from error`` for better stack traces (:pr:`1254`). Thanks
  :user:`fuhrysteve`.
- python-dateutil is no longer used. This resolves the inconsistent behavior
  based on the presence of python-dateutil (:issue:`497`, :issue:`1234`).

Bug fixes:

- Fix method resolution for ``__init__`` method of ``fields.Email`` and
  ``fields.URL`` (:issue:`1268`). Thanks :user:`dursk` for the catch and patch.
- Includes bug fixes from 2.19.4 and 2.19.5.

Other changes:

- *Backwards-incompatible*: Rename ``fields.List.container`` to ``fields.List.inner``,
  ``fields.Dict.key_container`` to ``fields.Dict.key_field``, and
  ``fields.Dict.value_container`` to ``fields.Dict.value_field``.
- Switch to Azure Pipelines for CI (:issue:`1261`).

3.0.0rc7 (2019-06-15)
---------------------

Features:

- *Backwards-incompatible*: ``many`` is passed as a keyword argument to methods decorated with
  ``pre_load``, ``post_load``, ``pre_dump``, ``post_dump``,
  and ``validates_schema``. ``partial`` is passed as a keyword argument to
  methods decorated with ``pre_load``, ``post_load`` and ``validates_schema``.
  ``**kwargs`` should be added to all decorated methods.
- Add ``min_inclusive`` and ``max_exclusive`` parameters to
  ``validate.Range`` (:issue:`1221`). Thanks :user:`kdop` for the PR.

Bug fixes:

- Fix propagation of ``partial`` to ``Nested`` containers (part of :issue:`779`).
- Includes bug fix from 2.19.3.

Other changes:

- *Backwards-incompatible*: Use keyword-only arguments (:issue:`1216`).

3.0.0rc6 (2019-05-05)
---------------------

Support:

- *Backwards-incompatible*: Remove support for Python 2 (:issue:`1120`).
  Only Python>=3.5 is supported.
  Thank you :user:`rooterkyberian` for the suggestion and the PR.
- *Backwards-incompatible*: Remove special-casing in ``fields.List`` and
  ``fields.Tuple`` for accessing nested attributes (:pr:`1188`).
  Use ``fields.List(fields.Pluck(...))`` instead.
- Add ``python_requires`` to ``setup.py`` (:pr:`1194`).
  Thanks :user:`hugovk`.
- Upgrade syntax with ``pyupgrade`` in pre-commit (:pr:`1195`). Thanks
  again :user:`hugovk`.

3.0.0rc5 (2019-03-30)
---------------------

Features:

- Allow input value to be included in error messages
  for a number of fields (:pr:`1129`). Thanks :user:`hdoupe` for the PR.
- Improve default error messages for ``OneOf`` and ``ContainsOnly``
  (:issue:`885`). Thanks :user:`mcgfeller` for the suggestion
  and :user:`maxalbert` for the PR.

Deprecations/Removals:

- Remove ``fields.FormattedString`` (:issue:`1141`). Use
  ``fields.Function`` or ``fields.Method`` instead.

Bug fixes:

- Includes bug fix from 2.19.2.

3.0.0rc4 (2019-02-08)
---------------------

Features:

- Add ``fields.Tuple`` (:issue:`1103`) Thanks :user:`zblz` for the PR.
- Add ``fields.Mapping``, which makes it easier to support other
  mapping types (e.g. ``OrderedDict``)  (:issue:`1092`).
  Thank :user:`sayanarijit` for the suggestion and the PR.

3.0.0rc3 (2019-01-13)
---------------------

Features:

- Make the error messages for "unknown fields" and "invalid data type"
  configurable (:issue:`852`). Thanks :user:`Dunstrom` for the PR.
- ``fields.Boolean`` parses ``"yes"``/``"no"`` values (:pr:`1081`).
  Thanks :user:`r1b`.

Other changes:

- *Backwards-incompatible with previous 3.x versions*: Change ordering
  of ``keys`` and ``values`` arguments to ``fields.Dict``.
- Remove unused code in ``marshmallow.utils``: ``is_indexable_but_not_string``,
  ``float_to_decimal``, ``decimal_to_fixed``, ``from_iso`` (:pr:`1088`).
- Remove unused ``marshmallow.compat.string_types``.

Bug fixes:

- Includes bug fix from 2.18.0.

3.0.0rc2 (2019-01-03)
---------------------

Features:

- Add ``register`` *class Meta* option to allow bypassing marshmallow's
  internal class registry when memory usage is critical (:issue:`660`).

Bug fixes:

- Fix serializing dict-like objects with properties (:issue:`1060`).
  Thanks :user:`taion` for the fix.
- Fix populating ``ValidationError.valid_data`` for ``List`` and
  ``Dict`` fields (:issue:`766`).

Other changes:

- Add ``marshmallow.__version_info__`` (:pr:`1074`).
- Remove the ``marshmallow.marshalling`` internal module (:pr:`1070`).
- A ``ValueError`` is raised when the ``missing`` parameter is passed
  for required fields (:issue:`1040`).
- Extra keyword arguments passed to ``ValidationError`` in validators
  are no longer passed to the final ``ValidationError`` raised upon
  validation completion (:issue:`996`).

3.0.0rc1 (2018-11-29)
---------------------

Features:

- *Backwards-incompatible*: Rework ``ValidationError`` API.
  It now expects a single field name, and error structures are merged
  in the final ``ValidationError`` raised when validation completes.
  This allows schema-level validators to raise errors for individual
  fields (:issue:`441`). Thanks :user:`maximkulkin` for
  writing the original ``merge_errors`` implementation in :pr:`442` and thanks
  :user:`lafrech` for completing the implementation in :pr:`1026`.

Bug fixes:

- Fix ``TypeError`` when serializing ``None`` with ``Pluck`` (:pr:`1049`).
  Thanks :user:`toffan` for the catch and patch.

3.0.0b20 (2018-11-01)
---------------------

Bug fixes:

- Includes bug fixes from 2.16.2 and 2.16.3.

3.0.0b19 (2018-10-24)
---------------------

Features:

- Support partial loading of nested fields (:pr:`438`). Thanks
  :user:`arbor-dwatson` for the PR. *Note*: Subclasses of ``fields.Nested``
  now take an additional ``partial`` parameter in the ``_deserialize``
  method.

Bug fixes:

- Restore ``Schema.TYPE_MAPPING``, which was removed in 3.0.0b17 (:issue:`1012`).

Other changes:

- *Backwards-incompatible*: ``_serialize`` and ``_deserialize`` methods of
  all ``fields.Field`` subclasses must accept ``**kwargs`` (:pr:`1007`).


3.0.0b18 (2018-10-15)
---------------------

Bug fixes:

- Fix ``Date`` deserialization when using custom format (:issue:`1001`). Thanks
  :user:`Ondkloss` for reporting.

Deprecations/Removals:

- ``prefix`` parameter or ``Schema`` class is removed (:issue:`991`). The same
  can be achieved using a ``@post_dump`` method.


3.0.0b17 (2018-10-13)
---------------------

Features:

- Add ``format`` option to ``Date`` field (:pr:`869`).
- *Backwards-incompatible*: Rename ``DateTime``'s ``dateformat`` Meta option
  to ``datetimeformat``. ``dateformat`` now applies to ``Date`` (:pr:`869`).
  Thanks :user:`knagra` for implementing these changes.
- Enforce ISO 8601 when deserializing date and time (:issue:`899`).
  Thanks :user:`dushr` for the report and the work on the PR.
- *Backwards-incompatible*: Raise ``ValueError`` on ``Schema`` instantiation in
  case of ``attribute`` or ``data_key`` collision (:pr:`992`).

Bug fixes:

- Fix inconsistencies in field inference by refactoring the inference feature
  into a dedicated field (:issue:`809`). Thanks :user:`taion` for the PR.
- When ``unknown`` is not passed to ``Nested``, default to nested ``Schema``
  ``unknown`` meta option rather than ``RAISE`` (:pr:`963`).
  Thanks :user:`vgavro` for the PR.
- Fix loading behavior of ``fields.Pluck`` (:pr:`990`).
- Includes bug fix from 2.16.0.

3.0.0b16 (2018-09-20)
---------------------

Bug fixes:

- Fix ``root`` attribute for nested container fields
  on inheriting schemas (:issue:`956`). Thanks :user:`bmcbu`
  for reporting.

3.0.0b15 (2018-09-18)
---------------------

Bug fixes:

- Raise ``ValidationError`` instead of ``TypeError`` when non-iterable types are
  validated with ``many=True`` (:issue:`851`).
- ``many=True`` no longer iterates over ``str`` and ``collections.abc.Mapping`` objects and instead
  raises a ``ValidationError`` with ``{'_schema': ['Invalid input type.']}`` (:issue:`930`).
- Return ``[]`` as ``ValidationError.valid_data`` instead of ``{}`` when
  ``many=True`` (:issue:`907`).

Thanks :user:`tuukkamustonen` for implementing these changes.

3.0.0b14 (2018-09-15)
---------------------

Features:

- Add ``fields.Pluck`` for serializing a single field from a nested object
  (:issue:`800`). Thanks :user:`timc13` for the feedback and :user:`deckar01`
  for the implementation.
- *Backwards-incompatible*: Passing a string argument as ``only`` to
  ``fields.Nested`` is no longer supported. Use ``fields.Pluck`` instead
  (:issue:`800`).
- Raise a ``StringNotCollectionError`` if ``only`` or ``exclude`` is
  passed as a string to ``fields.Nested`` (:pr:`931`).
- *Backwards-incompatible*: ``Float`` takes an ``allow_nan`` parameter to
  explicitly allow serializing and deserializing special values (``nan``,
  ``inf`` and ``-inf``). ``allow_nan`` defaults to ``False``.

Other changes:

- *Backwards-incompatible*: ``Nested`` field now defaults to ``unknown=RAISE``
  instead of ``EXCLUDE``. This harmonizes behavior with ``Schema`` that
  already defaults to ``RAISE`` (:issue:`908`). Thanks :user:`tuukkamustonen`.
- Tested against Python 3.7.

3.0.0b13 (2018-08-04)
---------------------

Bug fixes:

- Errors reported by a schema-level validator for a field in a ``Nested`` field
  are stored under corresponding field name, not ``_schema`` key (:pr:`862`).
- Includes bug fix from 2.15.4.

Other changes:

- *Backwards-incompatible*: The ``unknown`` option now defaults to ``RAISE``
  (`#524 (comment) <https://github.com/marshmallow-code/marshmallow/issues/524#issuecomment-397165731>`_,
  :issue:`851`).
- *Backwards-incompatible*: When a schema error is raised with a ``dict`` as
  payload, the ``dict`` overwrites any existing error list. Before this change,
  it would be appended to the list.
- Raise a `StringNotCollectionError` if ``only`` or ``exclude`` is
  passed as a string (:issue:`316`). Thanks :user:`paulocheque` for
  reporting.

3.0.0b12 (2018-07-04)
---------------------

Features:

- The behavior to apply when encountering unknown fields while deserializing
  can be controlled with the ``unknown`` option (:issue:`524`,
  :issue:`747`, :issue:`127`).
  It makes it possible to either "include", "exclude", or "raise".
  Thanks :user:`tuukkamustonen` for the suggestion and thanks
  :user:`ramnes` for the PR.

.. warning::

  The default for ``unknown`` will be changed to ``RAISE`` in the
  next release.

Other changes:

- *Backwards-incompatible*: Pre/Post-processors MUST return modified data.
  Returning ``None`` does not imply data were mutated (:issue:`347`). Thanks
  :user:`tdevelioglu` for reporting.
- *Backwards-incompatible*: ``only`` and ``exclude`` are bound by
  declared and additional fields. A ``ValueError`` is raised if invalid
  fields are passed (:issue:`636`). Thanks :user:`jan-23` for reporting.
  Thanks :user:`ikilledthecat` and :user:`deckar01` for the PRs.
- Format code using pre-commit (:pr:`855`).

Deprecations/Removals:

- ``ValidationError.fields`` is removed (:issue:`840`). Access field
  instances from ``Schema.fields``.

3.0.0b11 (2018-05-20)
---------------------

Features:

- Clean up code for schema hooks (:pr:`814`). Thanks :user:`taion`.
- Minor performance improvement from simplifying ``utils.get_value`` (:pr:`811`). Thanks again :user:`taion`.
- Add ``require_tld`` argument to ``fields.URL`` (:issue:`749`). Thanks
  :user:`DenerKup` for reporting and thanks :user:`surik00` for the PR.
- ``fields.UUID`` deserializes ``bytes`` strings using ``UUID(bytes=b'...')`` (:pr:`625`).
  Thanks :user:`JeffBerger` for the suggestion and the PR.

Bug fixes:

- Fields nested within ``Dict`` correctly inherit context from their
  parent schema (:issue:`820`). Thanks :user:`RosanneZe` for reporting
  and :user:`deckar01` for the PR.
- Includes bug fix from 2.15.3.


3.0.0b10 (2018-05-10)
---------------------

Bug fixes:

- Includes bugfixes from 2.15.2.

3.0.0b9 (2018-04-25)
--------------------

Features:

- *Backwards-incompatible*: ``missing`` and ``default`` values are
  passed in deserialized form (:issue:`378`). Thanks :user:`chadrik` for
  the suggestion and thanks :user:`lafrech` for the PR.

Bug fixes:

- Includes the bugfix from 2.15.1.

3.0.0b8 (2018-03-24)
--------------------

Features:

- *Backwards-incompatible*: Add ``data_key`` parameter to fields for
  specifying the key in the input and output data dict. This
  parameter replaces both ``load_from`` and ``dump_to`` (:issue:`717`).
  Thanks :user:`lafrech`.
- *Backwards-incompatible*: When ``pass_original=True`` is passed to one
  of the decorators and a collection is being (de)serialized, the
  ``original_data`` argument will be a single object unless
  ``pass_many=True`` is also passed to the decorator (:issue:`315`,
  :issue:`743`). Thanks :user:`stj` for the PR.
- *Backwards-incompatible*: Don't recursively check nested required
  fields when the ``Nested`` field's key is missing (:issue:`319`). This
  reverts :pr:`235`. Thanks :user:`chekunkov` reporting and thanks
  :user:`lafrech` for the PR.
- *Backwards-incompatible*: Change error message collection for ``Dict`` field (:issue:`730`). Note:
  this is backwards-incompatible with previous 3.0.0bX versions.
  Thanks :user:`shabble` for the report and thanks :user:`lafrech` for the PR.

3.0.0b7 (2018-02-03)
--------------------

Features:

- *Backwards-incompatible*: Schemas are always strict (:issue:`377`).
  The ``strict`` parameter is removed.
- *Backwards-incompatible*: ``Schema().load`` and ``Schema().dump`` return ``data`` instead of a
  ``(data, errors)`` tuple (:issue:`598`).
- *Backwards-incompatible*: ``Schema().load(None)`` raises a
  ``ValidationError`` (:issue:`511`).

See :ref:`upgrading_3_0` for a guide on updating your code.

Thanks :user:`lafrech` for implementing these changes.
Special thanks to :user:`MichalKononenko`, :user:`douglas-treadwell`, and
:user:`maximkulkin` for the discussions on these changes.


Other changes:

- *Backwards-incompatible*: Field name is not checked when ``load_from``
  is specified (:pr:`714`). Thanks :user:`lafrech`.

Support:

- Add `Code of Conduct <https://marshmallow.readthedocs.io/en/dev/code_of_conduct.html>`_.


3.0.0b6 (2018-01-02)
--------------------

Bug fixes:

- Fixes ``ValidationError.valid_data`` when a nested field contains errors
  (:issue:`710`). This bug was introduced in 3.0.0b3. Thanks
  :user:`lafrech`.

Other changes:

- *Backwards-incompatible*: ``Email`` and ``URL`` fields don't validate
  on serialization (:issue:`608`). This makes them more consistent with the other
  fields and improves serialization performance. Thanks again :user:`lafrech`.
- ``validate.URL`` requires square brackets around IPv6 URLs (:issue:`707`). Thanks :user:`harlov`.

3.0.0b5 (2017-12-30)
--------------------

Features:

- Add support for structured dictionaries by providing values and keys arguments to the
  ``Dict`` field's constructor. This mirrors the ``List``
  field's ability to validate its items (:issue:`483`). Thanks :user:`deckar01`.

Other changes:

- *Backwards-incompatible*: ``utils.from_iso`` is deprecated in favor of
  ``utils.from_iso_datetime`` (:issue:`694`). Thanks :user:`sklarsa`.

3.0.0b4 (2017-10-23)
--------------------

Features:

- Add support for millisecond, minute, hour, and week precisions to
  ``fields.TimeDelta`` (:issue:`537`). Thanks :user:`Fedalto` for the
  suggestion and the PR.
- Includes features from release 2.14.0.


Support:

- Copyright year in docs uses ``CHANGELOG.rst``'s modified date for
  reproducible builds (:issue:`679`). Thanks :user:`bmwiedemann`.
- Test against Python 3.6 in tox. Thanks :user:`Fedalto`.
- Fix typo in exception message (:issue:`659`). Thanks :user:`wonderbeyond`
  for reporting and thanks :user:`yoichi` for the PR.

3.0.0b3 (2017-08-20)
--------------------

Features:

- Add ``valid_data`` attribute to ``ValidationError``.
- Add ``strict`` parameter to ``Integer`` (:issue:`667`). Thanks
  :user:`yoichi`.

Deprecations/Removals:

- Deprecate ``json_module`` option in favor of ``render_module`` (:issue:`364`, :issue:`130`). Thanks :user:`justanr` for the suggestion.

Bug fixes:

- Includes bug fixes from releases 2.13.5 and 2.13.6.
- *Backwards-incompatible*: ``Number`` fields don't accept booleans as valid input (:issue:`623`). Thanks :user:`tuukkamustonen` for the suggestion and thanks :user:`rowillia` for the PR.

Support:

- Add benchmark script. Thanks :user:`rowillia`.

3.0.0b2 (2017-03-19)
--------------------

Features:

- Add ``truthy`` and ``falsy`` params to ``fields.Boolean`` (:issue:`580`). Thanks :user:`zwack` for the PR. Note: This is potentially a breaking change if your code passes the `default` parameter positionally. Pass `default` as a keyword argument instead, e.g. ``fields.Boolean(default=True)``.

Other changes:

- *Backwards-incompatible*: ``validate.ContainsOnly`` allows empty and duplicate values (:issue:`516`, :issue:`603`). Thanks :user:`maximkulkin` for the suggestion and thanks :user:`lafrech` for the PR.

Bug fixes:

- Includes bug fixes from release 2.13.4.

3.0.0b1 (2017-03-10)
--------------------

Features:

- ``fields.Nested`` respects ``only='field'`` when deserializing (:issue:`307`). Thanks :user:`erlingbo` for the suggestion and the PR.
- ``fields.Boolean`` parses ``"on"``/``"off"`` (:issue:`580`). Thanks :user:`marcellarius` for the suggestion.


Other changes:

- Includes changes from release 2.13.2.
- *Backwards-incompatible*: ``skip_on_field_errors`` defaults to ``True`` for ``validates_schema`` (:issue:`352`).

3.0.0a1 (2017-02-26)
--------------------

Features:

- ``dump_only`` and ``load_only`` for ``Function`` and ``Method`` are set based on ``serialize`` and ``deserialize`` arguments (:issue:`328`).

Other changes:

- *Backwards-incompatible*: ``fields.Method`` and ``fields.Function`` no longer swallow ``AttributeErrors`` (:issue:`395`). Thanks :user:`bereal` for the suggestion.
- *Backwards-incompatible*: ``validators.Length`` is no longer a subclass of ``validators.Range`` (:issue:`458`). Thanks :user:`deckar01` for the catch and patch.
- *Backwards-incompatible*: ``utils.get_func_args`` no longer returns bound arguments. This is consistent with the behavior of ``inspect.signature``. This change prevents a DeprecationWarning on Python 3.5 (:issue:`415`, :issue:`479`). Thanks :user:`deckar01` for the PR.
- *Backwards-incompatible*: Change the signature of ``utils.get_value`` and ``Schema.get_attribute`` for consistency with Python builtins (e.g. ``getattr``) (:issue:`341`). Thanks :user:`stas` for reporting and thanks :user:`deckar01` for the PR.
- *Backwards-incompatible*: Don't unconditionally call callable attributes (:issue:`430`, reverts :issue:`242`). Thanks :user:`mirko` for the suggestion.
- Drop support for Python 2.6 and 3.3.

Deprecation/Removals:

- Remove ``__error_handler__``, ``__accessor__``, ``@Schema.error_handler``, and ``@Schema.accessor``. Override ``Schema.handle_error`` and ``Schema.get_attribute`` instead.
- Remove ``func`` parameter of ``fields.Function``. Remove ``method_name`` parameter of ``fields.Method`` (issue:`325`). Use the ``serialize`` parameter instead.
- Remove ``extra`` parameter from ``Schema``. Use a ``@post_dump`` method to add additional data.

2.21.0 (2020-03-05)
-------------------

Bug fixes:

- Don't match string-ending newlines in ``URL`` and ``Email`` fields
  (:issue:`1522`). Thanks :user:`nbanmp` for the PR.

Other changes:

- Drop support for Python 3.4 (:pr:`1525`).

2.20.5 (2019-09-15)
-------------------

Bug fixes:

- Fix behavior when a non-list collection is passed to the ``validate`` argument of ``fields.Email`` and ``fields.URL`` (:issue:`1400`).

2.20.4 (2019-09-11)
-------------------

Bug fixes:

- Respect the ``many`` value on ``Schema`` instances passed to ``Nested`` (:issue:`1160`).
  Thanks :user:`Kamforka` for reporting.

2.20.3 (2019-09-04)
-------------------

Bug fixes:

- Don't swallow ``TypeError`` exceptions raised by ``Field._bind_to_schema`` or ``Schema.on_bind_field`` (:pr:`1376`).

2.20.2 (2019-08-20)
-------------------

Bug fixes:

- Prevent warning about importing from ``collections`` on Python 3.7
  (:pr:`1354`). Thanks :user:`nicktimko` for the PR.

2.20.1 (2019-08-13)
-------------------

Bug fixes:

- Fix bug that raised ``TypeError`` when invalid data type is
  passed to a nested schema with ``@validates`` (:issue:`1342`).

2.20.0 (2019-08-10)
-------------------

Bug fixes:

- Fix deprecated functions' compatibility with Python 2 (:issue:`1337`).
  Thanks :user:`airstandley` for the catch and patch.
- Fix error message consistency for invalid input types on nested fields (:issue:`1303`).
  This is a backport of the fix in :pr:`857`. Thanks :user:`cristi23` for the
  thorough bug report and the PR.

Deprecation/Removals:

- Python 2.6 is no longer officially supported (:issue:`1274`).

2.19.5 (2019-06-18)
-------------------

Bug fixes:

- Fix deserializing ISO8601-formatted datetimes with less than 6-digit
  miroseconds (:issue:`1251`). Thanks :user:`diego-plan9` for reporting.

2.19.4 (2019-06-16)
-------------------

Bug fixes:

- Microseconds no longer gets lost when deserializing datetimes without dateutil
  installed (:issue:`1147`).

2.19.3 (2019-06-15)
-------------------

Bug fixes:

- Fix bug where nested fields in ``Meta.exclude`` would not work on
  multiple instantiations (:issue:`1212`). Thanks :user:`MHannila` for
  reporting.

2.19.2 (2019-03-30)
-------------------

Bug fixes:

- Handle ``OverflowError`` when (de)serializing large integers with
  ``fields.Float`` (:pr:`1177`). Thanks :user:`brycedrennan` for the PR.

2.19.1 (2019-03-16)
-------------------

Bug fixes:

- Fix bug where ``Nested(many=True)`` would skip first element when
  serializing a generator (:issue:`1163`). Thanks :user:`khvn26` for the
  catch and patch.

2.19.0 (2019-03-07)
-------------------

Deprecation/Removal:

- A ``RemovedInMarshmallow3`` warning is raised when using
  ``fields.FormattedString``. Use ``fields.Method`` or ``fields.Function``
  instead (:issue:`1141`).

2.18.1 (2019-02-15)
-------------------

Bug fixes:

- A ``ChangedInMarshmallow3Warning`` is no longer raised when
  ``strict=False`` (:issue:`1108`). Thanks :user:`Aegdesil` for
  reporting.

2.18.0 (2019-01-13)
-------------------

Features:

- Add warnings for functions in ``marshmallow.utils`` that are removed in
  marshmallow 3.

Bug fixes:

- Copying ``missing`` with ``copy.copy`` or ``copy.deepcopy`` will not
  duplicate it (:pr:`1099`).

2.17.0 (2018-12-26)
-------------------

Features:

- Add ``marshmallow.__version_info__`` (:pr:`1074`).
- Add warnings for API that is deprecated or changed to help users
  prepare for marshmallow 3 (:pr:`1075`).

2.16.3 (2018-11-01)
-------------------

Bug fixes:

- Prevent memory leak when dynamically creating classes with ``type()``
  (:issue:`732`). Thanks :user:`asmodehn` for writing the tests to
  reproduce this issue.

2.16.2 (2018-10-30)
-------------------

Bug fixes:

- Prevent warning about importing from ``collections`` on Python 3.7
  (:issue:`1027`). Thanks :user:`nkonin` for reporting and
  :user:`jmargeta` for the PR.

2.16.1 (2018-10-17)
-------------------

Bug fixes:

- Remove spurious warning about implicit collection handling
  (:issue:`998`). Thanks :user:`lalvarezguillen` for reporting.

2.16.0 (2018-10-10)
-------------------

Bug fixes:

- Allow username without password in basic auth part of the url in
  ``fields.Url`` (:pr:`982`). Thanks user:`alefnula` for the PR.

Other changes:

- Drop support for Python 3.3 (:pr:`987`).

2.15.6 (2018-09-20)
-------------------

Bug fixes:

- Prevent ``TypeError`` when a non-collection is passed to a ``Schema`` with ``many=True``.
  Instead, raise ``ValidationError`` with ``{'_schema': ['Invalid input type.']}`` (:issue:`906`).
- Fix ``root`` attribute for nested container fields on list
  on inheriting schemas (:issue:`956`). Thanks :user:`bmcbu`
  for reporting.

These fixes were backported from 3.0.0b15 and 3.0.0b16.


2.15.5 (2018-09-15)
-------------------

Bug fixes:

- Handle empty SQLAlchemy lazy lists gracefully when dumping (:issue:`948`).
  Thanks :user:`vke-code` for the catch and :user:`YuriHeupa` for the patch.

2.15.4 (2018-08-04)
-------------------

Bug fixes:

- Respect ``load_from`` when reporting errors for ``@validates('field_name')``
  (:issue:`748`). Thanks :user:`m-novikov` for the catch and patch.

2.15.3 (2018-05-20)
-------------------

Bug fixes:

- Fix passing ``only`` as a string to ``nested`` when the passed field
  defines ``dump_to`` (:issue:`800`, :issue:`822`). Thanks
  :user:`deckar01` for the catch and patch.

2.15.2 (2018-05-10)
-------------------

Bug fixes:

- Fix a race condition in validation when concurrent threads use the
  same ``Schema`` instance (:issue:`783`). Thanks :user:`yupeng0921` and
  :user:`lafrech` for the fix.
- Fix serialization behavior of
  ``fields.List(fields.Integer(as_string=True))`` (:issue:`788`). Thanks
  :user:`cactus` for reporting and :user:`lafrech` for the fix.
- Fix behavior of ``exclude`` parameter when passed from parent to
  nested schemas (:issue:`728`). Thanks :user:`timc13` for reporting and
  :user:`deckar01` for the fix.

2.15.1 (2018-04-25)
-------------------

Bug fixes:

- :cve:`2018-17175`: Fix behavior when an empty list is passed as the ``only`` argument
  (:issue:`772`). Thanks :user:`deckar01` for reporting and thanks
  :user:`lafrech` for the fix.

2.15.0 (2017-12-02)
-------------------

Bug fixes:

- Handle ``UnicodeDecodeError`` when deserializing ``bytes`` with a
  ``String`` field (:issue:`650`). Thanks :user:`dan-blanchard` for the
  suggestion and thanks :user:`4lissonsilveira` for the PR.

2.14.0 (2017-10-23)
-------------------

Features:

- Add ``require_tld`` parameter to ``validate.URL`` (:issue:`664`).
  Thanks :user:`sduthil` for the suggestion and the PR.

2.13.6 (2017-08-16)
-------------------

Bug fixes:

- Fix serialization of types that implement `__getitem__`
  (:issue:`669`). Thanks :user:`MichalKononenko`.

2.13.5 (2017-04-12)
-------------------

Bug fixes:

- Fix validation of iso8601-formatted dates (:issue:`556`). Thanks :user:`lafrech` for reporting.

2.13.4 (2017-03-19)
-------------------

Bug fixes:

- Fix symmetry of serialization and deserialization behavior when passing a dot-delimited path to the ``attribute`` parameter of fields (:issue:`450`). Thanks :user:`itajaja` for reporting.

2.13.3 (2017-03-11)
-------------------

Bug fixes:

- Restore backwards-compatibility of ``SchemaOpts`` constructor (:issue:`597`). Thanks :user:`Wesmania` for reporting and thanks :user:`frol` for the fix.

2.13.2 (2017-03-10)
-------------------

Bug fixes:

- Fix inheritance of ``ordered`` option when ``Schema`` subclasses define ``class Meta`` (:issue:`593`). Thanks :user:`frol`.

Support:

- Update contributing docs.

2.13.1 (2017-03-04)
-------------------

Bug fixes:

- Fix sorting on Schema subclasses when ``ordered=True`` (:issue:`592`). Thanks :user:`frol`.

2.13.0 (2017-02-18)
-------------------

Features:

- Minor optimizations (:issue:`577`). Thanks :user:`rowillia` for the PR.

2.12.2 (2017-01-30)
-------------------

Bug fixes:

- Unbound fields return `None` rather returning the field itself. This fixes a corner case introduced in :issue:`572`. Thanks :user:`touilleMan` for reporting and :user:`YuriHeupa` for the fix.

2.12.1 (2017-01-23)
-------------------

Bug fixes:

- Fix behavior when a ``Nested`` field is composed within a ``List`` field (:issue:`572`). Thanks :user:`avish` for reporting and :user:`YuriHeupa` for the PR.

2.12.0 (2017-01-22)
-------------------

Features:

- Allow passing nested attributes (e.g. ``'child.field'``) to the ``dump_only`` and ``load_only`` parameters of ``Schema`` (:issue:`572`). Thanks :user:`YuriHeupa` for the PR.
- Add ``schemes`` parameter to ``fields.URL`` (:issue:`574`). Thanks :user:`mosquito` for the PR.

2.11.1 (2017-01-08)
-------------------

Bug fixes:

- Allow ``strict`` class Meta option to be overridden by constructor (:issue:`550`). Thanks :user:`douglas-treadwell` for reporting and thanks :user:`podhmo` for the PR.

2.11.0 (2017-01-08)
-------------------

Features:

- Import ``marshmallow.fields`` in ``marshmallow/__init__.py`` to save an import when importing the ``marshmallow`` module (:issue:`557`). Thanks :user:`mindojo-victor`.

Support:

- Documentation: Improve example in "Validating Original Input Data" (:issue:`558`). Thanks :user:`altaurog`.
- Test against Python 3.6.

2.10.5 (2016-12-19)
-------------------

Bug fixes:

- Reset user-defined kwargs passed to ``ValidationError`` on each ``Schema.load`` call (:issue:`565`). Thanks :user:`jbasko` for the catch and patch.

Support:

- Tests: Fix redefinition of ``test_utils.test_get_value()`` (:issue:`562`). Thanks :user:`nelfin`.

2.10.4 (2016-11-18)
-------------------

Bug fixes:

- `Function` field works with callables that use Python 3 type annotations (:issue:`540`). Thanks :user:`martinstein` for reporting and thanks :user:`sabinem`, :user:`lafrech`, and :user:`maximkulkin` for the work on the PR.

2.10.3 (2016-10-02)
-------------------

Bug fixes:

- Fix behavior for serializing missing data with ``Number`` fields when ``as_string=True`` is passed (:issue:`538`). Thanks :user:`jessemyers` for reporting.

2.10.2 (2016-09-25)
-------------------

Bug fixes:

- Use fixed-point notation rather than engineering notation when serializing with ``Decimal`` (:issue:`534`). Thanks :user:`gdub`.
- Fix UUID validation on serialization and deserialization of ``uuid.UUID`` objects (:issue:`532`). Thanks :user:`pauljz`.

2.10.1 (2016-09-14)
-------------------

Bug fixes:

- Fix behavior when using ``validate.Equal(False)`` (:issue:`484`). Thanks :user:`pktangyue` for reporting and thanks :user:`tuukkamustonen` for the fix.
- Fix ``strict`` behavior when errors are raised in ``pre_dump``/``post_dump`` processors (:issue:`521`). Thanks :user:`tvuotila` for the catch and patch.
- Fix validation of nested fields on dumping (:issue:`528`). Thanks again :user:`tvuotila`.

2.10.0 (2016-09-05)
-------------------

Features:

- Errors raised by pre/post-load/dump methods will be added to a schema's errors dictionary (:issue:`472`). Thanks :user:`dbertouille` for the suggestion and for the PR.

2.9.1 (2016-07-21)
------------------

Bug fixes:

- Fix serialization of ``datetime.time`` objects with microseconds (:issue:`464`). Thanks :user:`Tim-Erwin` for reporting and thanks :user:`vuonghv` for the fix.
- Make ``@validates`` consistent with field validator behavior: if validation fails, the field will not be included in the deserialized output (:issue:`391`). Thanks :user:`martinstein` for reporting and thanks :user:`vuonghv` for the fix.

2.9.0 (2016-07-06)
------------------

- ``Decimal`` field coerces input values to a string before deserializing to a `decimal.Decimal` object in order to avoid transformation of float values under 12 significant digits (:issue:`434`, :issue:`435`). Thanks :user:`davidthornton` for the PR.

2.8.0 (2016-06-23)
------------------

Features:

- Allow ``only`` and ``exclude`` parameters to take nested fields, using dot-delimited syntax (e.g. ``only=['blog.author.email']``) (:issue:`402`). Thanks :user:`Tim-Erwin` and :user:`deckar01` for the discussion and implementation.

Support:

- Update tasks.py for compatibility with invoke>=0.13.0. Thanks :user:`deckar01`.

2.7.3 (2016-05-05)
------------------

- Make ``field.parent`` and ``field.name`` accessible to ``on_bind_field`` (:issue:`449`). Thanks :user:`immerrr`.

2.7.2 (2016-04-27)
------------------

No code changes in this release. This is a reupload in order to distribute an sdist for the last hotfix release. See :issue:`443`.

Support:

- Update license entry in setup.py to fix RPM distributions (:issue:`433`). Thanks :user:`rrajaravi` for reporting.

2.7.1 (2016-04-08)
------------------

Bug fixes:

- Only add Schemas to class registry if a class name is provided. This allows Schemas to be
  constructed dynamically using the ``type`` constructor without getting added to the class registry (which is useful for saving memory).

2.7.0 (2016-04-04)
------------------

Features:

- Make context available to ``Nested`` field's ``on_bind_field`` method (:issue:`408`). Thanks :user:`immerrr` for the PR.
- Pass through user ``ValidationError`` kwargs (:issue:`418`). Thanks :user:`russelldavies` for helping implement this.

Other changes:

- Remove unused attributes ``root``, ``parent``, and ``name`` from ``SchemaABC`` (:issue:`410`). Thanks :user:`Tim-Erwin` for the PR.

2.6.1 (2016-03-17)
------------------

Bug fixes:

- Respect ``load_from`` when reporting errors for nested required fields (:issue:`414`). Thanks :user:`yumike`.

2.6.0 (2016-02-01)
------------------

Features:

- Add ``partial`` argument to ``Schema.validate`` (:issue:`379`). Thanks :user:`tdevelioglu` for the PR.
- Add ``equal`` argument to ``validate.Length``. Thanks :user:`daniloakamine`.
- Collect all validation errors for each item deserialized by a ``List`` field (:issue:`345`). Thanks :user:`maximkulkin` for the report and the PR.

2.5.0 (2016-01-16)
------------------

Features:

- Allow a tuple of field names to be passed as the ``partial`` argument to ``Schema.load`` (:issue:`369`). Thanks :user:`tdevelioglu` for the PR.
- Add ``schemes`` argument to ``validate.URL`` (:issue:`356`).

2.4.2 (2015-12-08)
------------------

Bug fixes:

- Prevent duplicate error messages when validating nested collections (:issue:`360`). Thanks :user:`alexmorken` for the catch and patch.

2.4.1 (2015-12-07)
------------------

Bug fixes:

- Serializing an iterator will not drop the first item (:issue:`343`, :issue:`353`). Thanks :user:`jmcarp` for the patch. Thanks :user:`edgarallang` and :user:`jmcarp` for reporting.

2.4.0 (2015-12-06)
------------------

Features:

- Add ``skip_on_field_errors`` parameter to ``validates_schema`` (:issue:`323`). Thanks :user:`jjvattamattom` for the suggestion and :user:`d-sutherland` for the PR.

Bug fixes:

- Fix ``FormattedString`` serialization (:issue:`348`). Thanks :user:`acaird` for reporting.
- Fix ``@validates`` behavior when used when ``attribute`` is specified and ``strict=True`` (:issue:`350`). Thanks :user:`density` for reporting.

2.3.0 (2015-11-22)
------------------

Features:

- Add ``dump_to`` parameter to fields (:issue:`310`). Thanks :user:`ShayanArmanPercolate` for the suggestion. Thanks :user:`franciscod` and :user:`ewang` for the PRs.
- The ``deserialize`` function passed to ``fields.Function`` can optionally receive a ``context`` argument (:issue:`324`). Thanks :user:`DamianHeard`.
- The ``serialize`` function passed to ``fields.Function`` is optional (:issue:`325`). Thanks again :user:`DamianHeard`.
- The ``serialize`` function passed to ``fields.Method`` is optional (:issue:`329`). Thanks :user:`justanr`.

Deprecation/Removal:

- The ``func`` argument of ``fields.Function`` has been renamed to ``serialize``.
- The ``method_name`` argument of ``fields.Method`` has been renamed to ``serialize``.

``func`` and ``method_name`` are still present for backwards-compatibility, but they will both be removed in marshmallow 3.0.

2.2.1 (2015-11-11)
------------------

Bug fixes:

- Skip field validators for fields that aren't included in ``only`` (:issue:`320`). Thanks :user:`carlos-alberto` for reporting and :user:`eprikazc` for the PR.

2.2.0 (2015-10-26)
------------------

Features:

- Add support for partial deserialization with the ``partial`` argument to ``Schema`` and ``Schema.load`` (:issue:`290`). Thanks :user:`taion`.

Deprecation/Removals:

- ``Query`` and ``QuerySelect`` fields are removed.
- Passing of strings to ``required`` and ``allow_none`` is removed. Pass the ``error_messages`` argument instead.

Support:

- Add example of Schema inheritance in docs (:issue:`225`). Thanks :user:`martinstein` for the suggestion and :user:`juanrossi` for the PR.
- Add "Customizing Error Messages" section to custom fields docs.

2.1.3 (2015-10-18)
------------------

Bug fixes:

- Fix serialization of collections for which ``iter`` will modify position, e.g. Pymongo cursors (:issue:`303`). Thanks :user:`Mise` for the catch and patch.

2.1.2 (2015-10-14)
------------------

Bug fixes:

- Fix passing data to schema validator when using ``@validates_schema(many=True)`` (:issue:`297`). Thanks :user:`d-sutherland` for reporting.
- Fix usage of ``@validates`` with a nested field when ``many=True`` (:issue:`298`). Thanks :user:`nelfin` for the catch and patch.

2.1.1 (2015-10-07)
------------------

Bug fixes:

- ``Constant`` field deserializes to its value regardless of whether its field name is present in input data (:issue:`291`). Thanks :user:`fayazkhan` for reporting.

2.1.0 (2015-09-30)
------------------

Features:

- Add ``Dict`` field for arbitrary mapping data (:issue:`251`). Thanks :user:`dwieeb` for adding this and :user:`Dowwie` for the suggestion.
- Add ``Field.root`` property, which references the field's Schema.

Deprecation/Removals:

- The ``extra`` param of ``Schema`` is deprecated. Add extra data in a ``post_load`` method instead.
- ``UnmarshallingError`` and ``MarshallingError`` are removed.

Bug fixes:

- Fix storing multiple schema-level validation errors (:issue:`287`). Thanks :user:`evgeny-sureev` for the patch.
- If ``missing=None`` on a field, ``allow_none`` will be set to ``True``.

Other changes:

- A ``List's`` inner field will have the list field set as its parent. Use ``root`` to access the ``Schema``.

2.0.0 (2015-09-25)
------------------

Features:

- Make error messages configurable at the class level and instance level (``Field.default_error_messages`` attribute and ``error_messages`` parameter, respectively).

Deprecation/Removals:

- Remove ``make_object``. Use a ``post_load`` method instead (:issue:`277`).
- Remove the ``error`` parameter and attribute of ``Field``.
- Passing string arguments to ``required`` and ``allow_none`` is deprecated. Pass the ``error_messages`` argument instead. **This API will be removed in version 2.2**.
- Remove ``Arbitrary``, ``Fixed``, and ``Price`` fields (:issue:`86`). Use ``Decimal`` instead.
- Remove ``Select`` / ``Enum`` fields (:issue:`135`). Use the ``OneOf`` validator instead.

Bug fixes:

- Fix error format for ``Nested`` fields when ``many=True``. Thanks :user:`alexmorken`.
- ``pre_dump`` methods are invoked before implicit field creation. Thanks :user:`makmanalp` for reporting.
- Return correct "required" error message for ``Nested`` field.
- The ``only`` argument passed to a ``Schema`` is bounded by the ``fields`` option (:issue:`183`). Thanks :user:`lustdante` for the suggestion.

Changes from 2.0.0rc2:

- ``error_handler`` and ``accessor`` options are replaced with the ``handle_error`` and ``get_attribute`` methods :issue:`284`.
- Remove ``marshmallow.compat.plain_function`` since it is no longer used.
- Non-collection values are invalid input for ``List`` field (:issue:`231`). Thanks :user:`density` for reporting.
- Bug fix: Prevent infinite loop when validating a required, self-nested field. Thanks :user:`Bachmann1234` for the fix.

2.0.0rc2 (2015-09-16)
---------------------

Deprecation/Removals:

- ``make_object`` is deprecated. Use a ``post_load`` method instead (:issue:`277`). **This method will be removed in the final 2.0 release**.
- ``Schema.accessor`` and ``Schema.error_handler`` decorators are deprecated. Define the ``accessor`` and ``error_handler`` class Meta options instead.

Bug fixes:

- Allow non-field names to be passed to ``ValidationError`` (:issue:`273`). Thanks :user:`evgeny-sureev` for the catch and patch.

Changes from 2.0.0rc1:

- The ``raw`` parameter of the ``pre_*``, ``post_*``, ``validates_schema`` decorators was renamed to ``pass_many`` (:issue:`276`).
- Add ``pass_original`` parameter to ``post_load`` and ``post_dump`` (:issue:`216`).
- Methods decorated with the ``pre_*``, ``post_*``, and ``validates_*`` decorators must be instance methods. Class methods and instance methods are not supported at this time.

2.0.0rc1 (2015-09-13)
---------------------

Features:

- *Backwards-incompatible*: ``fields.Field._deserialize`` now takes ``attr`` and ``data`` as arguments (:issue:`172`). Thanks :user:`alexmic` and :user:`kevinastone` for the suggestion.
- Allow a ``Field's`` ``attribute`` to be modified during deserialization (:issue:`266`). Thanks :user:`floqqi`.
- Allow partially-valid data to be returned for ``Nested`` fields (:issue:`269`). Thanks :user:`jomag` for the suggestion.
- Add ``Schema.on_bind_field`` hook which allows a ``Schema`` to modify its fields when they are bound.
- Stricter validation of string, boolean, and number fields (:issue:`231`). Thanks :user:`touilleMan` for the suggestion.
- Improve consistency of error messages.

Deprecation/Removals:

- ``Schema.validator``, ``Schema.preprocessor``, and ``Schema.data_handler`` are removed. Use ``validates_schema``, ``pre_load``, and ``post_dump`` instead.
- ``QuerySelect``  and ``QuerySelectList`` are deprecated (:issue:`227`). **These fields will be removed in version 2.1.**
- ``utils.get_callable_name`` is removed.

Bug fixes:

- If a date format string is passed to a ``DateTime`` field, it is always used for deserialization (:issue:`248`). Thanks :user:`bartaelterman` and :user:`praveen-p`.

Support:

- Documentation: Add "Using Context" section to "Extending Schemas" page (:issue:`224`).
- Include tests and docs in release tarballs (:issue:`201`).
- Test against Python 3.5.

2.0.0b5 (2015-08-23)
--------------------

Features:

- If a field corresponds to a callable attribute, it will be called upon serialization. Thanks :user:`alexmorken`.
- Add ``load_only`` and ``dump_only`` ``class Meta`` options. Thanks :user:`kelvinhammond`.
- If a ``Nested`` field is required, recursively validate any required fields in the nested schema (:issue:`235`). Thanks :user:`max-orhai`.
- Improve error message if a list of dicts is not passed to a ``Nested`` field for which ``many=True``. Thanks again :user:`max-orhai`.

Bug fixes:

- ``make_object`` is only called after all validators and postprocessors have finished (:issue:`253`). Thanks :user:`sunsongxp` for reporting.
- If an invalid type is passed to ``Schema`` and ``strict=False``, store a ``_schema`` error in the errors dict rather than raise an exception (:issue:`261`). Thanks :user:`density` for reporting.

Other changes:

- ``make_object`` is only called when input data are completely valid (:issue:`243`). Thanks :user:`kissgyorgy` for reporting.
- Change default error messages for ``URL`` and ``Email`` validators so that they don't include user input (:issue:`255`).
- ``Email`` validator permits email addresses with non-ASCII characters, as per RFC 6530 (:issue:`221`). Thanks :user:`lextoumbourou` for reporting and :user:`mwstobo` for sending the patch.

2.0.0b4 (2015-07-07)
--------------------

Features:

- ``List`` field respects the ``attribute`` argument of the inner field. Thanks :user:`jmcarp`.
- The ``container`` field ``List`` field has access to its parent ``Schema`` via its ``parent`` attribute. Thanks again :user:`jmcarp`.

Deprecation/Removals:

- Legacy validator functions have been removed (:issue:`73`). Use the class-based validators in ``marshmallow.validate`` instead.

Bug fixes:

- ``fields.Nested`` correctly serializes nested ``sets`` (:issue:`233`). Thanks :user:`traut`.

Changes from 2.0.0b3:

- If ``load_from`` is used on deserialization, the value of ``load_from`` is used as the key in the errors dict (:issue:`232`). Thanks :user:`alexmorken`.

2.0.0b3 (2015-06-14)
---------------------

Features:

- Add ``marshmallow.validates_schema`` decorator for defining schema-level validators (:issue:`116`).
- Add ``marshmallow.validates`` decorator for defining field validators as Schema methods (:issue:`116`). Thanks :user:`philtay`.
- Performance improvements.
- Defining ``__marshallable__`` on complex objects is no longer necessary.
- Add ``fields.Constant``. Thanks :user:`kevinastone`.

Deprecation/Removals:

- Remove ``skip_missing`` class Meta option. By default, missing inputs are excluded from serialized output (:issue:`211`).
- Remove optional ``context`` parameter that gets passed to methods for ``Method`` fields.
- ``Schema.validator`` is deprecated. Use ``marshmallow.validates_schema`` instead.
- ``utils.get_func_name`` is removed. Use ``utils.get_callable_name`` instead.

Bug fixes:

- Fix serializing values from keyed tuple types (regression of :issue:`28`). Thanks :user:`makmanalp` for reporting.

Other changes:

- Remove unnecessary call to ``utils.get_value`` for ``Function`` and ``Method`` fields (:issue:`208`). Thanks :user:`jmcarp`.
- Serializing a collection without passing ``many=True`` will not result in an error. Be very careful to pass the ``many`` argument when necessary.

Support:

- Documentation: Update Flask and Peewee examples. Update Quickstart.

Changes from 2.0.0b2:

- ``Boolean`` field serializes ``None`` to ``None``, for consistency with other fields (:issue:`213`). Thanks :user:`cmanallen` for reporting.
- Bug fix: ``load_only`` fields do not get validated during serialization.
- Implicit passing of original, raw data to Schema validators is removed. Use ``@marshmallow.validates_schema(pass_original=True)`` instead.

2.0.0b2 (2015-05-03)
--------------------

Features:

- Add useful ``__repr__`` methods to validators (:issue:`204`). Thanks :user:`philtay`.
- *Backwards-incompatible*: By default, ``NaN``, ``Infinity``, and ``-Infinity`` are invalid values for ``fields.Decimal``. Pass ``allow_nan=True`` to allow these values. Thanks :user:`philtay`.

Changes from 2.0.0b1:

- Fix serialization of ``None`` for ``Time``, ``TimeDelta``, and ``Date`` fields (a regression introduced in 2.0.0a1).

Includes bug fixes from 1.2.6.

2.0.0b1 (2015-04-26)
--------------------

Features:

- Errored fields will not appear in (de)serialized output dictionaries (:issue:`153`, :issue:`202`).
- Instantiate ``OPTIONS_CLASS`` in ``SchemaMeta``. This makes ``Schema.opts`` available in metaclass methods. It also causes validation to occur earlier (upon ``Schema`` class declaration rather than instantiation).
- Add ``SchemaMeta.get_declared_fields`` class method to support adding additional declared fields.

Deprecation/Removals:

- Remove ``allow_null`` parameter of ``fields.Nested`` (:issue:`203`).

Changes from 2.0.0a1:

- Fix serialization of `None` for ``fields.Email``.

2.0.0a1 (2015-04-25)
--------------------

Features:

- *Backwards-incompatible*: When ``many=True``, the errors dictionary returned by ``dump`` and ``load`` will be keyed on the indices of invalid items in the (de)serialized collection (:issue:`75`). Add ``index_errors=False`` on a Schema's ``class Meta`` options to disable this behavior.
- *Backwards-incompatible*: By default, fields will raise a ValidationError if the input is ``None``. The ``allow_none`` parameter can override this behavior.
- *Backwards-incompatible*: A ``Field's`` ``default`` parameter is only used if explicitly set and the field's value is missing in the input to `Schema.dump`. If not set, the key will not be present in the serialized output for missing values . This is the behavior for *all* fields. ``fields.Str`` no longer defaults to ``''``, ``fields.Int`` no longer defaults to ``0``, etc. (:issue:`199`). Thanks :user:`jmcarp` for the feedback.
- In ``strict`` mode, a ``ValidationError`` is raised. Error messages are accessed via the ``ValidationError's`` ``messages`` attribute (:issue:`128`).
- Add ``allow_none`` parameter to ``fields.Field``. If ``False`` (the default), validation fails when the field's value is ``None`` (:issue:`76`, :issue:`111`). If ``allow_none`` is ``True``, ``None`` is considered valid and will deserialize to ``None``.
- Schema-level validators can store error messages for multiple fields (:issue:`118`). Thanks :user:`ksesong` for the suggestion.
- Add ``pre_load``, ``post_load``, ``pre_dump``, and ``post_dump`` Schema method decorators for defining pre- and post- processing routines (:issue:`153`, :issue:`179`). Thanks :user:`davidism`, :user:`taion`, and :user:`jmcarp` for the suggestions and feedback. Thanks :user:`taion` for the implementation.
- Error message for ``required`` validation is configurable. (:issue:`78`). Thanks :user:`svenstaro` for the suggestion. Thanks :user:`0xDCA` for the implementation.
- Add ``load_from`` parameter to fields (:issue:`125`). Thanks :user:`hakjoon`.
- Add ``load_only`` and ``dump_only`` parameters to fields (:issue:`61`, :issue:`87`). Thanks :user:`philtay`.
- Add `missing` parameter to fields (:issue:`115`). Thanks :user:`philtay`.
- Schema validators can take an optional ``raw_data`` argument which contains raw input data, incl. data not specified in the schema (:issue:`127`). Thanks :user:`ryanlowe0`.
- Add ``validate.OneOf`` (:issue:`135`) and ``validate.ContainsOnly`` (:issue:`149`) validators. Thanks :user:`philtay`.
- Error messages for validators can be interpolated with `{input}` and other values (depending on the validator).
- ``fields.TimeDelta`` always serializes to an integer value in order to avoid rounding errors (:issue:`105`). Thanks :user:`philtay`.
- Add ``include`` class Meta option to support field names which are Python keywords (:issue:`139`). Thanks :user:`nickretallack` for the suggestion.
- ``exclude`` parameter is respected when used together with ``only`` parameter (:issue:`165`). Thanks :user:`lustdante` for the catch and patch.
- ``fields.List`` works as expected with generators and sets (:issue:`185`). Thanks :user:`sergey-aganezov-jr`.

Deprecation/Removals:

- ``MarshallingError`` and ``UnmarshallingError`` error are deprecated in favor of a single ``ValidationError`` (:issue:`160`).
- ``context`` argument passed to Method fields is deprecated. Use ``self.context`` instead (:issue:`184`).
- Remove ``ForcedError``.
- Remove support for generator functions that yield validators (:issue:`74`). Plain generators of validators are still supported.
- The ``Select/Enum`` field is deprecated in favor of using ``validate.OneOf`` validator (:issue:`135`).
- Remove legacy, pre-1.0 API (``Schema.data`` and ``Schema.errors`` properties) (:issue:`73`).
- Remove ``null`` value.

Other changes:

- ``Marshaller``, ``Unmarshaller`` were moved to ``marshmallow.marshalling``. These should be considered private API (:issue:`129`).
- Make ``allow_null=True`` the default for ``Nested`` fields. This will make ``None`` serialize to ``None`` rather than a dictionary with empty values (:issue:`132`). Thanks :user:`nickrellack` for the suggestion.

1.2.6 (2015-05-03)
------------------

Bug fixes:

- Fix validation error message for ``fields.Decimal``.
- Allow error message for ``fields.Boolean`` to be customized with the ``error`` parameter (like other fields).

1.2.5 (2015-04-25)
------------------

Bug fixes:

- Fix validation of invalid types passed to a ``Nested`` field when ``many=True`` (:issue:`188`). Thanks :user:`juanrossi` for reporting.

Support:

- Fix pep8 dev dependency for flake8. Thanks :user:`taion`.

1.2.4 (2015-03-22)
------------------

Bug fixes:

- Fix behavior of ``as_string`` on ``fields.Integer`` (:issue:`173`). Thanks :user:`taion` for the catch and patch.

Other changes:

- Remove dead code from ``fields.Field``. Thanks :user:`taion`.

Support:

- Correction to ``_postprocess`` method in docs. Thanks again :user:`taion`.

1.2.3 (2015-03-15)
------------------

Bug fixes:

- Fix inheritance of ``ordered`` class Meta option (:issue:`162`). Thanks :user:`stephenfin` for reporting.

1.2.2 (2015-02-23)
------------------

Bug fixes:

- Fix behavior of ``skip_missing`` and ``accessor`` options when ``many=True`` (:issue:`137`). Thanks :user:`3rdcycle`.
- Fix bug that could cause an ``AttributeError`` when nesting schemas with schema-level validators (:issue:`144`). Thanks :user:`vovanbo` for reporting.

1.2.1 (2015-01-11)
------------------

Bug fixes:

- A ``Schema's`` ``error_handler``--if defined--will execute if ``Schema.validate`` returns validation errors (:issue:`121`).
- Deserializing `None` returns `None` rather than raising an ``AttributeError`` (:issue:`123`). Thanks :user:`RealSalmon` for the catch and patch.

1.2.0 (2014-12-22)
------------------

Features:

- Add ``QuerySelect`` and ``QuerySelectList`` fields (:issue:`84`).
- Convert validators in ``marshmallow.validate`` into class-based callables to make them easier to use when declaring fields (:issue:`85`).
- Add ``Decimal`` field which is safe to use when dealing with precise numbers (:issue:`86`).

Thanks :user:`philtay` for these contributions.

Bug fixes:

- ``Date`` fields correctly deserializes to a ``datetime.date`` object when ``python-dateutil`` is not installed (:issue:`79`). Thanks :user:`malexer` for the catch and patch.
- Fix bug that raised an ``AttributeError`` when using a class-based validator.
- Fix ``as_string`` behavior of Number fields when serializing to default value.
- Deserializing ``None`` or the empty string with either a ``DateTime``, ``Date``, ``Time`` or ``TimeDelta`` results in the correct unmarshalling errors (:issue:`96`). Thanks :user:`svenstaro` for reporting and helping with this.
- Fix error handling when deserializing invalid UUIDs (:issue:`106`). Thanks :user:`vesauimonen` for the catch and patch.
- ``Schema.loads`` correctly defaults to use the value of ``self.many`` rather than defaulting to ``False`` (:issue:`108`). Thanks :user:`davidism` for the catch and patch.
- Validators, data handlers, and preprocessors are no longer shared between schema subclasses (:issue:`88`). Thanks :user:`amikholap` for reporting.
- Fix error handling when passing a ``dict`` or ``list`` to a ``ValidationError`` (:issue:`110`). Thanks :user:`ksesong` for reporting.

Deprecation:

- The validator functions in the ``validate`` module are deprecated in favor of the class-based validators (:issue:`85`).
- The ``Arbitrary``, ``Price``, and ``Fixed`` fields are deprecated in favor of the ``Decimal`` field (:issue:`86`).

Support:

- Update docs theme.
- Update contributing docs (:issue:`77`).
- Fix namespacing example in "Extending Schema" docs. Thanks :user:`Ch00k`.
- Exclude virtualenv directories from syntax checking (:issue:`99`). Thanks :user:`svenstaro`.


1.1.0 (2014-12-02)
------------------

Features:

- Add ``Schema.validate`` method which validates input data against a schema. Similar to ``Schema.load``, but does not call ``make_object`` and only returns the errors dictionary.
- Add several validation functions to the ``validate`` module. Thanks :user:`philtay`.
- Store field name and instance on exceptions raised in ``strict`` mode.

Bug fixes:

- Fix serializing dictionaries when field names are methods of ``dict`` (e.g. ``"items"``). Thanks :user:`rozenm` for reporting.
- If a Nested field is passed ``many=True``, ``None`` serializes to an empty list. Thanks :user:`nickretallack` for reporting.
- Fix behavior of ``many`` argument passed to ``dump`` and ``load``. Thanks :user:`svenstaro` for reporting and helping with this.
- Fix ``skip_missing`` behavior for ``String`` and ``List`` fields. Thanks :user:`malexer` for reporting.
- Fix compatibility with python-dateutil 2.3.
- More consistent error messages across ``DateTime``, ``TimeDelta``, ``Date``, and ``Time`` fields.

Support:

- Update Flask and Peewee examples.

1.0.1 (2014-11-18)
------------------

Hotfix release.

- Ensure that errors dictionary is correctly cleared on each call to ``Schema.dump`` and ``Schema.load``.

1.0.0 (2014-11-16)
------------------

Adds new features, speed improvements, better error handling, and updated documentation.

- Add ``skip_missing`` ``class Meta`` option.
- A field's ``default`` may be a callable.
- Allow accessor function to be configured via the ``Schema.accessor`` decorator or the ``__accessor__`` class member.
- ``URL`` and ``Email`` fields are validated upon serialization.
- ``dump`` and ``load`` can receive the ``many`` argument.
- Move a number of utility functions from fields.py to utils.py.
- More useful ``repr`` for ``Field`` classes.
- If a field's default is ``fields.missing`` and its serialized value is ``None``, it will not be included in the final serialized result.
- Schema.dumps no longer coerces its result to a binary string on Python 3.
- *Backwards-incompatible*: Schema output is no longer an ``OrderedDict`` by default. If you want ordered field output, you must explicitly set the ``ordered`` option to ``True``.
- *Backwards-incompatible*: ``error`` parameter of the ``Field`` constructor is deprecated. Raise a ``ValidationError`` instead.
- Expanded test coverage.
- Updated docs.

1.0.0-a (2014-10-19)
--------------------

Major reworking and simplification of the public API, centered around support for deserialization, improved validation, and a less stateful ``Schema`` class.

* Rename ``Serializer`` to ``Schema``.
* Support for deserialization.
* Use the ``Schema.dump`` and ``Schema.load`` methods for serializing and deserializing, respectively.
* *Backwards-incompatible*: Remove ``Serializer.json`` and ``Serializer.to_json``. Use ``Schema.dumps`` instead.
* Reworked fields interface.
* *Backwards-incompatible*: ``Field`` classes implement ``_serialize`` and ``_deserialize`` methods. ``serialize`` and ``deserialize`` comprise the public API for a ``Field``. ``Field.format`` and ``Field.output`` have been removed.
* Add ``exceptions.ForcedError`` which allows errors to be raised during serialization (instead of storing errors in the ``errors`` dict).
* *Backwards-incompatible*: ``DateTime`` field serializes to ISO8601 format by default (instead of RFC822).
* *Backwards-incompatible*: Remove ``Serializer.factory`` method. It is no longer necessary with the ``dump`` method.
* *Backwards-incompatible*: Allow nesting a serializer within itself recursively. Use ``exclude`` or ``only`` to prevent infinite recursion.
* *Backwards-incompatible*: Multiple errors can be stored for a single field. The errors dictionary returned by ``load`` and ``dump`` have lists of error messages keyed by field name.
* Remove ``validated`` decorator. Validation occurs within ``Field`` methods.
* ``Function`` field raises a ``ValueError`` if an uncallable object is passed to its constructor.
* ``Nested`` fields inherit context from their parent.
* Add ``Schema.preprocessor`` and ``Schema.validator`` decorators for registering preprocessing and schema-level validation functions respectively.
* Custom error messages can be specified by raising a ``ValidationError`` within a validation function.
* Extra keyword arguments passed to a Field are stored as metadata.
* Fix ordering of field output.
* Fix behavior of the ``required`` parameter on ``Nested`` fields.
* Fix serializing keyed tuple types (e.g. ``namedtuple``) with ``class Meta`` options.
* Fix default value for ``Fixed`` and ``Price`` fields.
* Fix serialization of binary strings.
* ``Schemas`` can inherit fields from non-``Schema`` base classes (e.g. mixins). Also, fields are inherited according to the MRO (rather than recursing over base classes). Thanks :user:`jmcarp`.
* Add ``Str``, ``Bool``, and ``Int`` field class aliases.

0.7.0 (2014-06-22)
------------------

* Add ``Serializer.error_handler`` decorator that registers a custom error handler.
* Add ``Serializer.data_handler`` decorator that registers data post-processing callbacks.
* *Backwards-incompatible*: ``process_data`` method is deprecated. Use the ``data_handler`` decorator instead.
* Fix bug that raised error when passing ``extra`` data together with ``many=True``. Thanks :user:`buttsicles` for reporting.
* If ``required=True`` validation is violated for a given ``Field``, it will raise an error message that is different from the message specified by the ``error`` argument. Thanks :user:`asteinlein`.
* More generic error message raised when required field is missing.
* ``validated`` decorator should only wrap a ``Field`` class's ``output`` method.

0.6.0 (2014-06-03)
------------------

* Fix bug in serializing keyed tuple types, e.g. ``namedtuple`` and ``KeyedTuple``.
* Nested field can load a serializer by its class name as a string. This makes it easier to implement 2-way nesting.
* Make ``Serializer.data`` override-able.

0.5.5 (2014-05-02)
------------------

* Add ``Serializer.factory`` for creating a factory function that returns a Serializer instance.
* ``MarshallingError`` stores its underlying exception as an instance variable. This is useful for inspecting errors.
* ``fields.Select`` is aliased to ``fields.Enum``.
* Add ``fields.__all__`` and ``marshmallow.__all__`` so that the modules can be more easily extended.
* Expose ``Serializer.OPTIONS_CLASS`` as a class variable so that options defaults can be overridden.
* Add ``Serializer.process_data`` hook that allows subclasses to manipulate the final output data.

0.5.4 (2014-04-17)
------------------

* Add ``json_module`` class Meta option.
* Add ``required`` option to fields . Thanks :user:`DeaconDesperado`.
* Tested on Python 3.4 and PyPy.

0.5.3 (2014-03-02)
------------------

* Fix ``Integer`` field default. It is now ``0`` instead of ``0.0``. Thanks :user:`kalasjocke`.
* Add ``context`` param to ``Serializer``. Allows accessing arbitrary objects in ``Function`` and ``Method`` fields.
* ``Function`` and ``Method`` fields raise ``MarshallingError`` if their argument is uncallable.


0.5.2 (2014-02-10)
------------------

* Enable custom field validation via the ``validate`` parameter.
* Add ``utils.from_rfc`` for parsing RFC datestring to Python datetime object.

0.5.1 (2014-02-02)
------------------

* Avoid unnecessary attribute access in ``utils.to_marshallable_type`` for improved performance.
* Fix RFC822 formatting for localized datetimes.

0.5.0 (2013-12-29)
------------------

* Can customize validation error messages by passing the ``error`` parameter to a field.
* *Backwards-incompatible*: Rename ``fields.NumberField`` -> ``fields.Number``.
* Add ``fields.Select``. Thanks :user:`ecarreras`.
* Support nesting a Serializer within itself by passing ``"self"`` into ``fields.Nested`` (only up to depth=1).
* *Backwards-incompatible*: No implicit serializing of collections. Must set ``many=True`` if serializing to a list. This ensures that marshmallow handles singular objects correctly, even if they are iterable.
* If Nested field ``only`` parameter is a field name, only return a single value for the nested object (instead of a dict) or a flat list of values.
* Improved performance and stability.

0.4.1 (2013-12-01)
------------------

* An object's ``__marshallable__`` method, if defined, takes precedence over ``__getitem__``.
* Generator expressions can be passed to a serializer.
* Better support for serializing list-like collections (e.g. ORM querysets).
* Other minor bugfixes.

0.4.0 (2013-11-24)
------------------

* Add ``additional`` `class Meta` option.
* Add ``dateformat`` `class Meta` option.
* Support for serializing UUID, date, time, and timedelta objects.
* Remove ``Serializer.to_data`` method. Just use ``Serialize.data`` property.
* String field defaults to empty string instead of ``None``.
* *Backwards-incompatible*: ``isoformat`` and ``rfcformat`` functions moved to utils.py.
* *Backwards-incompatible*: Validation functions moved to validate.py.
* *Backwards-incompatible*: Remove types.py.
* Reorder parameters to ``DateTime`` field (first parameter is dateformat).
* Ensure that ``to_json`` returns bytestrings.
* Fix bug with including an object property in ``fields`` Meta option.
* Fix bug with passing ``None`` to a serializer.

0.3.1 (2013-11-16)
------------------

* Fix bug with serializing dictionaries.
* Fix error raised when serializing empty list.
* Add ``only`` and ``exclude`` parameters to Serializer constructor.
* Add ``strict`` parameter and option: causes Serializer to raise an error if invalid data are passed in, rather than storing errors.
* Updated Flask + SQLA example in docs.

0.3.0 (2013-11-14)
------------------

* Declaring Serializers just got easier. The ``class Meta`` paradigm allows you to specify fields more concisely. Can specify ``fields`` and ``exclude`` options.
* Allow date formats to be changed by passing ``format`` parameter to ``DateTime`` field constructor. Can either be ``"rfc"`` (default), ``"iso"``, or a date format string.
* More useful error message when declaring fields as classes (instead of an instance, which is the correct usage).
* Rename ``MarshallingException`` -> ``MarshallingError``.
* Rename ``marshmallow.core`` -> ``marshmallow.serializer``.

0.2.1 (2013-11-12)
------------------

* Allow prefixing field names.
* Fix storing errors on Nested Serializers.
* Python 2.6 support.

0.2.0 (2013-11-11)
------------------

* Field-level validation.
* Add ``fields.Method``.
* Add ``fields.Function``.
* Allow binding of extra data to a serialized object by passing the ``extra`` param when initializing a ``Serializer``.
* Add ``relative`` parameter to ``fields.Url`` that allows for relative URLs.

0.1.0 (2013-11-10)
------------------

* First release.


================================================
FILE: CODE_OF_CONDUCT.md
================================================
For the marshmallow code of conduct, see https://marshmallow.readthedocs.io/en/latest/code_of_conduct.html


================================================
FILE: CONTRIBUTING.rst
================================================
Contributing guidelines
=======================

So you're interested in contributing to marshmallow or `one of our associated
projects <https://github.com/marshmallow-code>`__? That's awesome! We
welcome contributions from anyone willing to work in good faith with
other contributors and the community (see also our
:doc:`code_of_conduct`).

Security contact information
----------------------------

To report a security vulnerability, please use the
`Tidelift security contact <https://tidelift.com/security>`_.
Tidelift will coordinate the fix and disclosure.

Questions, feature requests, bug reports, and feedback…
-------------------------------------------------------

…should all be reported on the `Github Issue Tracker`_ .

.. _`Github Issue Tracker`: https://github.com/marshmallow-code/marshmallow/issues?state=open

Ways to contribute
------------------

- Comment on some of marshmallow's `open issues <https://github.com/marshmallow-code/marshmallow/issues>`_ (especially those `labeled "feedback welcome" <https://github.com/marshmallow-code/marshmallow/issues?q=is%3Aopen+is%3Aissue+label%3A%22feedback+welcome%22>`_). Share a solution or workaround. Make a suggestion for how a feature can be made better. Opinions are welcome!
- Improve `the docs <https://marshmallow.readthedocs.io>`_.
  For straightforward edits, click the edit button in the top-right corner of the page.
  See the :ref:`Documentation <contributing_documentation>` section of this page if you want to build the docs locally.
- If you think you've found a bug, `open an issue <https://github.com/marshmallow-code/marshmallow/issues>`_.
- Contribute an :ref:`example usage <contributing_examples>` of marshmallow.
- Send a PR for an open issue (especially one `labeled "help wanted" <https://github.com/marshmallow-code/marshmallow/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22>`_). The next section details how to contribute code.


Contributing code
-----------------

Setting up for local development
++++++++++++++++++++++++++++++++

1. Fork marshmallow_ on Github.

.. code-block:: shell-session

    $ git clone https://github.com/marshmallow-code/marshmallow.git
    $ cd marshmallow

2. Install development requirements. **It is highly recommended that you use a virtualenv.**
   Use the following command to install an editable version of
   marshmallow along with its development requirements.

.. code-block:: shell-session

    # After activating your virtualenv
    $ pip install -e '.[dev]'

3. Install the pre-commit hooks, which will format and lint your git staged files.

.. code-block:: shell-session

    # The pre-commit CLI was installed above
    $ pre-commit install --allow-missing-config

Git branch structure
++++++++++++++++++++

marshmallow abides by the following branching model:

``dev``
    Current development branch. **New features should branch off here**.

``X.Y-line``
    Maintenance branch for release ``X.Y``. **Bug fixes should be sent to the most recent release branch.** A maintainer will forward-port the fix to ``dev``. Note: exceptions may be made for bug fixes that introduce large code changes.

**Always make a new branch for your work**, no matter how small. Also, **do not put unrelated changes in the same branch or pull request**. This makes it more difficult to merge your changes.

Pull requests
++++++++++++++

1. Create a new local branch.

For a new feature:

.. code-block:: shell-session

    $ git checkout -b name-of-feature dev

For a bugfix:

.. code-block:: shell-session

    $ git checkout -b fix-something 3.x-line

2. Commit your changes. Write `good commit messages <https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_.

.. code-block:: shell-session

    $ git commit -m "Detailed commit message"
    $ git push origin name-of-feature

3. Before submitting a pull request, check the following:

- If the pull request adds functionality, it is tested and the docs are updated.
- You've added yourself to ``AUTHORS.rst``.

4. Submit a pull request to ``marshmallow-code:dev`` or the appropriate maintenance branch. The `CI <https://dev.azure.com/sloria1/sloria/_build/latest?definitionId=5&branchName=dev>`_ build must be passing before your pull request is merged.

Running tests
+++++++++++++

To run all tests:

.. code-block:: shell-session

    $ pytest

To run formatting and syntax checks:

.. code-block:: shell-session

    $ tox -e lint

(Optional) To run tests in all supported Python versions in their own virtual environments (must have each interpreter installed):

.. code-block:: shell-session

    $ tox

.. _contributing_documentation:

Documentation
+++++++++++++

Contributions to the documentation are welcome. Documentation is written in `reStructuredText`_ (rST). A quick rST reference can be found `here <https://docutils.sourceforge.io/docs/user/rst/quickref.html>`_. Builds are powered by Sphinx_.

To build and serve the docs in "watch" mode:

.. code-block:: shell-session

   $ tox -e docs-serve

Changes to documentation will automatically trigger a rebuild.


.. _contributing_examples:

Contributing examples
+++++++++++++++++++++

Have a usage example you'd like to share? A custom `Field <marshmallow.fields.Field>` that others might find useful? Feel free to add it to the `examples <https://github.com/marshmallow-code/marshmallow/tree/dev/examples>`_ directory and send a pull request.


.. _Sphinx: https://www.sphinx-doc.org/
.. _`reStructuredText`: https://docutils.sourceforge.io/rst.html
.. _marshmallow: https://github.com/marshmallow-code/marshmallow


================================================
FILE: LICENSE
================================================
Copyright Steven Loria and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: NOTICE
================================================
marshmallow includes code adapted from Django.

Django License
==============

Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. Neither the name of Django nor the names of its contributors may be used
       to endorse or promote products derived from this software without
       specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.rst
================================================
********************************************
marshmallow: simplified object serialization
********************************************

|pypi| |build-status| |pre-commit| |docs|

.. |pypi| image:: https://badgen.net/pypi/v/marshmallow
    :target: https://pypi.org/project/marshmallow/
    :alt: Latest version

.. |build-status| image:: https://github.com/marshmallow-code/marshmallow/actions/workflows/build-release.yml/badge.svg
    :target: https://github.com/marshmallow-code/marshmallow/actions/workflows/build-release.yml
    :alt: Build status

.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/marshmallow-code/marshmallow/dev.svg
   :target: https://results.pre-commit.ci/latest/github/marshmallow-code/marshmallow/dev
   :alt: pre-commit.ci status

.. |docs| image:: https://readthedocs.org/projects/marshmallow/badge/
   :target: https://marshmallow.readthedocs.io/
   :alt: Documentation

.. start elevator-pitch

**marshmallow** is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.

.. code-block:: python

    from datetime import date
    from pprint import pprint

    from marshmallow import Schema, fields


    class ArtistSchema(Schema):
        name = fields.Str()


    class AlbumSchema(Schema):
        title = fields.Str()
        release_date = fields.Date()
        artist = fields.Nested(ArtistSchema())


    bowie = dict(name="David Bowie")
    album = dict(artist=bowie, title="Hunky Dory", release_date=date(1971, 12, 17))

    schema = AlbumSchema()
    result = schema.dump(album)
    pprint(result, indent=2)
    # { 'artist': {'name': 'David Bowie'},
    #   'release_date': '1971-12-17',
    #   'title': 'Hunky Dory'}

In short, marshmallow schemas can be used to:

- **Validate** input data.
- **Deserialize** input data to app-level objects.
- **Serialize** app-level objects to primitive Python types. The serialized objects can then be rendered to standard formats such as JSON for use in an HTTP API.

Get it now
==========

.. code-block:: shell-session

    $ pip install -U marshmallow

.. end elevator-pitch

Documentation
=============

Full documentation is available at https://marshmallow.readthedocs.io/ .

Ecosystem
=========

A list of marshmallow-related libraries can be found at the GitHub wiki here:

https://github.com/marshmallow-code/marshmallow/wiki/Ecosystem

Credits
=======

Contributors
------------

This project exists thanks to all the people who contribute.

**You're highly encouraged to participate in marshmallow's development.**
Check out the `Contributing Guidelines <https://marshmallow.readthedocs.io/en/latest/contributing.html>`_ to see how you can help.

Thank you to all who have already contributed to marshmallow!

.. image:: https://opencollective.com/marshmallow/contributors.svg?width=890&button=false
    :target: https://marshmallow.readthedocs.io/en/latest/authors.html
    :alt: Contributors

Backers
-------

If you find marshmallow useful, please consider supporting the team with
a donation. Your donation helps move marshmallow forward.

Thank you to all our backers! [`Become a backer`_]

.. _`Become a backer`: https://opencollective.com/marshmallow#backer

.. image:: https://opencollective.com/marshmallow/backers.svg?width=890
    :target: https://opencollective.com/marshmallow#backers
    :alt: Backers

Sponsors
--------

.. start sponsors

marshmallow is sponsored by `Route4Me <https://route4me.com>`_.

.. image:: https://github.com/user-attachments/assets/018c2e23-032e-4a11-98da-8b6dc25b9054
    :target: https://route4me.com
    :alt: Routing Planner

Support this project by becoming a sponsor (or ask your company to support this project by becoming a sponsor).
Your logo will be displayed here with a link to your website. [`Become a sponsor`_]

.. _`Become a sponsor`: https://opencollective.com/marshmallow#sponsor

.. end sponsors

Professional Support
====================

Professionally-supported marshmallow is now available through the
`Tidelift Subscription <https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=pypi-marshmallow&utm_medium=readme>`_.

Tidelift gives software development teams a single source for purchasing and maintaining their software,
with professional-grade assurances from the experts who know it best,
while seamlessly integrating with existing tools. [`Get professional support`_]

.. _`Get professional support`: https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=marshmallow&utm_medium=referral&utm_campaign=github

.. image:: https://user-images.githubusercontent.com/2379650/45126032-50b69880-b13f-11e8-9c2c-abd16c433495.png
    :target: https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=pypi-marshmallow&utm_medium=readme
    :alt: Get supported marshmallow with Tidelift


Project Links
=============

- Docs: https://marshmallow.readthedocs.io/
- Changelog: https://marshmallow.readthedocs.io/en/latest/changelog.html
- Contributing Guidelines: https://marshmallow.readthedocs.io/en/latest/contributing.html
- PyPI: https://pypi.org/project/marshmallow/
- Issues: https://github.com/marshmallow-code/marshmallow/issues
- Donate: https://opencollective.com/marshmallow

License
=======

MIT licensed. See the bundled `LICENSE <https://github.com/marshmallow-code/marshmallow/blob/dev/LICENSE>`_ file for more details.


================================================
FILE: RELEASING.md
================================================
# Releasing

1. Bump version in `pyproject.toml` and update the changelog
   with today's date.
2. Commit: `git commit -m "Bump version and update changelog"`
3. Tag the commit: `git tag x.y.z`
4. Push: `git push --tags origin dev`. CI will take care of the
   PyPI release.


================================================
FILE: SECURITY.md
================================================
# Security Contact Information

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.


================================================
FILE: docs/.gitignore
================================================
marshmallow.docset
marshmallow.tgz


================================================
FILE: docs/_static/custom.css
================================================
/* Headings */

h2, h3, h4, h5, h6 {
  font-weight: 400;
}

/* UI elements: left and right sidebars, "Back to top" button, admonitions, Copy button */
.sidebar-drawer, .toc-drawer, .back-to-top, .admonition, .copybtn {
  /* Sans-serif system font stack */
  font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
}

/* Hide ToC caption text within the main body (but leave them in the side-bar). */
/* https://github.com/hynek/structlog/blob/b488a8bf589a01aabc41e3bf8df81a9848cd426c/docs/_static/custom.css#L17-L20 */
#furo-main-content span.caption-text {
  display: none;
}


================================================
FILE: docs/api_reference.rst
================================================
.. _api:

.. toctree::
    :caption: API Reference

    top_level
    marshmallow.schema
    marshmallow.fields
    marshmallow.decorators
    marshmallow.validate
    marshmallow.utils
    marshmallow.experimental.context
    marshmallow.exceptions

Private API
===========

.. toctree::
    :caption: Private API

    marshmallow.types
    marshmallow.class_registry
    marshmallow.error_store


================================================
FILE: docs/authors.rst
================================================
.. include:: ../AUTHORS.rst


================================================
FILE: docs/changelog.rst
================================================
.. seealso::
  Need help upgrading to newer versions? Check out the :doc:`upgrading guide <upgrading>`.

.. include:: ../CHANGELOG.rst


================================================
FILE: docs/code_of_conduct.rst
================================================
Code of Conduct
===============

This code of conduct applies to the marshmallow project and all associated
projects in the `marshmallow-code <https://github.com/marshmallow-code>`__
organization.


.. _coc-when-something-happens:

When something happens
----------------------

If you see a Code of Conduct violation, follow these steps:

1. Let the person know that what they did is not appropriate and ask
   them to stop and/or edit their message(s) or commits.
2. That person should immediately stop the behavior and correct the
   issue.
3. If this doesn’t happen, or if you're uncomfortable speaking up,
   :ref:`contact the maintainers <coc-contacting-maintainers>`.
4. As soon as possible, a maintainer will look into the issue, and take
   :ref:`further action (see below) <coc-further-enforcement>`, starting with
   a warning, then temporary block, then long-term repo or organization
   ban.

When reporting, please include any relevant details, links, screenshots,
context, or other information that may be used to better understand and
resolve the situation.

**The maintainer team will prioritize the well-being and comfort of the
recipients of the violation over the comfort of the violator.** See
:ref:`some examples below <coc-enforcement-examples>`.

Our pledge
----------

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers of this project pledge to making
participation in our community a harassment-free experience for
everyone, regardless of age, body size, disability, ethnicity, gender
identity and expression, level of experience, technical preferences,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

Our standards
-------------

Examples of behavior that contributes to creating a positive environment
include:

-  Using welcoming and inclusive language.
-  Being respectful of differing viewpoints and experiences.
-  Gracefully accepting constructive feedback.
-  Focusing on what is best for the community.
-  Showing empathy and kindness towards other community members.
-  Encouraging and raising up your peers in the project so you can all
   bask in hacks and glory.

Examples of unacceptable behavior by participants include:

-  The use of sexualized language or imagery and unwelcome sexual
   attention or advances, including when simulated online. The only
   exception to sexual topics is channels/spaces specifically for topics
   of sexual identity.
-  Casual mention of slavery or indentured servitude and/or false
   comparisons of one's occupation or situation to slavery. Please
   consider using or asking about alternate terminology when referring
   to such metaphors in technology.
-  Making light of/making mocking comments about trigger warnings and
   content warnings.
-  Trolling, insulting/derogatory comments, and personal or political
   attacks.
-  Public or private harassment, deliberate intimidation, or threats.
-  Publishing others' private information, such as a physical or
   electronic address, without explicit permission. This includes any
   sort of "outing" of any aspect of someone's identity without their
   consent.
-  Publishing private screenshots or quotes of interactions in the
   context of this project without all quoted users' *explicit* consent.
-  Publishing of private communication that doesn't have to do with
   reporting harassment.
-  Any of the above even when `presented as "ironic" or
   "joking" <https://en.wikipedia.org/wiki/Hipster_racism>`__.
-  Any attempt to present "reverse-ism" versions of the above as
   violations. Examples of reverse-isms are "reverse racism", "reverse
   sexism", "heterophobia", and "cisphobia".
-  Unsolicited explanations under the assumption that someone doesn't
   already know it. Ask before you teach! Don't assume what people's
   knowledge gaps are.
-  `Feigning or exaggerating
   surprise <https://www.recurse.com/manual#no-feigned-surprise>`__ when
   someone admits to not knowing something.
-  "`Well-actuallies <https://www.recurse.com/manual#no-well-actuallys>`__"
-  Other conduct which could reasonably be considered inappropriate in a
   professional or community setting.

Scope
-----

This Code of Conduct applies both within spaces involving this project
and in other spaces involving community members. This includes the
repository, its Pull Requests and Issue tracker, its Twitter community,
private email communications in the context of the project, and any
events where members of the project are participating, as well as
adjacent communities and venues affecting the project's members.

Depending on the violation, the maintainers may decide that violations
of this code of conduct that have happened outside of the scope of the
community may deem an individual unwelcome, and take appropriate action
to maintain the comfort and safety of its members.

.. _coc-other-community-standards:

Other community standards
~~~~~~~~~~~~~~~~~~~~~~~~~

As a project on GitHub, this project is additionally covered by the
`GitHub Community
Guidelines <https://help.github.com/articles/github-community-guidelines/>`__.

Enforcement of those guidelines after violations overlapping with the
above are the responsibility of the entities, and enforcement may happen
in any or all of the services/communities.

Maintainer enforcement process
------------------------------

Once the maintainers get involved, they will follow a documented series
of steps and do their best to preserve the well-being of project
members. This section covers actual concrete steps.


.. _coc-contacting-maintainers:

Contacting maintainers
~~~~~~~~~~~~~~~~~~~~~~

As a small project, we don't yet have a Code of Conduct
enforcement team. Hopefully that will be addressed as we grow, but for
now, any issues should be addressed to `@sloria
<https://github.com/sloria>`__, via `email <mailto:oss@stevenloria.com>`__
or any other medium that you feel comfortable with. Using words like
"marshmallow code of conduct" in your subject will help make sure your
message is noticed quickly.


.. _coc-further-enforcement:

Further enforcement
~~~~~~~~~~~~~~~~~~~

If you've already followed the :ref:`initial enforcement steps
<coc-when-something-happens>`, these are the steps maintainers will
take for further enforcement, as needed:

1. Repeat the request to stop.
2. If the person doubles down, they will be given an official warning. The PR or Issue
   may be locked.
3. If the behavior continues or is repeated later, the person will be
   blocked from participating for 24 hours.
4. If the behavior continues or is repeated after the temporary block, a
   long-term (6-12mo) ban will be used.
5. If after this the behavior still continues, a permanent ban may be
   enforced.

On top of this, maintainers may remove any offending messages, images,
contributions, etc, as they deem necessary.

Maintainers reserve full rights to skip any of these steps, at their
discretion, if the violation is considered to be a serious and/or
immediate threat to the health and well-being of members of the
community. These include any threats, serious physical or verbal
attacks, and other such behavior that would be completely unacceptable
in any social setting that puts our members at risk.

Members expelled from events or venues with any sort of paid attendance
will not be refunded.

Who watches the watchers?
~~~~~~~~~~~~~~~~~~~~~~~~~

Maintainers and other leaders who do not follow or enforce the Code of
Conduct in good faith may face temporary or permanent repercussions as
determined by other members of the project's leadership. These may
include anything from removal from the maintainer team to a permanent
ban from the community.

Additionally, as a project hosted on GitHub, :ref:`their Code of
Conduct may be applied against maintainers of this project
<coc-other-community-standards>`, externally of this project's
procedures.


.. _coc-enforcement-examples:

Enforcement examples
--------------------

The best case
~~~~~~~~~~~~~

The vast majority of situations work out like this. This interaction is
common, and generally positive.

    Alex: "Yeah I used X and it was really crazy!"

    Patt (not a maintainer): "Hey, could you not use that word? What
    about 'ridiculous' instead?"

    Alex: "oh sorry, sure." -> edits old comment to say "it was really
    confusing!"

The maintainer case
~~~~~~~~~~~~~~~~~~~

Sometimes, though, you need to get maintainers involved. Maintainers
will do their best to resolve conflicts, but people who were harmed by
something **will take priority**.

    Patt: "Honestly, sometimes I just really hate using $library and
    anyone who uses it probably sucks at their job."

    Alex: "Whoa there, could you dial it back a bit? There's a CoC thing
    about attacking folks' tech use like that."

    Patt: "I'm not attacking anyone, what's your problem?"

    Alex: "@maintainers hey uh. Can someone look at this issue? Patt is
    getting a bit aggro. I tried to nudge them about it, but nope."

    KeeperOfCommitBits: (on issue) "Hey Patt, maintainer here. Could you
    tone it down? This sort of attack is really not okay in this space."

    Patt: "Leave me alone I haven't said anything bad wtf is wrong with
    you."

    KeeperOfCommitBits: (deletes user's comment), "@patt I mean it.
    Please refer to the CoC over at (URL to this CoC) if you have
    questions, but you can consider this an actual warning. I'd
    appreciate it if you reworded your messages in this thread, since
    they made folks there uncomfortable. Let's try and be kind, yeah?"

    Patt: "@KeeperOfCommitBits Okay sorry. I'm just frustrated and I'm kinda
    burnt out and I guess I got carried away. I'll DM Alex a note
    apologizing and edit my messages. Sorry for the trouble."

    KeeperOfCommitBits: "@patt Thanks for that. I hear you on the
    stress. Burnout sucks :/. Have a good one!"

The nope case
~~~~~~~~~~~~~

    PepeTheFrog🐸: "Hi, I am a literal actual nazi and I think white
    supremacists are quite fashionable."

    Patt: "NOOOOPE. OH NOPE NOPE."

    Alex: "JFC NO. NOPE. @KeeperOfCommitBits NOPE NOPE LOOK HERE"

    KeeperOfCommitBits: "👀 Nope. NOPE NOPE NOPE. 🔥"

    PepeTheFrog🐸 has been banned from all organization or user
    repositories belonging to KeeperOfCommitBits.

Attribution
-----------

This Code of Conduct is based on `Trio's Code of Conduct <https://trio.readthedocs.io/en/latest/code-of-conduct.html>`_, which is based on the
`WeAllJS Code of Conduct <https://wealljs.org/code-of-conduct>`__, which
is itself based on `Contributor
Covenant <https://contributor-covenant.org>`__, version 1.4, available at
https://contributor-covenant.org/version/1/4, and the LGBTQ in Technology
Slack `Code of Conduct <https://lgbtq.technology/coc.html>`__.


================================================
FILE: docs/conf.py
================================================
import importlib.metadata

extensions = [
    "autodocsumm",
    "sphinx.ext.autodoc",
    "sphinx.ext.autodoc.typehints",
    "sphinx.ext.intersphinx",
    "sphinx.ext.viewcode",
    "sphinx_copybutton",
    "sphinx_issues",
    "sphinxext.opengraph",
]

primary_domain = "py"
default_role = "py:obj"

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

issues_github_path = "marshmallow-code/marshmallow"

source_suffix = ".rst"
master_doc = "index"

project = "marshmallow"
copyright = "Steven Loria and contributors"  # noqa: A001

version = release = importlib.metadata.version("marshmallow")

exclude_patterns = ["_build"]
# Ignore WARNING: more than one target found for cross-reference 'Schema': marshmallow.schema.Schema, marshmallow.Schema
suppress_warnings = ["ref.python"]

# THEME

html_theme = "furo"
html_theme_options = {
    "light_logo": "marshmallow-logo-with-title.png",
    "dark_logo": "marshmallow-logo-with-title-for-dark-theme.png",
    "source_repository": "https://github.com/marshmallow-code/marshmallow",
    "source_branch": "dev",
    "source_directory": "docs/",
    "sidebar_hide_name": True,
    "light_css_variables": {
        # Serif system font stack: https://systemfontstack.com/
        "font-stack": "Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;",
    },
    "top_of_page_buttons": ["view", "edit"],
}
pygments_dark_style = "lightbulb"
html_favicon = "_static/favicon.ico"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_copy_source = False  # Don't copy source files to _build/sources
html_show_sourcelink = False  # Don't link to source files
ogp_image = "_static/marshmallow-logo-200.png"

# Strip the dollar prompt when copying code
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#strip-and-configure-input-prompts-for-code-cells
copybutton_prompt_text = "$ "

autodoc_default_options = {
    "exclude-members": "__new__",
    # Don't show signatures in the summary tables
    "autosummary-nosignatures": True,
    # Don't render summaries for classes within modules
    "autosummary-no-nesting": True,
}
# Only display type hints next to params but not within the signature
# to avoid the signature from getting too long
autodoc_typehints = "description"


================================================
FILE: docs/contributing.rst
================================================
.. include:: ../CONTRIBUTING.rst


================================================
FILE: docs/custom_fields.rst
================================================
Custom fields
=============

There are three ways to create a custom-formatted field for a `Schema <marshmallow.Schema>`:

- Create a custom :class:`Field <marshmallow.fields.Field>` class
- Use a :class:`Method <marshmallow.fields.Method>` field
- Use a :class:`Function <marshmallow.fields.Function>` field

The method you choose will depend on the manner in which you intend to reuse the field.

Creating a field class
----------------------

To create a custom field class, create a subclass of :class:`marshmallow.fields.Field` and implement its :meth:`_serialize <marshmallow.fields.Field._serialize>` and/or :meth:`_deserialize <marshmallow.fields.Field._deserialize>` methods.
Field's type argument is the internal type, i.e. the type that the field deserializes to.

.. code-block:: python

    from marshmallow import fields, ValidationError


    class PinCode(fields.Field[list[int]]):
        """Field that serializes to a string of numbers and deserializes
        to a list of numbers.
        """

        def _serialize(self, value, attr, obj, **kwargs):
            if value is None:
                return ""
            return "".join(str(d) for d in value)

        def _deserialize(self, value, attr, data, **kwargs):
            try:
                return [int(c) for c in value]
            except ValueError as error:
                raise ValidationError("Pin codes must contain only digits.") from error


    class UserSchema(Schema):
        name = fields.String()
        email = fields.String()
        created_at = fields.DateTime()
        pin_code = PinCode()

Method fields
-------------

A :class:`Method <marshmallow.fields.Method>` field will serialize to the value returned by a method of the Schema. The method must take an ``obj`` parameter which is the object to be serialized.

.. code-block:: python

    class UserSchema(Schema):
        name = fields.String()
        email = fields.String()
        created_at = fields.DateTime()
        since_created = fields.Method("get_days_since_created")

        def get_days_since_created(self, obj):
            return dt.datetime.now().day - obj.created_at.day

Function fields
---------------

A :class:`Function <marshmallow.fields.Function>` field will serialize the value of a function that is passed directly to it. Like a :class:`Method <marshmallow.fields.Method>` field, the function must take a single argument ``obj``.


.. code-block:: python

    class UserSchema(Schema):
        name = fields.String()
        email = fields.String()
        created_at = fields.DateTime()
        uppername = fields.Function(lambda obj: obj.name.upper())

`Method` and `Function` field deserialization
---------------------------------------------

Both :class:`Function <marshmallow.fields.Function>` and :class:`Method <marshmallow.fields.Method>` receive an optional ``deserialize`` argument which defines how the field should be deserialized. The method or function passed to ``deserialize`` receives the input value for the field.

.. code-block:: python

    class UserSchema(Schema):
        # `Method` takes a method name (str), Function takes a callable
        balance = fields.Method("get_balance", deserialize="load_balance")

        def get_balance(self, obj):
            return obj.income - obj.debt

        def load_balance(self, value):
            return float(value)


    schema = UserSchema()
    result = schema.load({"balance": "100.00"})
    result["balance"]  # => 100.0

.. _using_context:

Using context
-------------

A field may need information about its environment to know how to (de)serialize a value.

You can use the experimental `Context <marshmallow.experimental.context.Context>` class
to set and retrieve context.

Let's say your ``UserSchema`` needs to output
whether or not a ``User`` is the author of a ``Blog`` or
whether a certain word appears in a ``Blog's`` title.

.. code-block:: python

    import typing
    from dataclasses import dataclass

    from marshmallow import Schema, fields
    from marshmallow.experimental.context import Context


    @dataclass
    class User:
        name: str


    @dataclass
    class Blog:
        title: str
        author: User


    class ContextDict(typing.TypedDict):
        blog: Blog


    class UserSchema(Schema):
        name = fields.String()

        is_author = fields.Function(
            lambda user: user == Context[ContextDict].get()["blog"].author
        )
        likes_bikes = fields.Method("writes_about_bikes")

        def writes_about_bikes(self, user: User) -> bool:
            return "bicycle" in Context[ContextDict].get()["blog"].title.lower()

.. note::
    You can use `Context.get <marshmallow.experimental.context.Context.get>`
    within custom fields, pre-/post-processing methods, and validators.

When (de)serializing, set the context by using `Context <marshmallow.experimental.context.Context>` as a context manager.

.. code-block:: python


    user = User("Freddie Mercury", "fred@queen.com")
    blog = Blog("Bicycle Blog", author=user)

    schema = UserSchema()
    with Context({"blog": blog}):
        result = schema.dump(user)
        print(result["is_author"])  # => True
        print(result["likes_bikes"])  # => True


Customizing error messages
--------------------------

Validation error messages for fields can be configured at the class or instance level.

At the class level, default error messages are defined as a mapping from error codes to error messages.

.. code-block:: python

    from marshmallow import fields


    class MyDate(fields.Date):
        default_error_messages = {"invalid": "Please provide a valid date."}

.. note::
    A `Field's` ``default_error_messages`` dictionary gets merged with its parent classes' ``default_error_messages`` dictionaries.

Error messages can also be passed to a `Field's` constructor.

.. code-block:: python

    from marshmallow import Schema, fields


    class UserSchema(Schema):
        name = fields.Str(
            required=True, error_messages={"required": "Please provide a name."}
        )


Next steps
----------

- Need to add schema-level validation, post-processing, or error handling behavior? See the :doc:`extending/index` page.
- For example applications using marshmallow, check out the :doc:`examples/index` page.


================================================
FILE: docs/dashing.json
================================================
{
  "name": "marshmallow",
  "package": "marshmallow",
  "index": "_build/index.html",
  "selectors": {
    "dl.class dt": {
      "type": "Class",
      "attr": "id"
    },
    "dl.exception dt": {
      "type": "Exception",
      "attr": "id"
    },
    "dl.function dt": {
      "type": "Function",
      "attr": "id"
    }
  },
  "icon32x32": "",
  "allowJS": false,
  "ExternalURL": ""
}


================================================
FILE: docs/donate.rst
================================================
******
Donate
******

If you find marshmallow useful, please consider supporting the team with a donation:

.. image:: https://opencollective.com/marshmallow/donate/button@2x.png
   :target: https://opencollective.com/marshmallow
   :alt: Donate to our Open Collective
   :height: 50px
   
Your donation keeps marshmallow healthy and maintained.


================================================
FILE: docs/examples/index.rst
================================================
********
Examples
********

The below examples demonstrate how to use marshmallow in various contexts.
To run each example, you will need to have `uv <https://docs.astral.sh/uv/getting-started/installation/>`_ installed.
The examples use `PEP 723 inline metadata <https://peps.python.org/pep-0723/>`_
to declare the dependencies of each script. ``uv`` will install the
dependencies automatically when running these scripts.

.. toctree::
  :maxdepth: 1

  validating_package_json
  quotes_api
  inflection


================================================
FILE: docs/examples/inflection.rst
================================================
*****************************
Inflection (camel-cased keys)
*****************************

HTTP APIs will often use camel-cased keys for their input and output representations. This example shows how you can use the
`Schema.on_bind_field <marshmallow.Schema.on_bind_field>` hook to automatically inflect keys.

.. literalinclude:: ../../examples/inflection_example.py
    :language: python

To run the example:

.. code-block:: shell-session

    $ uv run examples/inflection_example.py
    Loaded data:
    {'first_name': 'David', 'last_name': 'Bowie'}
    Dumped data:
    {'firstName': 'David', 'lastName': 'Bowie'}


================================================
FILE: docs/examples/quotes_api.rst
================================================
*******************************
Quotes API (Flask + SQLAlchemy)
*******************************

Below is a full example of a REST API for a quotes app using `Flask <http://flask.pocoo.org/>`_  and `SQLAlchemy <https://www.sqlalchemy.org/>`_  with marshmallow. It demonstrates a number of features, including:

- Custom validation
- Nesting fields
- Using ``dump_only=True`` to specify read-only fields
- Output filtering using the ``only`` parameter
- Using `@pre_load <marshmallow.decorators.pre_load>` to preprocess input data.

.. literalinclude:: ../../examples/flask_example.py
    :language: python


**Using The API**

Run the app.

.. code-block:: shell-session

    $ uv run examples/flask_example.py

We'll use the `httpie cli <https://httpie.io/cli>`_ to send requests
Install it with ``uv``.

.. code-block:: shell-session

    $ uv tool install httpie

First we'll POST some quotes.

.. code-block:: shell-session

    $ http POST :5000/quotes/ author="Tim Peters" content="Beautiful is better than ugly."
    $ http POST :5000/quotes/ author="Tim Peters" content="Now is better than never."
    $ http POST :5000/quotes/ author="Peter Hintjens" content="Simplicity is always better than functionality."


If we provide invalid input data, we get 400 error response. Let's omit "author" from the input data.

.. code-block:: shell-session

    $ http POST :5000/quotes/ content="I have no author"
    {
        "author": [
            "Data not provided."
        ]
    }

Now we can GET a list of all the quotes.

.. code-block:: shell-session

    $ http :5000/quotes/
    {
        "quotes": [
            {
                "content": "Beautiful is better than ugly.",
                "id": 1
            },
            {
                "content": "Now is better than never.",
                "id": 2
            },
            {
                "content": "Simplicity is always better than functionality.",
                "id": 3
            }
        ]
    }

We can also GET the quotes for a single author.

.. code-block:: shell-session

    $ http :5000/authors/1
    {
        "author": {
            "first": "Tim",
            "formatted_name": "Peters, Tim",
            "id": 1,
            "last": "Peters"
        },
        "quotes": [
            {
                "content": "Beautiful is better than ugly.",
                "id": 1
            },
            {
                "content": "Now is better than never.",
                "id": 2
            }
        ]
    }


================================================
FILE: docs/examples/validating_package_json.rst
================================================
***************************
Validating ``package.json``
***************************

marshmallow can be used to validate configuration according to a schema.
Below is a schema that could be used to validate
``package.json`` files. This example demonstrates the following features:


- Validation and deserialization using `Schema.load <marshmallow.Schema.load>`
- :doc:`Custom fields <../custom_fields>`
- Specifying deserialization keys using ``data_key``
- Including unknown keys using ``unknown = INCLUDE``

.. literalinclude:: ../../examples/package_json_example.py
    :language: python


Given the following ``package.json`` file...

.. literalinclude:: ../../examples/package.json
    :language: json


We can validate it using the above script.

.. code-block:: shell-session

    $ uv run examples/package_json_example.py < examples/package.json
    {'description': 'The Pythonic JavaScript toolkit',
    'dev_dependencies': {'pest': '^23.4.1'},
    'license': 'MIT',
    'main': 'index.js',
    'name': 'dunderscore',
    'scripts': {'test': 'pest'},
    'version': <Version('1.2.3')>}

Notice that our custom field deserialized the version string to a ``Version`` object.

But if we pass an invalid package.json file...

.. literalinclude:: ../../examples/invalid_package.json
    :language: json

We see the corresponding error messages.

.. code-block:: shell-session

    $ uv run examples/package_json_example.py < examples/invalid_package.json
    ERROR: package.json is invalid
    {'homepage': ['Not a valid URL.'], 'version': ['Not a valid version.']}


================================================
FILE: docs/extending/custom_error_handling.rst
================================================
Custom error handling
=====================

By default, `Schema.load <marshmallow.Schema.load>` will raise a :exc:`ValidationError <marshmallow.exceptions.ValidationError>` if passed invalid data.

You can specify a custom error-handling function for a :class:`Schema` by overriding the `handle_error <marshmallow.Schema.handle_error>`  method. The method receives the :exc:`ValidationError <marshmallow.exceptions.ValidationError>` and the original input data to be deserialized.

.. code-block:: python

    import logging
    from marshmallow import Schema, fields


    class AppError(Exception):
        pass


    class UserSchema(Schema):
        email = fields.Email()

        def handle_error(self, exc, data, **kwargs):
            """Log and raise our custom exception when (de)serialization fails."""
            logging.error(exc.messages)
            raise AppError("An error occurred with input: {0}".format(data))


    schema = UserSchema()
    schema.load({"email": "invalid-email"})  # raises AppError


================================================
FILE: docs/extending/custom_error_messages.rst
================================================
Custom error messages
=====================

To customize the schema-level error messages that `load <marshmallow.Schema.load>` and `loads <marshmallow.Schema.loads>` use when raising a `ValidationError <marshmallow.exceptions.ValidationError>`, override the `error_messages <marshmallow.Schema.error_messages>` class variable:

.. code-block:: python

    class MySchema(Schema):
        error_messages = {
            "unknown": "Custom unknown field error message.",
            "type": "Custom invalid type error message.",
        }


Field-level error message defaults can be set on `Field.default_error_messages <marshmallow.fields.Field.default_error_messages>`.


.. code-block:: python

   from marshmallow import Schema, fields

   fields.Field.default_error_messages["required"] = "You missed something!"


   class ArtistSchema(Schema):
       name = fields.Str(required=True)
       label = fields.Str(required=True, error_messages={"required": "Label missing."})


   print(ArtistSchema().validate({}))
   # {'label': ['Label missing.'], 'name': ['You missed something!']}


================================================
FILE: docs/extending/custom_options.rst
================================================
Custom `class Meta <marshmallow.Schema.Meta>` options
=====================================================

`class Meta <marshmallow.Schema.Meta>` options are a way to configure and modify a `Schema's <Schema>` behavior. See `marshmallow.Schema.Meta` for a listing of available options.

You can add custom `class Meta <marshmallow.Schema.Meta>` options by subclassing `marshmallow.SchemaOpts`.

Example: Enveloping, revisited
------------------------------

Let's build upon the :ref:`previous enveloping implementation <enveloping_1>` above for adding an envelope to serialized output. 
This time, we will allow the envelope key to be customizable with `class Meta <marshmallow.Schema.Meta>` options.

::

    # Example outputs
    {
        'user': {
            'name': 'Keith',
            'email': 'keith@stones.com'
        }
    }
    # List output
    {
        'users': [{'name': 'Keith'}, {'name': 'Mick'}]
    }


First, we'll add our namespace configuration to a custom options class.

.. code-block:: python

    from marshmallow import Schema, SchemaOpts


    class NamespaceOpts(SchemaOpts):
        """Same as the default class Meta options, but adds "name" and
        "plural_name" options for enveloping.
        """

        def __init__(self, meta, **kwargs):
            SchemaOpts.__init__(self, meta, **kwargs)
            self.name = getattr(meta, "name", None)
            self.plural_name = getattr(meta, "plural_name", self.name)


Then we create a custom :class:`Schema` that uses our options class.

.. code-block:: python

    class NamespacedSchema(Schema):
        OPTIONS_CLASS = NamespaceOpts

        @pre_load(pass_many=True)
        def unwrap_envelope(self, data, many, **kwargs):
            key = self.opts.plural_name if many else self.opts.name
            return data[key]

        @post_dump(pass_many=True)
        def wrap_with_envelope(self, data, many, **kwargs):
            key = self.opts.plural_name if many else self.opts.name
            return {key: data}


Our application schemas can now inherit from our custom schema class.

.. code-block:: python

    class UserSchema(NamespacedSchema):
        name = fields.String()
        email = fields.Email()

        class Meta:
            name = "user"
            plural_name = "users"


    ser = UserSchema()
    user = User("Keith", email="keith@stones.com")
    result = ser.dump(user)
    result  # {"user": {"name": "Keith", "email": "keith@stones.com"}}


================================================
FILE: docs/extending/index.rst
================================================
Extending schemas
=================

The guides below demonstrate how to extend schemas in various ways.

.. toctree::
  :maxdepth: 1

  pre_and_post_processing_methods
  schema_validation
  using_original_input_data
  overriding_attribute_access
  custom_error_handling
  custom_options
  custom_error_messages


================================================
FILE: docs/extending/overriding_attribute_access.rst
================================================
Overriding how attributes are accessed
======================================

By default, marshmallow uses `utils.get_value <marshmallow.utils.get_value>` to pull attributes from various types of objects for serialization. This will work for *most* use cases.

However, if you want to specify how values are accessed from an object, you can override the :meth:`get_attribute <marshmallow.Schema.get_attribute>` method.

.. code-block:: python

    class UserDictSchema(Schema):
        name = fields.Str()
        email = fields.Email()

        # If we know we're only serializing dictionaries, we can
        # use dict.get for all input objects
        def get_attribute(self, obj, key, default):
            return obj.get(key, default)


================================================
FILE: docs/extending/pre_and_post_processing_methods.rst
================================================
Pre-processing and post-processing methods
==========================================

Decorator API
-------------

Data pre-processing and post-processing methods can be registered using the `pre_load <marshmallow.decorators.pre_load>`, `post_load <marshmallow.decorators.post_load>`, `pre_dump <marshmallow.decorators.pre_dump>`, and `post_dump <marshmallow.decorators.post_dump>` decorators.


.. code-block:: python

    from marshmallow import Schema, fields, post_load


    class UserSchema(Schema):
        name = fields.Str()
        slug = fields.Str()

        @post_load
        def slugify_name(self, in_data, **kwargs):
            in_data["slug"] = in_data["slug"].lower().strip().replace(" ", "-")
            return in_data


    schema = UserSchema()
    result = schema.load({"name": "Steve", "slug": "Steve Loria "})
    result["slug"]  # => 'steve-loria'

Passing "many"
--------------

By default, pre- and post-processing methods receive one object/datum at a time, transparently handling the ``many`` parameter passed to the ``Schema``'s `~marshmallow.Schema.dump`/`~marshmallow.Schema.load` method at runtime.

In cases where your pre- and post-processing methods needs to handle the input collection when processing multiple objects, add ``pass_many=True`` to the method decorators.

Your method will then receive the input data (which may be a single datum or a collection, depending on the dump/load call).

.. _enveloping_1:

Example: Enveloping
-------------------

One common use case is to wrap data in a namespace upon serialization and unwrap the data during deserialization.

.. code-block:: python

    from marshmallow import Schema, fields, pre_load, post_load, post_dump


    class BaseSchema(Schema):
        # Custom options
        __envelope__ = {"single": None, "many": None}
        __model__ = User

        def get_envelope_key(self, many):
            """Helper to get the envelope key."""
            key = self.__envelope__["many"] if many else self.__envelope__["single"]
            assert key is not None, "Envelope key undefined"
            return key

        @pre_load(pass_many=True)
        def unwrap_envelope(self, data, many, **kwargs):
            key = self.get_envelope_key(many)
            return data[key]

        @post_dump(pass_many=True)
        def wrap_with_envelope(self, data, many, **kwargs):
            key = self.get_envelope_key(many)
            return {key: data}

        @post_load
        def make_object(self, data, **kwargs):
            return self.__model__(**data)


    class UserSchema(BaseSchema):
        __envelope__ = {"single": "user", "many": "users"}
        __model__ = User
        name = fields.Str()
        email = fields.Email()


    user_schema = UserSchema()

    user = User("Mick", email="mick@stones.org")
    user_data = user_schema.dump(user)
    # {'user': {'email': 'mick@stones.org', 'name': 'Mick'}}

    users = [
        User("Keith", email="keith@stones.org"),
        User("Charlie", email="charlie@stones.org"),
    ]
    users_data = user_schema.dump(users, many=True)
    # {'users': [{'email': 'keith@stones.org', 'name': 'Keith'},
    #            {'email': 'charlie@stones.org', 'name': 'Charlie'}]}

    user_objs = user_schema.load(users_data, many=True)
    # [<User(name='Keith Richards')>, <User(name='Charlie Watts')>]

Raising errors in pre-/post-processor methods
---------------------------------------------

Pre- and post-processing methods may raise a `ValidationError <marshmallow.exceptions.ValidationError>`. By default, errors will be stored on the ``"_schema"`` key in the errors dictionary.

.. code-block:: python

    from marshmallow import Schema, fields, ValidationError, pre_load


    class BandSchema(Schema):
        name = fields.Str()

        @pre_load
        def unwrap_envelope(self, data, **kwargs):
            if "data" not in data:
                raise ValidationError('Input data must have a "data" key.')
            return data["data"]


    sch = BandSchema()
    try:
        sch.load({"name": "The Band"})
    except ValidationError as err:
        err.messages
    # {'_schema': ['Input data must have a "data" key.']}

If you want to store and error on a different key, pass the key name as the second argument to `ValidationError <marshmallow.exceptions.ValidationError>`.

.. code-block:: python

    from marshmallow import Schema, fields, ValidationError, pre_load


    class BandSchema(Schema):
        name = fields.Str()

        @pre_load
        def unwrap_envelope(self, data, **kwargs):
            if "data" not in data:
                raise ValidationError(
                    'Input data must have a "data" key.', "_preprocessing"
                )
            return data["data"]


    sch = BandSchema()
    try:
        sch.load({"name": "The Band"})
    except ValidationError as err:
        err.messages
    # {'_preprocessing': ['Input data must have a "data" key.']}

Pre-/post-processor invocation order
------------------------------------

In summary, the processing pipeline for deserialization is as follows:

1. ``@pre_load(pass_many=True)`` methods
2. ``@pre_load(pass_many=False)`` methods
3. ``load(in_data, many)`` (validation and deserialization)
4. ``@validates`` methods (field validators)
5. ``@validates_schema`` methods (schema validators)
6. ``@post_load(pass_many=True)`` methods
7. ``@post_load(pass_many=False)`` methods

The pipeline for serialization is similar, except that the ``pass_many=True`` processors are invoked *after* the ``pass_many=False`` processors and there are no validators.

1. ``@pre_dump(pass_many=False)`` methods
2. ``@pre_dump(pass_many=True)`` methods
3. ``dump(obj, many)`` (serialization)
4. ``@post_dump(pass_many=False)`` methods
5. ``@post_dump(pass_many=True)`` methods


.. warning::

    You may register multiple processor methods on a Schema. Keep in mind, however, that **the invocation order of decorated methods of the same type is not guaranteed**. If you need to guarantee order of processing steps, you should put them in the same method.


    .. code-block:: python

        from marshmallow import Schema, fields, pre_load


        # YES
        class MySchema(Schema):
            field_a = fields.Raw()

            @pre_load
            def preprocess(self, data, **kwargs):
                step1_data = self.step1(data)
                step2_data = self.step2(step1_data)
                return step2_data

            def step1(self, data): ...

            # Depends on step1
            def step2(self, data): ...


        # NO
        class MySchema(Schema):
            field_a = fields.Raw()

            @pre_load
            def step1(self, data, **kwargs): ...

            # Depends on step1
            @pre_load
            def step2(self, data, **kwargs): ...


================================================
FILE: docs/extending/schema_validation.rst
================================================
.. _schema_validation:

Schema-level validation
=======================

You can register schema-level validation functions for a :class:`Schema` using the `marshmallow.validates_schema <marshmallow.decorators.validates_schema>` decorator. By default, schema-level validation errors will be stored on the ``_schema`` key of the errors dictionary.

.. code-block:: python

    from marshmallow import Schema, fields, validates_schema, ValidationError


    class NumberSchema(Schema):
        field_a = fields.Integer()
        field_b = fields.Integer()

        @validates_schema
        def validate_numbers(self, data, **kwargs):
            if data["field_b"] >= data["field_a"]:
                raise ValidationError("field_a must be greater than field_b")


    schema = NumberSchema()
    try:
        schema.load({"field_a": 1, "field_b": 2})
    except ValidationError as err:
        err.messages["_schema"]
    # => ["field_a must be greater than field_b"]

Storing errors on specific fields
---------------------------------

It is possible to report errors on fields and subfields using a `dict`.

When multiple schema-leval validator return errors, the error structures are merged together in the :exc:`ValidationError <marshmallow.exceptions.ValidationError>` raised at the end of the validation.

.. code-block:: python

    from marshmallow import Schema, fields, validates_schema, ValidationError


    class NumberSchema(Schema):
        field_a = fields.Integer()
        field_b = fields.Integer()
        field_c = fields.Integer()
        field_d = fields.Integer()

        @validates_schema
        def validate_lower_bound(self, data, **kwargs):
            errors = {}
            if data["field_b"] <= data["field_a"]:
                errors["field_b"] = ["field_b must be greater than field_a"]
            if data["field_c"] <= data["field_a"]:
                errors["field_c"] = ["field_c must be greater than field_a"]
            if errors:
                raise ValidationError(errors)

        @validates_schema
        def validate_upper_bound(self, data, **kwargs):
            errors = {}
            if data["field_b"] >= data["field_d"]:
                errors["field_b"] = ["field_b must be lower than field_d"]
            if data["field_c"] >= data["field_d"]:
                errors["field_c"] = ["field_c must be lower than field_d"]
            if errors:
                raise ValidationError(errors)


    schema = NumberSchema()
    try:
        schema.load({"field_a": 3, "field_b": 2, "field_c": 1, "field_d": 0})
    except ValidationError as err:
        err.messages
    # => {
    #     'field_b': [
    #         'field_b must be greater than field_a',
    #         'field_b must be lower than field_d'
    #     ],
    #     'field_c': [
    #         'field_c must be greater than field_a',
    #         'field_c must be lower than field_d'
    #     ]
    #    }


================================================
FILE: docs/extending/using_original_input_data.rst
================================================
Using original input data
-------------------------

If you want to use the original, unprocessed input, you can add ``pass_original=True`` to
`post_load <marshmallow.decorators.post_load>` or `validates_schema <marshmallow.decorators.validates_schema>`.

.. code-block:: python

    from marshmallow import Schema, fields, post_load, ValidationError


    class MySchema(Schema):
        foo = fields.Int()
        bar = fields.Int()

        @post_load(pass_original=True)
        def add_baz_to_bar(self, data, original_data, **kwargs):
            baz = original_data.get("baz")
            if baz:
                data["bar"] = data["bar"] + baz
            return data


    schema = MySchema()
    schema.load({"foo": 1, "bar": 2, "baz": 3})
    # {'foo': 1, 'bar': 5}

.. seealso::

   The default behavior for unspecified fields can be controlled with the ``unknown`` option, see :ref:`Handling Unknown Fields <unknown>` for more information.


================================================
FILE: docs/index.rst
================================================
.. meta::
   :description:
        marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.

***********
marshmallow
***********

*Object serialization and deserialization, lightweight and fluffy.*

Release v\ |version|. (:doc:`changelog`)

----

.. include:: ../README.rst
    :start-after: .. start elevator-pitch
    :end-before: .. end elevator-pitch

Ready to get started? Go on to the :doc:`quickstart` or check out some :doc:`examples <examples/index>`.

Upgrading from an older version?
================================

See the :doc:`upgrading` page for notes on getting your code up-to-date with the latest version.

Why another library?
=====================

See :doc:`this document <why>` to learn about what makes marshmallow unique.

Sponsors
========

.. include:: ../README.rst
    :start-after: .. start sponsors
    :end-before: .. end sponsors

.. toctree::
    :maxdepth: 1
    :hidden:
    :titlesonly:

    Home <self>

Usage guide
===========

.. toctree::
    :caption: Usage guide
    :maxdepth: 2

    install
    quickstart
    nesting
    custom_fields
    extending/index
    examples/index


API reference
=============

.. toctree::
    :caption: API reference
    :maxdepth: 1

    api_reference

Project info
=============

.. toctree::
    :caption: Project info
    :maxdepth: 1

    why
    changelog
    upgrading
    whos_using
    license
    authors
    contributing
    code_of_conduct
    kudos
    donate

.. toctree::
    :hidden:
    :caption: Useful links

    marshmallow @ PyPI <https://pypi.org/project/marshmallow/>
    marshmallow @ GitHub <https://github.com/marshmallow-code/marshmallow/>
    Issue Tracker <https://github.com/marshmallow-code/marshmallow/issues>
    Ecosystem <https://github.com/marshmallow-code/marshmallow/wiki/Ecosystem>


================================================
FILE: docs/install.rst
================================================
Installation
============

Installing/upgrading from the PyPI
----------------------------------

To install the latest stable version from the PyPI:

.. code-block:: shell-session

    $ pip install -U marshmallow

To install the latest pre-release version from the PyPI:

.. code-block:: shell-session

    $ pip install -U marshmallow --pre

Get the bleeding edge version
-----------------------------

To get the latest development version of marshmallow, run

.. code-block:: shell-session

    $ pip install -U git+https://github.com/marshmallow-code/marshmallow.git@dev


.. seealso::

    Need help upgrading to newer releases? See the :doc:`upgrading` page.


================================================
FILE: docs/kudos.rst
================================================
*****
Kudos
*****

A hat tip to `Django Rest Framework`_ , `Flask-RESTful`_, and `colander`_ for ideas and API design.

.. _Flask-RESTful: https://flask-restful.readthedocs.io/en/latest/

.. _Django Rest Framework: https://django-rest-framework.org/

.. _colander: https://docs.pylonsproject.org/projects/colander/en/latest/


================================================
FILE: docs/license.rst
================================================
License
=======

.. literalinclude:: ../LICENSE


================================================
FILE: docs/marshmallow.class_registry.rst
================================================
Class registry
==============

.. automodule:: marshmallow.class_registry
    :members:


================================================
FILE: docs/marshmallow.decorators.rst
================================================
Decorators
==========

.. automodule:: marshmallow.decorators
    :members:
    :autosummary:


================================================
FILE: docs/marshmallow.error_store.rst
================================================
Error store
===========

.. automodule:: marshmallow.error_store
    :members:
    :private-members:


================================================
FILE: docs/marshmallow.exceptions.rst
================================================
Exceptions
==========

.. automodule:: marshmallow.exceptions
    :members:


================================================
FILE: docs/marshmallow.experimental.context.rst
================================================
Context (experimental)
======================

.. automodule:: marshmallow.experimental.context
    :members:


================================================
FILE: docs/marshmallow.fields.rst
================================================
.. _api_fields:

Fields
======

Base Field Class
----------------

.. autoclass:: marshmallow.fields.Field
    :private-members:

Field subclasses
----------------

.. automodule:: marshmallow.fields
    :members:
    :autosummary:
    :exclude-members: Field, default_error_messages, mapping_type, num_type, DESERIALIZATION_CLASS


================================================
FILE: docs/marshmallow.schema.rst
================================================
Schema
======

.. autoclass:: marshmallow.schema.Schema
    :members:
    :autosummary:
    :exclude-members: OPTIONS_CLASS

.. autoclass:: marshmallow.schema.SchemaOpts


================================================
FILE: docs/marshmallow.types.rst
================================================
Types
=====

.. automodule:: marshmallow.types
    :members:


================================================
FILE: docs/marshmallow.utils.rst
================================================
Utility functions
=================

.. automodule:: marshmallow.utils
    :members:


================================================
FILE: docs/marshmallow.validate.rst
================================================
.. _api_validators:

Validators
==========

.. automodule:: marshmallow.validate
    :members:
    :autosummary:


================================================
FILE: docs/nesting.rst
================================================
Nesting schemas
===============

Schemas can be nested to represent relationships between objects (e.g. foreign key relationships). 
For example, a ``Blog`` may have an author represented by a ``User``.
And a ``User`` may have many friends, each of which is a ``User``.

.. code-block:: python

    from __future__ import annotations  # Enable newer type annotation syntax

    import datetime as dt
    from dataclasses import dataclass, field


    @dataclass
    class User:
        name: str
        email: str
        created_at: dt.datetime = field(default_factory=dt.datetime.now)
        friends: list[User] = field(default_factory=list)
        employer: User | None = None


    @dataclass
    class Blog:
        title: str
        author: User

Use a :class:`Nested <marshmallow.fields.Nested>` field to represent the relationship, passing in a nested schema.

.. code-block:: python

    from marshmallow import Schema, fields


    class UserSchema(Schema):
        name = fields.String()
        email = fields.Email()
        created_at = fields.DateTime()


    class BlogSchema(Schema):
        title = fields.String()
        author = fields.Nested(UserSchema)

The serialized blog will have the nested user representation.

.. code-block:: python

    from pprint import pprint

    user = User(name="Monty", email="monty@python.org")
    blog = Blog(title="Something Completely Different", author=user)
    result = BlogSchema().dump(blog)
    pprint(result)
    # {'title': u'Something Completely Different',
    #  'author': {'name': u'Monty',
    #             'email': u'monty@python.org',
    #             'created_at': '2014-08-17T14:58:57.600623+00:00'}}

.. note::
    If the field is a collection of nested objects, pass the `Nested <marshmallow.fields.Nested>` field to `List <marshmallow.fields.List>`.

    .. code-block:: python

        collaborators = fields.List(fields.Nested(UserSchema))

.. _specifying-nested-fields:

Specifying which fields to nest
-------------------------------

You can explicitly specify which attributes of the nested objects you want to (de)serialize with the ``only`` argument to the schema.

.. code-block:: python

    class BlogSchema2(Schema):
        title = fields.String()
        author = fields.Nested(UserSchema(only=("email",)))


    schema = BlogSchema2()
    result = schema.dump(blog)
    pprint(result)
    # {
    #     'title': u'Something Completely Different',
    #     'author': {'email': u'monty@python.org'}
    # }

Dotted paths may be passed to ``only`` and ``exclude`` to specify nested attributes.

.. code-block:: python

    class SiteSchema(Schema):
        blog = fields.Nested(BlogSchema2)


    schema = SiteSchema(only=("blog.author.email",))
    result = schema.dump(site)
    pprint(result)
    # {
    #     'blog': {
    #         'author': {'email': u'monty@python.org'}
    #     }
    # }

You can replace nested data with a single value (or flat list of values if ``many=True``) using the :class:`Pluck <marshmallow.fields.Pluck>` field.

.. code-block:: python

    class UserSchema(Schema):
        name = fields.String()
        email = fields.Email()
        friends = fields.Pluck("self", "name", many=True)


    # ... create ``user`` ...
    serialized_data = UserSchema().dump(user)
    pprint(serialized_data)
    # {
    #     "name": "Steve",
    #     "email": "steve@example.com",
    #     "friends": ["Mike", "Joe"]
    # }
    deserialized_data = UserSchema().load(result)
    pprint(deserialized_data)
    # {
    #     "name": "Steve",
    #     "email": "steve@example.com",
    #     "friends": [{"name": "Mike"}, {"name": "Joe"}]
    # }


.. _partial-loading:

Partial loading
---------------

Nested schemas also inherit the ``partial`` parameter of the parent ``load`` call.

.. code-block:: python

    class UserSchemaStrict(Schema):
        name = fields.String(required=True)
        email = fields.Email()
        created_at = fields.DateTime(required=True)


    class BlogSchemaStrict(Schema):
        title = fields.String(required=True)
        author = fields.Nested(UserSchemaStrict, required=True)


    schema = BlogSchemaStrict()
    blog = {"title": "Something Completely Different", "author": {}}
    result = schema.load(blog, partial=True)
    pprint(result)
    # {'author': {}, 'title': 'Something Completely Different'}

You can specify a subset of the fields to allow partial loading using dot delimiters.

.. code-block:: python

    author = {"name": "Monty"}
    blog = {"title": "Something Completely Different", "author": author}
    result = schema.load(blog, partial=("title", "author.created_at"))
    pprint(result)
    # {'author': {'name': 'Monty'}, 'title': 'Something Completely Different'}

.. _two-way-nesting:

Two-way nesting
---------------

If you have two objects that nest each other, you can pass a callable to `Nested <marshmallow.fields.Nested>`.
This allows you to resolve order-of-declaration issues, such as when one schema nests a schema that is declared below it.

For example, a representation of an ``Author`` model might include the books that have a many-to-one relationship to it.
Correspondingly, a representation of a ``Book`` will include its author representation.

.. code-block:: python

    class BookSchema(Schema):
        id = fields.Int(dump_only=True)
        title = fields.Str()

        # Make sure to use the 'only' or 'exclude'
        # to avoid infinite recursion
        author = fields.Nested(lambda: AuthorSchema(only=("id", "title")))


    class AuthorSchema(Schema):
        id = fields.Int(dump_only=True)
        title = fields.Str()

        books = fields.List(fields.Nested(BookSchema(exclude=("author",))))


.. code-block:: python

    from pprint import pprint
    from mymodels import Author, Book

    author = Author(name="William Faulkner")
    book = Book(title="As I Lay Dying", author=author)
    book_result = BookSchema().dump(book)
    pprint(book_result, indent=2)
    # {
    #   "id": 124,
    #   "title": "As I Lay Dying",
    #   "author": {
    #     "id": 8,
    #     "name": "William Faulkner"
    #   }
    # }

    author_result = AuthorSchema().dump(author)
    pprint(author_result, indent=2)
    # {
    #   "id": 8,
    #   "name": "William Faulkner",
    #   "books": [
    #     {
    #       "id": 124,
    #       "title": "As I Lay Dying"
    #     }
    #   ]
    # }

You can also pass a class name as a string to `Nested <marshmallow.fields.Nested>`.
This is useful for avoiding circular imports when your schemas are located in different modules.

.. code-block:: python

    # books.py
    from marshmallow import Schema, fields


    class BookSchema(Schema):
        id = fields.Int(dump_only=True)
        title = fields.Str()

        author = fields.Nested("AuthorSchema", only=("id", "title"))

.. code-block:: python

    # authors.py
    from marshmallow import Schema, fields


    class AuthorSchema(Schema):
        id = fields.Int(dump_only=True)
        title = fields.Str()

        books = fields.List(fields.Nested("BookSchema", exclude=("author",)))

.. note::

    If you have multiple schemas with the same class name, you must pass the full, module-qualified path. ::

        author = fields.Nested("authors.BookSchema", only=("id", "title"))

.. _self-nesting:

Nesting a schema within itself
------------------------------

If the object to be marshalled has a relationship to an object of the same type, you can nest the `Schema <marshmallow.Schema>` within itself by passing a callable that returns an instance of the same schema.

.. code-block:: python

    class UserSchema(Schema):
        name = fields.String()
        email = fields.Email()
        # Use the 'exclude' argument to avoid infinite recursion
        employer = fields.Nested(lambda: UserSchema(exclude=("employer",)))
        friends = fields.List(fields.Nested(lambda: UserSchema()))


    user = User("Steve", "steve@example.com")
    user.friends.append(User("Mike", "mike@example.com"))
    user.friends.append(User("Joe", "joe@example.com"))
    user.employer = User("Dirk", "dirk@example.com")
    result = UserSchema().dump(user)
    pprint(result, indent=2)
    # {
    #     "name": "Steve",
    #     "email": "steve@example.com",
    #     "friends": [
    #         {
    #             "name": "Mike",
    #             "email": "mike@example.com",
    #             "friends": [],
    #             "employer": null
    #         },
    #         {
    #             "name": "Joe",
    #             "email": "joe@example.com",
    #             "friends": [],
    #             "employer": null
    #         }
    #     ],
    #     "employer": {
    #         "name": "Dirk",
    #         "email": "dirk@example.com",
    #         "friends": []
    #     }
    # }

Next steps
----------

- Want to create your own field type? See the :doc:`custom_fields` page.
- Need to add schema-level validation, post-processing, or error handling behavior? See the :doc:`extending/index` page.
- For more detailed usage examples, check out the :doc:`examples/index` page.


================================================
FILE: docs/quickstart.rst
================================================
Quickstart
==========

This guide will walk you through the basics of creating schemas for serializing and deserializing data.

Declaring schemas
-----------------

Let's start with a basic user "model".

.. code-block:: python

    from dataclasses import dataclass, field
    import datetime as dt


    @dataclass
    class User:
        name: str
        email: str
        created_at: dt.datetime = field(default_factory=dt.datetime.now)

Create a schema by defining a class with variables mapping attribute names to :class:`Field <fields.Field>` objects.

.. code-block:: python

    from marshmallow import Schema, fields


    class UserSchema(Schema):
        name = fields.Str()
        email = fields.Email()
        created_at = fields.DateTime()

.. seealso::

    For a full reference on the available field classes, see the `fields module documentation <marshmallow.fields>`.

.. admonition:: Creating schemas from dictionaries

    You can also create a schema from a dictionary of fields using the `from_dict <marshmallow.Schema.from_dict>` method.

    .. code-block:: python

        from marshmallow import Schema, fields

        UserSchema = Schema.from_dict(
            {
                "name": fields.Str(),
                "email": fields.Email(),
                "created_at": fields.DateTime(),
            }
        )

    `from_dict <marshmallow.Schema.from_dict>` is especially useful for generating schemas at runtime.

Serializing objects ("dumping")
-------------------------------

Serialize objects by passing them to your schema's :meth:`dump <marshmallow.Schema.dump>` method, which returns the formatted result.

.. code-block:: python

    from pprint import pprint

    user = User(name="Monty", email="monty@python.org")
    schema = UserSchema()
    result = schema.dump(user)
    pprint(result)
    # {"name": "Monty",
    #  "email": "monty@python.org",
    #  "created_at": "2014-08-17T14:54:16.049594+00:00"}

You can also serialize to a JSON-encoded string using :meth:`dumps <marshmallow.Schema.dumps>`.

.. code-block:: python

    json_result = schema.dumps(user)
    print(json_result)
    # '{"name": "Monty", "email": "monty@python.org", "created_at": "2014-08-17T14:54:16.049594+00:00"}'

Filtering output
----------------

You may not need to output all declared fields every time you use a schema. You can specify which fields to output with the ``only`` parameter.

.. code-block:: python

    summary_schema = UserSchema(only=("name", "email"))
    summary_schema.dump(user)
    # {"name": "Monty", "email": "monty@python.org"}

You can also exclude fields by passing in the ``exclude`` parameter.


Deserializing objects ("loading")
---------------------------------

The reverse of the `dump <Schema.dump>` method is `load <Schema.load>`, which validates and deserializes
an input dictionary to an application-level data structure.

By default, :meth:`load <Schema.load>` will return a dictionary of field names mapped to deserialized values (or raise a :exc:`ValidationError <marshmallow.exceptions.ValidationError>`
with a dictionary of validation errors, which we'll :ref:`revisit later <validation>`).

.. code-block:: python

    from pprint import pprint

    user_data = {
        "created_at": "2014-08-11T05:26:03.869245",
        "email": "ken@yahoo.com",
        "name": "Ken",
    }
    schema = UserSchema()
    result = schema.load(user_data)
    pprint(result)
    # {'name': 'Ken',
    #  'email': 'ken@yahoo.com',
    #  'created_at': datetime.datetime(2014, 8, 11, 5, 26, 3, 869245)},

Notice that the datetime string was converted to a `datetime` object.

Deserializing to objects
++++++++++++++++++++++++

In order to deserialize to an object, define a method of your :class:`Schema` and decorate it with `post_load <marshmallow.decorators.post_load>`. The method receives a dictionary of deserialized data.

.. code-block:: python

    from marshmallow import Schema, fields, post_load


    class UserSchema(Schema):
        name = fields.Str()
        email = fields.Email()
        created_at = fields.DateTime()

        @post_load
        def make_user(self, data, **kwargs):
            return User(**data)

Now, the `load <Schema.load>` method return a ``User`` instance.

.. code-block:: python

    user_data = {"name": "Ronnie", "email": "ronnie@stones.com"}
    schema = UserSchema()
    result = schema.load(user_data)
    print(result)  # => <User(name='Ronnie')>

Handling collections of objects
-------------------------------

Set ``many=True`` when dealing with iterable collections of objects.

.. code-block:: python

    user1 = User(name="Mick", email="mick@stones.com")
    user2 = User(name="Keith", email="keith@stones.com")
    users = [user1, user2]
    schema = UserSchema(many=True)
    result = schema.dump(users)  # OR UserSchema().dump(users, many=True)
    pprint(result)
    # [{'name': u'Mick',
    #   'email': u'mick@stones.com',
    #   'created_at': '2014-08-17T14:58:57.600623+00:00'}
    #  {'name': u'Keith',
    #   'email': u'keith@stones.com',
    #   'created_at': '2014-08-17T14:58:57.600623+00:00'}]


.. _validation:

Validation
----------

`Schema.load <marshmallow.Schema.load>` (and its JSON-decoding counterpart, `Schema.loads <marshmallow.Schema.loads>`) raises a :exc:`ValidationError <marshmallow.exceptions.ValidationError>` error when invalid data are passed in. You can access the dictionary of validation errors from the `ValidationError.messages <marshmallow.exceptions.ValidationError.messages>` attribute. The data that were correctly deserialized are accessible in `ValidationError.valid_data <marshmallow.exceptions.ValidationError.valid_data>`. Some fields, such as the :class:`Email <fields.Email>` and :class:`URL <fields.URL>` fields, have built-in validation.

.. code-block:: python

    from marshmallow import ValidationError

    try:
        result = UserSchema().load({"name": "John", "email": "foo"})
    except ValidationError as err:
        print(err.messages)  # => {"email": ['"foo" is not a valid email address.']}
        print(err.valid_data)  # => {"name": "John"}


When validating a collection, the errors dictionary will be keyed on the indices of invalid items.

.. code-block:: python

    from pprint import pprint

    from marshmallow import Schema, fields, ValidationError


    class BandMemberSchema(Schema):
        name = fields.String(required=True)
        email = fields.Email()


    user_data = [
        {"email": "mick@stones.com", "name": "Mick"},
        {"email": "invalid", "name": "Invalid"},  # invalid email
        {"email": "keith@stones.com", "name": "Keith"},
        {"email": "charlie@stones.com"},  # missing "name"
    ]

    try:
        BandMemberSchema(many=True).load(user_data)
    except ValidationError as err:
        pprint(err.messages)
        # {1: {'email': ['Not a valid email address.']},
        #  3: {'name': ['Missing data for required field.']}}

You can perform additional validation for a field by passing the ``validate`` argument.
There are a number of built-in validators in the :ref:`marshmallow.validate <api_validators>` module.

.. code-block:: python

    from pprint import pprint

    from marshmallow import Schema, fields, validate, ValidationError


    class UserSchema(Schema):
        name = fields.Str(validate=validate.Length(min=1))
        permission = fields.Str(validate=validate.OneOf(["read", "write", "admin"]))
        age = fields.Int(validate=validate.Range(min=18, max=40))


    in_data = {"name": "", "permission": "invalid", "age": 71}
    try:
        UserSchema().load(in_data)
    except ValidationError as err:
        pprint(err.messages)
        # {'age': ['Must be greater than or equal to 18 and less than or equal to 40.'],
        #  'name': ['Shorter than minimum length 1.'],
        #  'permission': ['Must be one of: read, write, admin.']}


You may implement your own validators.
A validator is a callable that accepts a single argument, the value to validate.
If validation fails, the callable should raise a :exc:`ValidationError <marshmallow.exceptions.ValidationError>`
with an error message.

.. code-block:: python

    from marshmallow import Schema, fields, ValidationError


    def validate_quantity(n):
        if n < 0:
            raise ValidationError("Quantity must be greater than 0.")
        if n > 30:
            raise ValidationError("Quantity must not be greater than 30.")


    class ItemSchema(Schema):
        quantity = fields.Integer(validate=validate_quantity)


    in_data = {"quantity": 31}
    try:
        result = ItemSchema().load(in_data)
    except ValidationError as err:
        print(err.messages)  # => {'quantity': ['Quantity must not be greater than 30.']}

You may also pass a collection (list, tuple, generator) of callables to ``validate``.

.. warning::

    Validation occurs on deserialization but not on serialization.
    To improve serialization performance, data passed to `Schema.dump <marshmallow.Schema.dump>`
    are considered valid.

.. seealso::

    You can register a custom error handler function for a schema by overriding the
    :func:`handle_error <Schema.handle_error>` method.
    See the :doc:`extending/custom_error_handling` page for more info.

.. seealso::

    If you need to validate multiple fields within a single validator, see :ref:`schema_validation`.


Field validators as methods
+++++++++++++++++++++++++++

It is sometimes convenient to write validators as methods. Use the `validates <marshmallow.validates>` decorator to register field validator methods.

.. code-block:: python

    from marshmallow import fields, Schema, validates, ValidationError


    class ItemSchema(Schema):
        quantity = fields.Integer()

        @validates("quantity")
        def validate_quantity(self, value: int, data_key: str) -> None:
            if value < 0:
                raise ValidationError("Quantity must be greater than 0.")
            if value > 30:
                raise ValidationError("Quantity must not be greater than 30.")

.. note::

    You can pass multiple field names to the `validates <marshmallow.validates>` decorator.

    .. code-block:: python

        from marshmallow import Schema, fields, validates, ValidationError


        class UserSchema(Schema):
            name = fields.Str(required=True)
            nickname = fields.Str(required=True)

            @validates("name", "nickname")
            def validate_names(self, value: str, data_key: str) -> None:
                if len(value) < 3:
                    raise ValidationError("Too short")


Required fields
---------------

Make a field required by passing ``required=True``. An error will be raised if the the value is missing from the input to `Schema.load <marshmallow.Schema.load>`.

To customize the error message for required fields, pass a `dict` with a ``required`` key as the ``error_messages`` argument for the field.

.. code-block:: python

    from pprint import pprint

    from marshmallow import Schema, fields, ValidationError


    class UserSchema(Schema):
        name = fields.String(required=True)
        age = fields.Integer(required=True, error_messages={"required": "Age is required."})
        city = fields.String(
            required=True,
            error_messages={"required": {"message": "City required", "code": 400}},
        )
        email = fields.Email()


    try:
        result = UserSchema().load({"email": "foo@bar.com"})
    except ValidationError as err:
        pprint(err.messages)
        # {'age': ['Age is required.'],
        # 'city': {'code': 400, 'message': 'City required'},
        # 'name': ['Missing data for required field.']}


Partial loading
---------------

When using the same schema in multiple places, you may only want to skip ``required``
validation by passing ``partial``.

.. code-block:: python

    class UserSchema(Schema):
        name = fields.Strin
Download .txt
gitextract_t8h8nw0o/

├── .github/
│   ├── FUNDING.yml
│   ├── dependabot.yml
│   └── workflows/
│       └── build-release.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yml
├── AUTHORS.rst
├── CHANGELOG.rst
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.rst
├── LICENSE
├── NOTICE
├── README.rst
├── RELEASING.md
├── SECURITY.md
├── docs/
│   ├── .gitignore
│   ├── _static/
│   │   └── custom.css
│   ├── api_reference.rst
│   ├── authors.rst
│   ├── changelog.rst
│   ├── code_of_conduct.rst
│   ├── conf.py
│   ├── contributing.rst
│   ├── custom_fields.rst
│   ├── dashing.json
│   ├── donate.rst
│   ├── examples/
│   │   ├── index.rst
│   │   ├── inflection.rst
│   │   ├── quotes_api.rst
│   │   └── validating_package_json.rst
│   ├── extending/
│   │   ├── custom_error_handling.rst
│   │   ├── custom_error_messages.rst
│   │   ├── custom_options.rst
│   │   ├── index.rst
│   │   ├── overriding_attribute_access.rst
│   │   ├── pre_and_post_processing_methods.rst
│   │   ├── schema_validation.rst
│   │   └── using_original_input_data.rst
│   ├── index.rst
│   ├── install.rst
│   ├── kudos.rst
│   ├── license.rst
│   ├── marshmallow.class_registry.rst
│   ├── marshmallow.decorators.rst
│   ├── marshmallow.error_store.rst
│   ├── marshmallow.exceptions.rst
│   ├── marshmallow.experimental.context.rst
│   ├── marshmallow.fields.rst
│   ├── marshmallow.schema.rst
│   ├── marshmallow.types.rst
│   ├── marshmallow.utils.rst
│   ├── marshmallow.validate.rst
│   ├── nesting.rst
│   ├── quickstart.rst
│   ├── top_level.rst
│   ├── upgrading.rst
│   ├── whos_using.rst
│   └── why.rst
├── examples/
│   ├── flask_example.py
│   ├── inflection_example.py
│   ├── invalid_package.json
│   ├── package.json
│   └── package_json_example.py
├── performance/
│   └── benchmark.py
├── pyproject.toml
├── src/
│   └── marshmallow/
│       ├── __init__.py
│       ├── class_registry.py
│       ├── constants.py
│       ├── decorators.py
│       ├── error_store.py
│       ├── exceptions.py
│       ├── experimental/
│       │   ├── __init__.py
│       │   └── context.py
│       ├── fields.py
│       ├── orderedset.py
│       ├── py.typed
│       ├── schema.py
│       ├── types.py
│       ├── utils.py
│       └── validate.py
├── tests/
│   ├── __init__.py
│   ├── base.py
│   ├── conftest.py
│   ├── foo_serializer.py
│   ├── mypy_test_cases/
│   │   ├── test_class_registry.py
│   │   ├── test_schema.py
│   │   └── test_validation_error.py
│   ├── test_context.py
│   ├── test_decorators.py
│   ├── test_deserialization.py
│   ├── test_error_store.py
│   ├── test_exceptions.py
│   ├── test_fields.py
│   ├── test_options.py
│   ├── test_registry.py
│   ├── test_schema.py
│   ├── test_serialization.py
│   ├── test_utils.py
│   └── test_validate.py
└── tox.ini
Download .txt
SYMBOL INDEX (1109 symbols across 32 files)

FILE: examples/flask_example.py
  class Base (line 25) | class Base(DeclarativeBase):
  class Author (line 34) | class Author(db.Model):  # type: ignore[name-defined]
  class Quote (line 40) | class Quote(db.Model):  # type: ignore[name-defined]
  class AuthorSchema (line 51) | class AuthorSchema(Schema):
    method format_name (line 57) | def format_name(self, author):
  function must_not_be_blank (line 62) | def must_not_be_blank(data):
  class QuoteSchema (line 67) | class QuoteSchema(Schema):
    method process_author (line 76) | def process_author(self, data, **kwargs):
  function get_authors (line 96) | def get_authors():
  function get_author (line 104) | def get_author(pk):
  function get_quotes (line 115) | def get_quotes():
  function get_quote (line 122) | def get_quote(pk):
  function new_quote (line 132) | def new_quote():

FILE: examples/inflection_example.py
  function camelcase (line 10) | def camelcase(s):
  class CamelCaseSchema (line 15) | class CamelCaseSchema(Schema):
    method on_bind_field (line 20) | def on_bind_field(self, field_name, field_obj):
  class UserSchema (line 27) | class UserSchema(CamelCaseSchema):

FILE: examples/package_json_example.py
  class Version (line 17) | class Version(fields.Field[version.Version]):
    method _deserialize (line 20) | def _deserialize(self, value, *args, **kwargs):
    method _serialize (line 26) | def _serialize(self, value, *args, **kwargs):
  class PackageSchema (line 30) | class PackageSchema(Schema):
    class Meta (line 46) | class Meta:

FILE: performance/benchmark.py
  function must_not_be_blank (line 17) | def must_not_be_blank(data):
  class AuthorSchema (line 22) | class AuthorSchema(Schema):
    method get_full_name (line 31) | def get_full_name(self, author):
  class QuoteSchema (line 35) | class QuoteSchema(Schema):
    method add_full_name (line 46) | def add_full_name(self, data, **kwargs):
  class Author (line 53) | class Author:
    method __init__ (line 54) | def __init__(self, id, first, last, book_count, age, address):
  class Quote (line 63) | class Quote:
    method __init__ (line 64) | def __init__(
  function run_timeit (line 85) | def run_timeit(quotes, iterations, repeat, *, profile=False):
  function main (line 107) | def main():

FILE: src/marshmallow/class_registry.py
  function register (line 30) | def register(classname: str, cls: SchemaType) -> None:
  function get_class (line 73) | def get_class(classname: str, *, all: typing.Literal[False] = ...) -> Sc...
  function get_class (line 77) | def get_class(
  function get_class (line 82) | def get_class(classname: str, *, all: bool = False) -> list[SchemaType] ...

FILE: src/marshmallow/constants.py
  class _Missing (line 8) | class _Missing:
    method __bool__ (line 9) | def __bool__(self):
    method __copy__ (line 12) | def __copy__(self):
    method __deepcopy__ (line 15) | def __deepcopy__(self, _):
    method __repr__ (line 18) | def __repr__(self):
    method __len__ (line 21) | def __len__(self):

FILE: src/marshmallow/decorators.py
  class MarshmallowHook (line 82) | class MarshmallowHook:
  function validates (line 86) | def validates(*field_names: str) -> typing.Callable[..., typing.Any]:
  function validates_schema (line 97) | def validates_schema(
  function pre_dump (line 133) | def pre_dump(
  function post_dump (line 152) | def post_dump(
  function pre_load (line 175) | def pre_load(
  function post_load (line 196) | def post_load(
  function set_hook (line 221) | def set_hook(

FILE: src/marshmallow/error_store.py
  class ErrorStore (line 12) | class ErrorStore:
    method __init__ (line 13) | def __init__(self):
    method store_error (line 17) | def store_error(self, messages, field_name=SCHEMA, index=None):
  function copy_containers (line 29) | def copy_containers(errors):
  function merge_errors (line 37) | def merge_errors(errors1, errors2):  # noqa: PLR0911

FILE: src/marshmallow/exceptions.py
  class MarshmallowError (line 11) | class MarshmallowError(Exception):
  class ValidationError (line 15) | class ValidationError(MarshmallowError):
    method __init__ (line 27) | def __init__(
    method normalized_messages (line 44) | def normalized_messages(self):
    method messages_dict (line 50) | def messages_dict(self) -> dict[str, typing.Any]:
  class RegistryError (line 59) | class RegistryError(NameError):
  class StringNotCollectionError (line 65) | class StringNotCollectionError(MarshmallowError, TypeError):
  class _FieldInstanceResolutionError (line 69) | class _FieldInstanceResolutionError(MarshmallowError, TypeError):

FILE: src/marshmallow/experimental/context.py
  class Context (line 47) | class Context(contextlib.AbstractContextManager, typing.Generic[_Context...
    method __init__ (line 53) | def __init__(self, context: _ContextT) -> None:
    method __enter__ (line 57) | def __enter__(self) -> Context[_ContextT]:
    method __exit__ (line 61) | def __exit__(self, *args, **kwargs) -> None:
    method get (line 65) | def get(cls, default: _DefaultT | EllipsisType = ...) -> _ContextT | _...

FILE: src/marshmallow/fields.py
  class _BaseFieldKwargs (line 87) | class _BaseFieldKwargs(typing.TypedDict, total=False):
  function _resolve_field_instance (line 101) | def _resolve_field_instance(cls_or_instance: Field | type[Field]) -> Field:
  class Field (line 115) | class Field(typing.Generic[_InternalT]):
    method __init__ (line 178) | def __init__(
    method __repr__ (line 233) | def __repr__(self) -> str:
    method __deepcopy__ (line 243) | def __deepcopy__(self, memo):
    method get_value (line 246) | def get_value(
    method _validate (line 266) | def _validate(self, value: typing.Any) -> None:
    method _validate_all (line 273) | def _validate_all(self) -> typing.Callable[[typing.Any], None]:
    method make_error (line 276) | def make_error(self, key: str, **kwargs) -> ValidationError:
    method _validate_missing (line 293) | def _validate_missing(self, value: typing.Any) -> None:
    method serialize (line 302) | def serialize(
    method deserialize (line 332) | def deserialize(
    method deserialize (line 342) | def deserialize(
    method deserialize (line 350) | def deserialize(
    method _bind_to_schema (line 380) | def _bind_to_schema(self, field_name: str, parent: Schema | Field) -> ...
    method _serialize (line 393) | def _serialize(
    method _deserialize (line 415) | def _deserialize(
  class Raw (line 437) | class Raw(Field[typing.Any]):
  class Nested (line 441) | class Nested(Field):
    method __init__ (line 496) | def __init__(
    method schema (line 528) | def schema(self) -> Schema:
    method _nested_normalized_option (line 576) | def _nested_normalized_option(self, option_name: str) -> list[str]:
    method _serialize (line 584) | def _serialize(self, nested_obj, attr, obj, **kwargs):
    method _test_collection (line 593) | def _test_collection(self, value: typing.Any) -> None:
    method _load (line 598) | def _load(
    method _deserialize (line 611) | def _deserialize(
  class Pluck (line 631) | class Pluck(Nested):
    method __init__ (line 657) | def __init__(
    method _field_data_key (line 672) | def _field_data_key(self) -> str:
    method _serialize (line 676) | def _serialize(self, nested_obj, attr, obj, **kwargs):
    method _deserialize (line 684) | def _deserialize(self, value, attr, data, partial=None, **kwargs):
  class List (line 693) | class List(Field[list[_InternalT | None]]):
    method __init__ (line 711) | def __init__(
    method _bind_to_schema (line 728) | def _bind_to_schema(self, field_name: str, parent: Schema | Field) -> ...
    method _serialize (line 736) | def _serialize(self, value, attr, obj, **kwargs) -> list[_InternalT] |...
    method _deserialize (line 741) | def _deserialize(self, value, attr, data, **kwargs) -> list[_InternalT...
  class Tuple (line 759) | class Tuple(Field[tuple]):
    method __init__ (line 782) | def __init__(
    method _bind_to_schema (line 806) | def _bind_to_schema(self, field_name: str, parent: Schema | Field) -> ...
    method _serialize (line 816) | def _serialize(
    method _deserialize (line 827) | def _deserialize(
  class String (line 855) | class String(Field[str]):
    method _serialize (line 867) | def _serialize(self, value, attr, obj, **kwargs) -> str | None:
    method _deserialize (line 872) | def _deserialize(self, value, attr, data, **kwargs) -> str:
  class UUID (line 881) | class UUID(Field[uuid.UUID]):
    method _validated (line 887) | def _validated(self, value) -> uuid.UUID:
    method _serialize (line 898) | def _serialize(self, value, attr, obj, **kwargs) -> str | None:
    method _deserialize (line 903) | def _deserialize(self, value, attr, data, **kwargs) -> uuid.UUID:
  class Number (line 910) | class Number(Field[_NumT]):
    method __init__ (line 929) | def __init__(self, *, as_string: bool = False, **kwargs: Unpack[_BaseF...
    method _format_num (line 933) | def _format_num(self, value) -> _NumT:
    method _validated (line 937) | def _validated(self, value: typing.Any) -> _NumT:
    method _to_string (line 949) | def _to_string(self, value: _NumT) -> str:
    method _serialize (line 952) | def _serialize(self, value, attr, obj, **kwargs) -> str | _NumT | None:
    method _deserialize (line 959) | def _deserialize(self, value, attr, data, **kwargs) -> _NumT:
  class Integer (line 963) | class Integer(Number[int]):
    method __init__ (line 976) | def __init__(
    method _validated (line 987) | def _validated(self, value: typing.Any) -> int:
  class Float (line 993) | class Float(Number[float]):
    method __init__ (line 1009) | def __init__(
    method _validated (line 1019) | def _validated(self, value: typing.Any) -> float:
  class Decimal (line 1027) | class Decimal(Number[decimal.Decimal]):
    method __init__ (line 1069) | def __init__(
    method _format_num (line 1086) | def _format_num(self, value):
    method _validated (line 1096) | def _validated(self, value: typing.Any) -> decimal.Decimal:
    method _to_string (line 1106) | def _to_string(self, value: decimal.Decimal) -> str:
  class Boolean (line 1110) | class Boolean(Field[bool]):
    method __init__ (line 1166) | def __init__(
    method _deserialize (line 1180) | def _deserialize(
  class _TemporalField (line 1202) | class _TemporalField(Field[_D], metaclass=abc.ABCMeta):
    method __init__ (line 1218) | def __init__(
    method _bind_to_schema (line 1229) | def _bind_to_schema(self, field_name, parent):
    method _serialize (line 1237) | def _serialize(self, value: _D | None, attr, obj, **kwargs) -> str | f...
    method _deserialize (line 1246) | def _deserialize(self, value, attr, data, **kwargs) -> _D:
    method _make_object_from_format (line 1263) | def _make_object_from_format(value: typing.Any, data_format: str) -> _...
  class DateTime (line 1266) | class DateTime(_TemporalField[dt.datetime]):
    method _make_object_from_format (line 1307) | def _make_object_from_format(value, data_format) -> dt.datetime:
  class NaiveDateTime (line 1311) | class NaiveDateTime(DateTime):
    method __init__ (line 1326) | def __init__(
    method _deserialize (line 1336) | def _deserialize(self, value, attr, data, **kwargs) -> dt.datetime:
  class AwareDateTime (line 1349) | class AwareDateTime(DateTime):
    method __init__ (line 1363) | def __init__(
    method _deserialize (line 1373) | def _deserialize(self, value, attr, data, **kwargs) -> dt.datetime:
  class Time (line 1386) | class Time(_TemporalField[dt.time]):
    method _make_object_from_format (line 1413) | def _make_object_from_format(value, data_format):
  class Date (line 1417) | class Date(_TemporalField[dt.date]):
    method _make_object_from_format (line 1448) | def _make_object_from_format(value, data_format):
  class TimeDelta (line 1452) | class TimeDelta(Field[dt.timedelta]):
    method __init__ (line 1504) | def __init__(
    method _serialize (line 1519) | def _serialize(self, value, attr, obj, **kwargs) -> float | None:
    method _deserialize (line 1528) | def _deserialize(self, value, attr, data, **kwargs) -> dt.timedelta:
  class Mapping (line 1547) | class Mapping(Field[_MappingT]):
    method __init__ (line 1569) | def __init__(
    method _bind_to_schema (line 1600) | def _bind_to_schema(self, field_name, parent):
    method _serialize (line 1612) | def _serialize(self, value, attr, obj, **kwargs):
    method _deserialize (line 1638) | def _deserialize(self, value, attr, data, **kwargs):
  class Dict (line 1681) | class Dict(Mapping[dict]):
  class Url (line 1696) | class Url(String):
    method __init__ (line 1711) | def __init__(
  class Email (line 1736) | class Email(String):
    method __init__ (line 1746) | def __init__(self, **kwargs: Unpack[_BaseFieldKwargs]) -> None:
  class IP (line 1753) | class IP(Field[ipaddress.IPv4Address | ipaddress.IPv6Address]):
    method __init__ (line 1766) | def __init__(self, *, exploded: bool = False, **kwargs: Unpack[_BaseFi...
    method _serialize (line 1770) | def _serialize(self, value, attr, obj, **kwargs) -> str | None:
    method _deserialize (line 1777) | def _deserialize(
  class IPv4 (line 1788) | class IPv4(IP):
  class IPv6 (line 1799) | class IPv6(IP):
  class IPInterface (line 1810) | class IPInterface(Field[ipaddress.IPv4Interface | ipaddress.IPv6Interfac...
    method __init__ (line 1828) | def __init__(self, *, exploded: bool = False, **kwargs: Unpack[_BaseFi...
    method _serialize (line 1832) | def _serialize(self, value, attr, obj, **kwargs) -> str | None:
    method _deserialize (line 1839) | def _deserialize(
  class IPv4Interface (line 1850) | class IPv4Interface(IPInterface):
  class IPv6Interface (line 1858) | class IPv6Interface(IPInterface):
  class Enum (line 1869) | class Enum(Field[_EnumT]):
    method __init__ (line 1887) | def __init__(
    method _serialize (line 1920) | def _serialize(
    method _deserialize (line 1931) | def _deserialize(self, value, attr, data, **kwargs) -> _EnumT:
  class Method (line 1946) | class Method(Field):
    method __init__ (line 1962) | def __init__(
    method _bind_to_schema (line 1977) | def _bind_to_schema(self, field_name, parent):
    method _serialize (line 1990) | def _serialize(self, value, attr, obj, **kwargs):
    method _deserialize (line 1995) | def _deserialize(self, value, attr, data, **kwargs):
  class Function (line 2001) | class Function(Field):
    method __init__ (line 2024) | def __init__(
    method _serialize (line 2045) | def _serialize(self, value, attr, obj, **kwargs):
    method _deserialize (line 2048) | def _deserialize(self, value, attr, data, **kwargs):
  class Constant (line 2057) | class Constant(Field[_ContantT]):
    method __init__ (line 2067) | def __init__(self, constant: _ContantT, **kwargs: Unpack[_BaseFieldKwa...
    method _serialize (line 2073) | def _serialize(self, value, *args, **kwargs) -> _ContantT:
    method _deserialize (line 2076) | def _deserialize(self, value, *args, **kwargs) -> _ContantT:

FILE: src/marshmallow/orderedset.py
  class OrderedSet (line 26) | class OrderedSet(MutableSet):  # noqa: PLW1641
    method __init__ (line 27) | def __init__(self, iterable=None):
    method __len__ (line 34) | def __len__(self):
    method __contains__ (line 37) | def __contains__(self, key):
    method add (line 40) | def add(self, key):
    method discard (line 46) | def discard(self, key):
    method __iter__ (line 52) | def __iter__(self):
    method __reversed__ (line 59) | def __reversed__(self):
    method pop (line 66) | def pop(self, last=True):
    method __repr__ (line 73) | def __repr__(self):
    method __eq__ (line 78) | def __eq__(self, other):

FILE: src/marshmallow/schema.py
  function _get_fields (line 45) | def _get_fields(attrs) -> list[tuple[str, Field]]:
  function _get_fields_by_mro (line 65) | def _get_fields_by_mro(klass: SchemaMeta):
  class SchemaMeta (line 88) | class SchemaMeta(ABCMeta):
    method __new__ (line 100) | def __new__(
    method get_declared_fields (line 132) | def get_declared_fields(
    method __init__ (line 151) | def __init__(cls, name, bases, attrs):
    method resolve_hooks (line 157) | def resolve_hooks(cls) -> dict[str, list[tuple[str, bool, dict]]]:
  class SchemaOpts (line 201) | class SchemaOpts:
    method __init__ (line 204) | def __init__(self, meta: type):
  class Schema (line 224) | class Schema(metaclass=SchemaMeta):
    class Meta (line 313) | class Meta:
    method __init__ (line 403) | def __init__(
    method __repr__ (line 445) | def __repr__(self) -> str:
    method from_dict (line 449) | def from_dict(
    method handle_error (line 481) | def handle_error(
    method get_attribute (line 495) | def get_attribute(self, obj: typing.Any, attr: str, default: typing.Any):
    method _call_and_store (line 506) | def _call_and_store(getter_func, data, *, field_name, error_store, ind...
    method _serialize (line 525) | def _serialize(self, obj: typing.Any, *, many: bool = False):
    method dump (line 543) | def dump(self, obj: typing.Any, *, many: bool | None = None):
    method dumps (line 576) | def dumps(self, obj: typing.Any, *args, many: bool | None = None, **kw...
    method _deserialize (line 592) | def _deserialize(
    method load (line 703) | def load(
    method loads (line 734) | def loads(
    method _run_validator (line 769) | def _run_validator(
    method validate (line 811) | def validate(
    method _do_load (line 838) | def _do_load(
    method _normalize_nested_options (line 942) | def _normalize_nested_options(self) -> None:
    method __apply_nested_option (line 959) | def __apply_nested_option(self, option_name, field_names, set_operatio...
    method _init_fields (line 978) | def _init_fields(self) -> None:
    method on_bind_field (line 1051) | def on_bind_field(self, field_name: str, field_obj: Field) -> None:
    method _bind_field (line 1058) | def _bind_field(self, field_name: str, field_obj: Field) -> None:
    method _invoke_dump_processors (line 1072) | def _invoke_dump_processors(
    method _invoke_load_processors (line 1089) | def _invoke_load_processors(
    method _invoke_field_validators (line 1120) | def _invoke_field_validators(self, *, error_store: ErrorStore, data, m...
    method _invoke_schema_validators (line 1170) | def _invoke_schema_validators(
    method _invoke_processors (line 1217) | def _invoke_processors(

FILE: src/marshmallow/types.py
  class SchemaValidator (line 22) | class SchemaValidator(typing.Protocol):
    method __call__ (line 23) | def __call__(
  class RenderModule (line 34) | class RenderModule(typing.Protocol):
    method dumps (line 35) | def dumps(
    method loads (line 39) | def loads(

FILE: src/marshmallow/utils.py
  function is_generator (line 13) | def is_generator(obj) -> typing.TypeGuard[typing.Generator]:
  function is_iterable_but_not_string (line 18) | def is_iterable_but_not_string(obj) -> typing.TypeGuard[typing.Iterable]:
  function is_sequence_but_not_string (line 23) | def is_sequence_but_not_string(obj) -> typing.TypeGuard[Sequence]:
  function is_collection (line 28) | def is_collection(obj) -> typing.TypeGuard[typing.Iterable]:
  function is_aware (line 34) | def is_aware(datetime: dt.datetime) -> bool:
  function from_timestamp (line 40) | def from_timestamp(value: typing.Any) -> dt.datetime:
  function from_timestamp_ms (line 57) | def from_timestamp_ms(value: typing.Any) -> dt.datetime:
  function timestamp (line 62) | def timestamp(
  function timestamp_ms (line 71) | def timestamp_ms(value: dt.datetime) -> float:
  function ensure_text_type (line 75) | def ensure_text_type(val: str | bytes) -> str:
  function pluck (line 81) | def pluck(dictlist: list[dict[str, typing.Any]], key: str):
  function get_value (line 95) | def get_value(obj, key: int | str, default=missing):
  function _get_value_for_keys (line 111) | def _get_value_for_keys(obj, keys, default):
  function _get_value_for_key (line 119) | def _get_value_for_key(obj, key, default):
  function set_value (line 129) | def set_value(dct: dict[str, typing.Any], key: str, value: typing.Any):
  function callable_or_raise (line 152) | def callable_or_raise(obj):
  function timedelta_to_microseconds (line 159) | def timedelta_to_microseconds(value: dt.timedelta) -> int:

FILE: src/marshmallow/validate.py
  class Validator (line 19) | class Validator(ABC):
    method __repr__ (line 29) | def __repr__(self) -> str:
    method _repr_args (line 35) | def _repr_args(self) -> str:
    method __call__ (line 42) | def __call__(self, value: typing.Any) -> typing.Any: ...
  class And (line 45) | class And(Validator):
    method __init__ (line 65) | def __init__(self, *validators: types.Validator):
    method _repr_args (line 68) | def _repr_args(self) -> str:
    method __call__ (line 71) | def __call__(self, value: typing.Any) -> typing.Any:
  class URL (line 88) | class URL(Validator):
    class RegexMemoizer (line 100) | class RegexMemoizer:
      method __init__ (line 101) | def __init__(self):
      method _regex_generator (line 104) | def _regex_generator(
      method __call__ (line 158) | def __call__(
    method __init__ (line 174) | def __init__(
    method _repr_args (line 193) | def _repr_args(self) -> str:
    method _format_error (line 196) | def _format_error(self, value) -> str:
    method __call__ (line 199) | def __call__(self, value: str) -> str:
  class Email (line 228) | class Email(Validator):
    method __init__ (line 257) | def __init__(self, *, error: str | None = None):
    method _format_error (line 260) | def _format_error(self, value: str) -> str:
    method __call__ (line 263) | def __call__(self, value: str) -> str:
  class Range (line 288) | class Range(Validator):
    method __init__ (line 316) | def __init__(
    method _repr_args (line 343) | def _repr_args(self) -> str:
    method _format_error (line 346) | def _format_error(self, value: _T, message: str) -> str:
    method __call__ (line 349) | def __call__(self, value: _T) -> _T:
  class Length (line 368) | class Length(Validator):
    method __init__ (line 388) | def __init__(
    method _repr_args (line 407) | def _repr_args(self) -> str:
    method _format_error (line 410) | def _format_error(self, value: _SizedT, message: str) -> str:
    method __call__ (line 415) | def __call__(self, value: _SizedT) -> _SizedT:
  class Equal (line 434) | class Equal(Validator):
    method __init__ (line 445) | def __init__(self, comparable, *, error: str | None = None):
    method _repr_args (line 449) | def _repr_args(self) -> str:
    method _format_error (line 452) | def _format_error(self, value: _T) -> str:
    method __call__ (line 455) | def __call__(self, value: _T) -> _T:
  class Regexp (line 461) | class Regexp(Validator):
    method __init__ (line 478) | def __init__(
    method _repr_args (line 490) | def _repr_args(self) -> str:
    method _format_error (line 493) | def _format_error(self, value: str | bytes) -> str:
    method __call__ (line 497) | def __call__(self, value: str) -> str: ...
    method __call__ (line 500) | def __call__(self, value: bytes) -> bytes: ...
    method __call__ (line 502) | def __call__(self, value):
  class Predicate (line 509) | class Predicate(Validator):
    method __init__ (line 523) | def __init__(self, method: str, *, error: str | None = None, **kwargs):
    method _repr_args (line 528) | def _repr_args(self) -> str:
    method _format_error (line 531) | def _format_error(self, value: typing.Any) -> str:
    method __call__ (line 534) | def __call__(self, value: _T) -> _T:
  class NoneOf (line 543) | class NoneOf(Validator):
    method __init__ (line 553) | def __init__(self, iterable: typing.Iterable, *, error: str | None = N...
    method _repr_args (line 558) | def _repr_args(self) -> str:
    method _format_error (line 561) | def _format_error(self, value) -> str:
    method __call__ (line 564) | def __call__(self, value: typing.Any) -> typing.Any:
  class OneOf (line 574) | class OneOf(Validator):
    method __init__ (line 585) | def __init__(
    method _repr_args (line 598) | def _repr_args(self) -> str:
    method _format_error (line 601) | def _format_error(self, value) -> str:
    method __call__ (line 606) | def __call__(self, value: typing.Any) -> typing.Any:
    method options (line 615) | def options(
  class ContainsOnly (line 634) | class ContainsOnly(OneOf):
    method _format_error (line 652) | def _format_error(self, value) -> str:
    method __call__ (line 656) | def __call__(self, value: typing.Sequence[_T]) -> typing.Sequence[_T]:
  class ContainsNoneOf (line 664) | class ContainsNoneOf(NoneOf):
    method _format_error (line 677) | def _format_error(self, value) -> str:
    method __call__ (line 681) | def __call__(self, value: typing.Sequence[_T]) -> typing.Sequence[_T]:

FILE: tests/base.py
  class GenderEnum (line 18) | class GenderEnum(IntEnum):
  class HairColorEnum (line 24) | class HairColorEnum(Enum):
  class DateEnum (line 31) | class DateEnum(Enum):
  function assert_date_equal (line 66) | def assert_date_equal(d1: dt.date, d2: dt.date) -> None:
  function assert_time_equal (line 72) | def assert_time_equal(t1: dt.time, t2: dt.time) -> None:
  function predicate (line 82) | def predicate(
  class User (line 95) | class User:
    method __init__ (line 98) | def __init__(
    method since_created (line 145) | def since_created(self):
    method __repr__ (line 148) | def __repr__(self):
  class Blog (line 152) | class Blog:
    method __init__ (line 153) | def __init__(self, title, user, collaborators=None, categories=None, i...
    method __contains__ (line 160) | def __contains__(self, item):
  class Uppercased (line 167) | class Uppercased(fields.String):
    method _serialize (line 170) | def _serialize(self, value, attr, obj, **kwargs):
  function get_lowername (line 176) | def get_lowername(obj):
  class UserSchema (line 184) | class UserSchema(Schema):
    class Meta (line 214) | class Meta:
    method get_is_old (line 217) | def get_is_old(self, obj):
    method make_user (line 230) | def make_user(self, data, **kwargs):
  class UserExcludeSchema (line 234) | class UserExcludeSchema(UserSchema):
    class Meta (line 235) | class Meta:
  class UserIntSchema (line 239) | class UserIntSchema(UserSchema):
  class UserFloatStringSchema (line 243) | class UserFloatStringSchema(UserSchema):
  class ExtendedUserSchema (line 247) | class ExtendedUserSchema(UserSchema):
  class UserRelativeUrlSchema (line 251) | class UserRelativeUrlSchema(UserSchema):
  class BlogSchema (line 255) | class BlogSchema(Schema):
  class BlogOnlySchema (line 263) | class BlogOnlySchema(Schema):
  class BlogSchemaExclude (line 269) | class BlogSchemaExclude(BlogSchema):
  class BlogSchemaOnlyExclude (line 273) | class BlogSchemaOnlyExclude(BlogSchema):
  class mockjson (line 277) | class mockjson:  # noqa: N801
    method dumps (line 279) | def dumps(val):
    method loads (line 283) | def loads(val):

FILE: tests/conftest.py
  function user (line 9) | def user():
  function blog (line 14) | def blog(user):
  function serialized_user (line 26) | def serialized_user(user):

FILE: tests/foo_serializer.py
  class FooSerializer (line 4) | class FooSerializer(Schema):

FILE: tests/mypy_test_cases/test_schema.py
  class MySchema (line 8) | class MySchema(Schema):
    class Meta (line 12) | class Meta(Schema.Meta):

FILE: tests/test_context.py
  class UserContextSchema (line 20) | class UserContextSchema(Schema):
    method get_is_owner (line 26) | def get_is_owner(self, user):
  class TestContext (line 30) | class TestContext:
    method test_context_load_dump (line 31) | def test_context_load_dump(self):
    method test_context_method (line 55) | def test_context_method(self):
    method test_context_function (line 66) | def test_context_function(self):
    method test_function_field_handles_bound_serializer (line 79) | def test_function_field_handles_bound_serializer(self):
    method test_nested_fields_inherit_context (line 95) | def test_nested_fields_inherit_context(self):
    method test_nested_list_fields_inherit_context (line 109) | def test_nested_list_fields_inherit_context(self):
    method test_nested_dict_fields_inherit_context (line 130) | def test_nested_dict_fields_inherit_context(self):
    method test_nested_field_with_unpicklable_object_in_context (line 151) | def test_nested_field_with_unpicklable_object_in_context(self):
    method test_function_field_passed_serialize_with_context (line 167) | def test_function_field_passed_serialize_with_context(self, user):
    method test_function_field_deserialization_with_context (line 178) | def test_function_field_deserialization_with_context(self):
    method test_decorated_processors_with_context (line 190) | def test_decorated_processors_with_context(self):
    method test_validates_schema_with_context (line 235) | def test_validates_schema_with_context(self):

FILE: tests/test_decorators.py
  function test_decorated_processors (line 22) | def test_decorated_processors(partial_val):
  function test_decorated_processor_returning_none (line 99) | def test_decorated_processor_returning_none(unknown):
  class TestPassOriginal (line 132) | class TestPassOriginal:
    method test_pass_original_single (line 133) | def test_pass_original_single(self):
    method test_pass_original_many (line 160) | def test_pass_original_many(self):
  function test_decorated_processor_inheritance (line 214) | def test_decorated_processor_inheritance():
  class ValidatesSchema (line 250) | class ValidatesSchema(Schema):
    method validate_foo (line 254) | def validate_foo(self, value, **kwargs):
  class TestValidatesDecorator (line 259) | class TestValidatesDecorator:
    method test_validates (line 260) | def test_validates(self):
    method test_validates_with_attribute (line 274) | def test_validates_with_attribute(self):
    method test_validates_decorator (line 289) | def test_validates_decorator(self):
    method test_field_not_present (line 330) | def test_field_not_present(self):
    method test_precedence (line 341) | def test_precedence(self):
    method test_validates_with_data_key (line 369) | def test_validates_with_data_key(self):
    method test_validates_accepts_multiple_fields (line 388) | def test_validates_accepts_multiple_fields(self):
  class TestValidatesSchemaDecorator (line 406) | class TestValidatesSchemaDecorator:
    method test_validator_nested_many_invalid_data (line 407) | def test_validator_nested_many_invalid_data(self):
    method test_validator_nested_many_schema_error (line 421) | def test_validator_nested_many_schema_error(self):
    method test_validator_nested_many_field_error (line 439) | def test_validator_nested_many_field_error(self):
    method test_validator_nested_many_pass_original_and_pass_collection (line 465) | def test_validator_nested_many_pass_original_and_pass_collection(
    method test_decorated_validators (line 488) | def test_decorated_validators(self):
    method test_multiple_validators (line 525) | def test_multiple_validators(self):
    method test_multiple_validators_merge_dict_errors (line 557) | def test_multiple_validators_merge_dict_errors(self):
    method test_passing_original_data (line 587) | def test_passing_original_data(self):
    method test_allow_reporting_field_errors_in_schema_validator (line 622) | def test_allow_reporting_field_errors_in_schema_validator(self):
    method test_allow_arbitrary_field_names_in_error (line 647) | def test_allow_arbitrary_field_names_in_error(self):
    method test_skip_on_field_errors (line 656) | def test_skip_on_field_errors(self):
    method test_data_key_is_used_in_errors_dict (line 697) | def test_data_key_is_used_in_errors_dict(self):
  function test_decorator_error_handling (line 725) | def test_decorator_error_handling():
  function test_decorator_error_handling_with_load (line 812) | def test_decorator_error_handling_with_load(decorator):
  function test_decorator_error_handling_with_load_dict_error (line 826) | def test_decorator_error_handling_with_load_dict_error(decorator):
  function test_decorator_error_handling_with_dump (line 840) | def test_decorator_error_handling_with_dump(decorator):
  class Nested (line 853) | class Nested:
    method __init__ (line 854) | def __init__(self, foo):
  class Example (line 858) | class Example:
    method __init__ (line 859) | def __init__(self, nested):
  function test_decorator_post_dump_with_nested_original_and_pass_collection (line 870) | def test_decorator_post_dump_with_nested_original_and_pass_collection(
  function test_decorator_post_load_with_nested_original_and_pass_collection (line 904) | def test_decorator_post_load_with_nested_original_and_pass_collection(
  function test_load_processors_receive_unknown (line 936) | def test_load_processors_receive_unknown(usage_location, unknown_val):
  function test_post_load_method_that_appends_to_data (line 968) | def test_post_load_method_that_appends_to_data():

FILE: tests/test_deserialization.py
  class MockDateTimeOverflowError (line 33) | class MockDateTimeOverflowError(dt.datetime):
    method fromtimestamp (line 36) | def fromtimestamp(self, *args, **kwargs):  # type: ignore[override]
  class MockDateTimeOSError (line 40) | class MockDateTimeOSError(dt.datetime):
    method fromtimestamp (line 43) | def fromtimestamp(self, *args, **kwargs):  # type: ignore[override]
  class TestDeserializingNone (line 47) | class TestDeserializingNone:
    method test_fields_allow_none_deserialize_to_none (line 49) | def test_fields_allow_none_deserialize_to_none(self, FieldClass):
    method test_fields_dont_allow_none_by_default (line 55) | def test_fields_dont_allow_none_by_default(self, FieldClass):
    method test_allow_none_is_true_if_missing_is_true (line 60) | def test_allow_none_is_true_if_missing_is_true(self):
    method test_list_field_deserialize_none_to_none (line 65) | def test_list_field_deserialize_none_to_none(self):
    method test_tuple_field_deserialize_none_to_none (line 69) | def test_tuple_field_deserialize_none_to_none(self):
    method test_list_of_nested_allow_none_deserialize_none_to_none (line 73) | def test_list_of_nested_allow_none_deserialize_none_to_none(self):
    method test_list_of_nested_non_allow_none_deserialize_none_to_validation_error (line 77) | def test_list_of_nested_non_allow_none_deserialize_none_to_validation_...
  class TestFieldDeserialization (line 83) | class TestFieldDeserialization:
    method test_float_field_deserialization (line 84) | def test_float_field_deserialization(self):
    method test_invalid_float_field_deserialization (line 90) | def test_invalid_float_field_deserialization(self, in_val):
    method test_float_field_overflow (line 96) | def test_float_field_overflow(self):
    method test_integer_field_deserialization (line 102) | def test_integer_field_deserialization(self):
    method test_strict_integer_field_deserialization (line 115) | def test_strict_integer_field_deserialization(self):
    method test_decimal_field_deserialization (line 128) | def test_decimal_field_deserialization(self):
    method test_decimal_field_with_places (line 152) | def test_decimal_field_with_places(self):
    method test_decimal_field_with_places_and_rounding (line 173) | def test_decimal_field_with_places_and_rounding(self):
    method test_decimal_field_deserialization_string (line 192) | def test_decimal_field_deserialization_string(self):
    method test_decimal_field_special_values (line 211) | def test_decimal_field_special_values(self):
    method test_decimal_field_special_values_not_permitted (line 257) | def test_decimal_field_special_values_not_permitted(self):
    method test_float_field_allow_nan (line 291) | def test_float_field_allow_nan(self, value, allow_nan):
    method test_string_field_deserialization (line 312) | def test_string_field_deserialization(self):
    method test_boolean_field_deserialization (line 325) | def test_boolean_field_deserialization(self):
    method test_boolean_field_deserialization_with_custom_truthy_values (line 364) | def test_boolean_field_deserialization_with_custom_truthy_values(self):
    method test_boolean_field_deserialization_with_custom_truthy_values_invalid (line 376) | def test_boolean_field_deserialization_with_custom_truthy_values_invalid(
    method test_boolean_field_deserialization_with_empty_truthy (line 399) | def test_boolean_field_deserialization_with_empty_truthy(self):
    method test_boolean_field_deserialization_with_custom_falsy_values (line 405) | def test_boolean_field_deserialization_with_custom_falsy_values(self):
    method test_field_toggle_show_invalid_value_in_error_message (line 410) | def test_field_toggle_show_invalid_value_in_error_message(self):
    method test_invalid_datetime_deserialization (line 449) | def test_invalid_datetime_deserialization(self, in_value):
    method test_custom_date_format_datetime_field_deserialization (line 454) | def test_custom_date_format_datetime_field_deserialization(self):
    method test_rfc_datetime_field_deserialization (line 498) | def test_rfc_datetime_field_deserialization(self, fmt, value, expected...
    method test_iso_datetime_field_deserialization (line 542) | def test_iso_datetime_field_deserialization(self, fmt, value, expected...
    method test_timestamp_field_deserialization (line 574) | def test_timestamp_field_deserialization(self, fmt, value, expected):
    method test_invalid_timestamp_field_deserialization (line 596) | def test_invalid_timestamp_field_deserialization(self, fmt, in_value):
    method test_oversized_timestamp_field_deserialization (line 606) | def test_oversized_timestamp_field_deserialization(self, fmt, mock_fro...
    method test_naive_datetime_with_timezone (line 648) | def test_naive_datetime_with_timezone(self, fmt, timezone, value, expe...
    method test_aware_datetime_default_timezone (line 657) | def test_aware_datetime_default_timezone(self, fmt, timezone, value):
    method test_time_field_deserialization (line 663) | def test_time_field_deserialization(self):
    method test_invalid_time_field_deserialization (line 677) | def test_invalid_time_field_deserialization(self, in_data):
    method test_custom_time_format_time_field_deserialization (line 683) | def test_custom_time_format_time_field_deserialization(self):
    method test_iso_time_field_deserialization (line 708) | def test_iso_time_field_deserialization(self, fmt, value, expected):
    method test_invalid_timedelta_precision (line 715) | def test_invalid_timedelta_precision(self):
    method test_timedelta_field_deserialization (line 719) | def test_timedelta_field_deserialization(self):
    method test_invalid_timedelta_field_deserialization (line 858) | def test_invalid_timedelta_field_deserialization(self, in_value):
    method test_date_field_deserialization (line 865) | def test_date_field_deserialization(self, format):  # noqa: A002
    method test_invalid_date_field_deserialization (line 876) | def test_invalid_date_field_deserialization(self, in_value):
    method test_dict_field_deserialization (line 883) | def test_dict_field_deserialization(self):
    method test_structured_dict_value_deserialization (line 895) | def test_structured_dict_value_deserialization(self):
    method test_structured_dict_key_deserialization (line 906) | def test_structured_dict_key_deserialization(self):
    method test_structured_dict_key_value_deserialization (line 914) | def test_structured_dict_key_value_deserialization(self):
    method test_url_field_deserialization (line 952) | def test_url_field_deserialization(self):
    method test_url_field_non_list_validators (line 964) | def test_url_field_non_list_validators(self):
    method test_relative_url_field_deserialization (line 969) | def test_relative_url_field_deserialization(self):
    method test_url_field_schemes_argument (line 973) | def test_url_field_schemes_argument(self):
    method test_email_field_deserialization (line 981) | def test_email_field_deserialization(self):
    method test_email_field_non_list_validators (line 994) | def test_email_field_non_list_validators(self):
    method test_function_field_deserialization_is_noop_by_default (line 999) | def test_function_field_deserialization_is_noop_by_default(self):
    method test_function_field_deserialization_with_callable (line 1005) | def test_function_field_deserialization_with_callable(self):
    method test_function_field_deserialization_missing_with_length_validator (line 1009) | def test_function_field_deserialization_missing_with_length_validator(...
    method test_function_field_passed_deserialize_only_is_load_only (line 1016) | def test_function_field_passed_deserialize_only_is_load_only(self):
    method test_function_field_passed_deserialize_and_serialize_is_not_load_only (line 1020) | def test_function_field_passed_deserialize_and_serialize_is_not_load_o...
    method test_uuid_field_deserialization (line 1026) | def test_uuid_field_deserialization(self):
    method test_invalid_uuid_deserialization (line 1044) | def test_invalid_uuid_deserialization(self, in_value):
    method test_ip_field_deserialization (line 1051) | def test_ip_field_deserialization(self):
    method test_invalid_ip_deserialization (line 1067) | def test_invalid_ip_deserialization(self, in_value):
    method test_ipv4_field_deserialization (line 1074) | def test_ipv4_field_deserialization(self):
    method test_invalid_ipv4_deserialization (line 1092) | def test_invalid_ipv4_deserialization(self, in_value):
    method test_ipv6_field_deserialization (line 1099) | def test_ipv6_field_deserialization(self):
    method test_ipinterface_field_deserialization (line 1106) | def test_ipinterface_field_deserialization(self):
    method test_invalid_ipinterface_deserialization (line 1130) | def test_invalid_ipinterface_deserialization(self, in_value):
    method test_ipv4interface_field_deserialization (line 1137) | def test_ipv4interface_field_deserialization(self):
    method test_invalid_ipv4interface_deserialization (line 1156) | def test_invalid_ipv4interface_deserialization(self, in_value):
    method test_ipv6interface_field_deserialization (line 1163) | def test_ipv6interface_field_deserialization(self):
    method test_invalid_ipv6interface_deserialization (line 1182) | def test_invalid_ipv6interface_deserialization(self, in_value):
    method test_enum_field_by_symbol_deserialization (line 1189) | def test_enum_field_by_symbol_deserialization(self):
    method test_enum_field_by_symbol_invalid_value (line 1193) | def test_enum_field_by_symbol_invalid_value(self):
    method test_enum_field_by_symbol_not_string (line 1200) | def test_enum_field_by_symbol_not_string(self):
    method test_enum_field_by_value_true_deserialization (line 1205) | def test_enum_field_by_value_true_deserialization(self):
    method test_enum_field_by_value_field_deserialization (line 1211) | def test_enum_field_by_value_field_deserialization(self):
    method test_enum_field_by_value_true_invalid_value (line 1219) | def test_enum_field_by_value_true_invalid_value(self):
    method test_enum_field_by_value_field_invalid_value (line 1230) | def test_enum_field_by_value_field_invalid_value(self):
    method test_enum_field_by_value_true_wrong_type (line 1246) | def test_enum_field_by_value_true_wrong_type(self):
    method test_enum_field_by_value_field_wrong_type (line 1257) | def test_enum_field_by_value_field_wrong_type(self):
    method test_deserialization_function_must_be_callable (line 1268) | def test_deserialization_function_must_be_callable(self):
    method test_method_field_deserialization_is_noop_by_default (line 1272) | def test_method_field_deserialization_is_noop_by_default(self):
    method test_deserialization_method (line 1282) | def test_deserialization_method(self):
    method test_deserialization_method_must_be_a_method (line 1295) | def test_deserialization_method_must_be_a_method(self):
    method test_method_field_deserialize_only (line 1302) | def test_method_field_deserialize_only(self):
    method test_datetime_list_field_deserialization (line 1311) | def test_datetime_list_field_deserialization(self):
    method test_list_field_deserialize_invalid_item (line 1320) | def test_list_field_deserialize_invalid_item(self):
    method test_list_field_deserialize_multiple_invalid_items (line 1331) | def test_list_field_deserialize_multiple_invalid_items(self):
    method test_list_field_deserialize_value_that_is_not_a_list (line 1344) | def test_list_field_deserialize_value_that_is_not_a_list(self, value):
    method test_datetime_int_tuple_field_deserialization (line 1350) | def test_datetime_int_tuple_field_deserialization(self):
    method test_tuple_field_deserialize_invalid_item (line 1364) | def test_tuple_field_deserialize_invalid_item(self):
    method test_tuple_field_deserialize_multiple_invalid_items (line 1375) | def test_tuple_field_deserialize_multiple_invalid_items(self):
    method test_tuple_field_deserialize_value_that_is_not_a_collection (line 1392) | def test_tuple_field_deserialize_value_that_is_not_a_collection(self, ...
    method test_tuple_field_deserialize_invalid_length (line 1398) | def test_tuple_field_deserialize_invalid_length(self):
    method test_constant_field_deserialization (line 1404) | def test_constant_field_deserialization(self):
    method test_constant_is_always_included_in_deserialized_data (line 1408) | def test_constant_is_always_included_in_deserialized_data(self):
    method test_constant_none_allows_none_value (line 1416) | def test_constant_none_allows_none_value(self):
    method test_field_deserialization_with_user_validator_function (line 1425) | def test_field_deserialization_with_user_validator_function(self):
    method test_field_deserialization_with_user_validator_that_raises_error_with_list (line 1433) | def test_field_deserialization_with_user_validator_that_raises_error_w...
    method test_field_deserialization_with_validator_with_nonascii_input (line 1445) | def test_field_deserialization_with_validator_with_nonascii_input(self):
    method test_field_deserialization_with_user_validators (line 1454) | def test_field_deserialization_with_user_validators(self):
    method test_fields_accept_internal_types (line 1518) | def test_fields_accept_internal_types(self, field, value):
  class SimpleUserSchema (line 1523) | class SimpleUserSchema(Schema):
  class Validator (line 1528) | class Validator(Schema):
  class Validators (line 1534) | class Validators(Schema):
  class TestSchemaDeserialization (line 1540) | class TestSchemaDeserialization:
    method test_deserialize_to_dict (line 1541) | def test_deserialize_to_dict(self):
    method test_deserialize_with_missing_values (line 1547) | def test_deserialize_with_missing_values(self):
    method test_deserialize_many (line 1553) | def test_deserialize_many(self):
    method test_exclude (line 1560) | def test_exclude(self):
    method test_nested_single_deserialization_to_dict (line 1566) | def test_nested_single_deserialization_to_dict(self):
    method test_nested_list_deserialization_to_dict (line 1581) | def test_nested_list_deserialization_to_dict(self):
    method test_nested_single_none_not_allowed (line 1599) | def test_nested_single_none_not_allowed(self):
    method test_nested_many_non_not_allowed (line 1611) | def test_nested_many_non_not_allowed(self):
    method test_nested_single_required_missing (line 1623) | def test_nested_single_required_missing(self):
    method test_nested_many_required_missing (line 1635) | def test_nested_many_required_missing(self):
    method test_nested_only_basestring (line 1647) | def test_nested_only_basestring(self):
    method test_nested_only_basestring_with_list_data (line 1659) | def test_nested_only_basestring_with_list_data(self):
    method test_nested_none_deserialization (line 1672) | def test_nested_none_deserialization(self):
    method test_deserialize_with_attribute_param (line 1682) | def test_deserialize_with_attribute_param(self):
    method test_deserialize_with_attribute_param_symmetry (line 1693) | def test_deserialize_with_attribute_param_symmetry(self):
    method test_deserialize_with_attribute_param_error_returns_field_name_not_attribute_name (line 1704) | def test_deserialize_with_attribute_param_error_returns_field_name_not...
    method test_deserialize_with_attribute_param_error_returns_data_key_not_attribute_name (line 1717) | def test_deserialize_with_attribute_param_error_returns_data_key_not_a...
    method test_deserialize_with_data_key_param (line 1732) | def test_deserialize_with_data_key_param(self):
    method test_deserialize_with_data_key_as_empty_string (line 1744) | def test_deserialize_with_data_key_as_empty_string(self):
    method test_deserialize_with_dump_only_param (line 1751) | def test_deserialize_with_dump_only_param(self):
    method test_deserialize_with_missing_param_value (line 1770) | def test_deserialize_with_missing_param_value(self):
    method test_deserialize_with_missing_param_callable (line 1782) | def test_deserialize_with_missing_param_callable(self):
    method test_deserialize_with_missing_param_none (line 1794) | def test_deserialize_with_missing_param_none(self):
    method test_deserialization_raises_with_errors (line 1804) | def test_deserialization_raises_with_errors(self):
    method test_deserialization_raises_with_errors_with_multiple_validators (line 1814) | def test_deserialization_raises_with_errors_with_multiple_validators(s...
    method test_deserialization_many_raises_errors (line 1824) | def test_deserialization_many_raises_errors(self):
    method test_validation_errors_are_stored (line 1833) | def test_validation_errors_are_stored(self):
    method test_multiple_errors_can_be_stored_for_a_field (line 1845) | def test_multiple_errors_can_be_stored_for_a_field(self):
    method test_multiple_errors_can_be_stored_for_an_email_field (line 1862) | def test_multiple_errors_can_be_stored_for_an_email_field(self):
    method test_multiple_errors_can_be_stored_for_a_url_field (line 1875) | def test_multiple_errors_can_be_stored_for_a_url_field(self):
    method test_required_value_only_passed_to_validators_if_provided (line 1888) | def test_required_value_only_passed_to_validators_if_provided(self):
    method test_partial_deserialization (line 1900) | def test_partial_deserialization(self, partial_schema):
    method test_partial_fields_deserialization (line 1914) | def test_partial_fields_deserialization(self):
    method test_partial_fields_validation (line 1939) | def test_partial_fields_validation(self):
    method test_unknown_fields_deserialization (line 1955) | def test_unknown_fields_deserialization(self):
    method test_unknown_fields_deserialization_precedence (line 2000) | def test_unknown_fields_deserialization_precedence(self):
    method test_unknown_fields_deserialization_with_data_key (line 2022) | def test_unknown_fields_deserialization_with_data_key(self):
    method test_unknown_fields_deserialization_with_index_errors_false (line 2041) | def test_unknown_fields_deserialization_with_index_errors_false(self):
    method test_dump_only_fields_considered_unknown (line 2058) | def test_dump_only_fields_considered_unknown(self):
    method test_unknown_fields_do_not_unpack_dotted_names (line 2073) | def test_unknown_fields_do_not_unpack_dotted_names(self):
  class TestValidation (line 2107) | class TestValidation:
    method test_integer_with_validator (line 2108) | def test_integer_with_validator(self):
    method test_integer_with_validators (line 2127) | def test_integer_with_validators(self, field):
    method test_float_with_validators (line 2145) | def test_float_with_validators(self, field):
    method test_string_validator (line 2150) | def test_string_validator(self):
    method test_function_validator (line 2156) | def test_function_validator(self):
    method test_function_validators (line 2184) | def test_function_validators(self, field):
    method test_method_validator (line 2189) | def test_method_validator(self):
    method test_nested_data_is_stored_when_validation_fails (line 2203) | def test_nested_data_is_stored_when_validation_fails(self):
    method test_nested_partial_load (line 2227) | def test_nested_partial_load(self):
    method test_deeply_nested_partial_load (line 2247) | def test_deeply_nested_partial_load(self):
    method test_nested_partial_tuple (line 2271) | def test_nested_partial_tuple(self):
    method test_nested_partial_default (line 2287) | def test_nested_partial_default(self):
  function test_required_field_failure (line 2304) | def test_required_field_failure(FieldClass):
  function test_required_message_can_be_changed (line 2323) | def test_required_message_can_be_changed(message):
  function test_deserialize_raises_exception_if_input_type_is_incorrect (line 2337) | def test_deserialize_raises_exception_if_input_type_is_incorrect(data, u...

FILE: tests/test_error_store.py
  function test_missing_is_falsy (line 7) | def test_missing_is_falsy():
  class CustomError (line 11) | class CustomError(NamedTuple):
  class TestMergeErrors (line 16) | class TestMergeErrors:
    method test_merging_none_and_string (line 17) | def test_merging_none_and_string(self):
    method test_merging_none_and_custom_error (line 20) | def test_merging_none_and_custom_error(self):
    method test_merging_none_and_list (line 25) | def test_merging_none_and_list(self):
    method test_merging_none_and_dict (line 28) | def test_merging_none_and_dict(self):
    method test_merging_string_and_none (line 31) | def test_merging_string_and_none(self):
    method test_merging_custom_error_and_none (line 34) | def test_merging_custom_error_and_none(self):
    method test_merging_list_and_none (line 39) | def test_merging_list_and_none(self):
    method test_merging_dict_and_none (line 42) | def test_merging_dict_and_none(self):
    method test_merging_string_and_string (line 45) | def test_merging_string_and_string(self):
    method test_merging_custom_error_and_string (line 48) | def test_merging_custom_error_and_string(self):
    method test_merging_string_and_custom_error (line 53) | def test_merging_string_and_custom_error(self):
    method test_merging_custom_error_and_custom_error (line 58) | def test_merging_custom_error_and_custom_error(self):
    method test_merging_string_and_list (line 63) | def test_merging_string_and_list(self):
    method test_merging_string_and_dict (line 66) | def test_merging_string_and_dict(self):
    method test_merging_string_and_dict_with_schema_error (line 72) | def test_merging_string_and_dict_with_schema_error(self):
    method test_merging_custom_error_and_list (line 78) | def test_merging_custom_error_and_list(self):
    method test_merging_custom_error_and_dict (line 83) | def test_merging_custom_error_and_dict(self):
    method test_merging_custom_error_and_dict_with_schema_error (line 89) | def test_merging_custom_error_and_dict_with_schema_error(self):
    method test_merging_list_and_string (line 97) | def test_merging_list_and_string(self):
    method test_merging_list_and_custom_error (line 100) | def test_merging_list_and_custom_error(self):
    method test_merging_list_and_list (line 105) | def test_merging_list_and_list(self):
    method test_merging_list_and_dict (line 108) | def test_merging_list_and_dict(self):
    method test_merging_list_and_dict_with_schema_error (line 114) | def test_merging_list_and_dict_with_schema_error(self):
    method test_merging_dict_and_string (line 120) | def test_merging_dict_and_string(self):
    method test_merging_dict_and_custom_error (line 126) | def test_merging_dict_and_custom_error(self):
    method test_merging_dict_and_list (line 132) | def test_merging_dict_and_list(self):
    method test_merging_dict_and_dict (line 138) | def test_merging_dict_and_dict(self):
    method test_deep_merging_dicts (line 148) | def test_deep_merging_dicts(self):
    method test_list_not_changed (line 153) | def test_list_not_changed(self):
    method test_dict_not_changed (line 161) | def test_dict_not_changed(self):

FILE: tests/test_exceptions.py
  class TestValidationError (line 6) | class TestValidationError:
    method test_stores_message_in_list (line 7) | def test_stores_message_in_list(self):
    method test_can_pass_list_of_messages (line 11) | def test_can_pass_list_of_messages(self):
    method test_stores_dictionaries (line 15) | def test_stores_dictionaries(self):
    method test_can_store_field_name (line 20) | def test_can_store_field_name(self):
    method test_str (line 24) | def test_str(self):
    method test_stores_dictionaries_in_messages_dict (line 31) | def test_stores_dictionaries_in_messages_dict(self):
    method test_messages_dict_type_error_on_badval (line 36) | def test_messages_dict_type_error_on_badval(self):

FILE: tests/test_fields.py
  function test_field_aliases (line 26) | def test_field_aliases(alias, field):
  class TestField (line 30) | class TestField:
    method test_repr (line 31) | def test_repr(self):
    method test_error_raised_if_uncallable_validator_passed (line 44) | def test_error_raised_if_uncallable_validator_passed(self):
    method test_error_raised_if_missing_is_set_on_required_field (line 48) | def test_error_raised_if_missing_is_set_on_required_field(self):
    method test_custom_field_receives_attr_and_obj (line 54) | def test_custom_field_receives_attr_and_obj(self):
    method test_custom_field_receives_data_key_if_set (line 67) | def test_custom_field_receives_data_key_if_set(self):
    method test_custom_field_follows_data_key_if_set (line 80) | def test_custom_field_follows_data_key_if_set(self):
  class TestParentAndName (line 94) | class TestParentAndName:
    class MySchema (line 95) | class MySchema(Schema):
    method schema (line 102) | def schema(self):
    method test_simple_field_parent_and_name (line 105) | def test_simple_field_parent_and_name(self, schema):
    method test_unbound_field_root_returns_none (line 112) | def test_unbound_field_root_returns_none(self):
    method test_list_field_inner_parent_and_name (line 122) | def test_list_field_inner_parent_and_name(self, schema):
    method test_tuple_field_inner_parent_and_name (line 126) | def test_tuple_field_inner_parent_and_name(self, schema):
    method test_mapping_field_inner_parent_and_name (line 131) | def test_mapping_field_inner_parent_and_name(self, schema):
    method test_simple_field_root (line 137) | def test_simple_field_root(self, schema):
    method test_list_field_inner_root (line 141) | def test_list_field_inner_root(self, schema):
    method test_tuple_field_inner_root (line 144) | def test_tuple_field_inner_root(self, schema):
    method test_list_root_inheritance (line 148) | def test_list_root_inheritance(self, schema):
    method test_dict_root_inheritance (line 162) | def test_dict_root_inheritance(self):
    method test_datetime_list_inner_format (line 187) | def test_datetime_list_inner_format(self, schema):
    method test_field_named_parent_has_root (line 205) | def test_field_named_parent_has_root(self, schema):
  class TestMetadata (line 213) | class TestMetadata:
    method test_extra_metadata_may_be_added_to_field (line 215) | def test_extra_metadata_may_be_added_to_field(self, FieldClass):
  class TestErrorMessages (line 225) | class TestErrorMessages:
    class MyField (line 226) | class MyField(fields.Field):
    method test_default_error_messages_get_merged_with_parent_error_messages_cstm_msg (line 236) | def test_default_error_messages_get_merged_with_parent_error_messages_...
    method test_default_error_messages_get_merged_with_parent_error_messages (line 243) | def test_default_error_messages_get_merged_with_parent_error_messages(...
    method test_make_error (line 248) | def test_make_error(self, key, message):
    method test_make_error_key_doesnt_exist (line 254) | def test_make_error_key_doesnt_exist(self):
  class TestNestedField (line 261) | class TestNestedField:
    method test_nested_only_and_exclude_as_string (line 263) | def test_nested_only_and_exclude_as_string(self, param):
    method test_nested_instantiation_from_dict (line 274) | def test_nested_instantiation_from_dict(self, nested_value):
    method test_nested_unknown_override (line 288) | def test_nested_unknown_override(self, schema_unknown, field_unknown):
    method test_nested_schema_only_and_exclude (line 311) | def test_nested_schema_only_and_exclude(self, param, fields_list):
  class TestListNested (line 327) | class TestListNested:
    method test_list_nested_only_exclude_dump_only_load_only_propagated_to_nested (line 329) | def test_list_nested_only_exclude_dump_only_load_only_propagated_to_ne...
    method test_list_nested_class_only_and_exclude_merged_with_nested (line 352) | def test_list_nested_class_only_and_exclude_merged_with_nested(
    method test_list_nested_class_multiple_dumps (line 371) | def test_list_nested_class_multiple_dumps(self):
    method test_list_nested_instance_only_and_exclude_merged_with_nested (line 395) | def test_list_nested_instance_only_and_exclude_merged_with_nested(
    method test_list_nested_instance_multiple_dumps (line 415) | def test_list_nested_instance_multiple_dumps(self):
    method test_list_nested_lambda_only_and_exclude_merged_with_nested (line 439) | def test_list_nested_lambda_only_and_exclude_merged_with_nested(
    method test_list_nested_partial_propagated_to_nested (line 461) | def test_list_nested_partial_propagated_to_nested(self):
  class TestTupleNested (line 490) | class TestTupleNested:
    method test_tuple_nested_only_exclude_dump_only_load_only_propagated_to_nested (line 492) | def test_tuple_nested_only_exclude_dump_only_load_only_propagated_to_n...
    method test_tuple_nested_partial_propagated_to_nested (line 511) | def test_tuple_nested_partial_propagated_to_nested(self):
  class TestDictNested (line 540) | class TestDictNested:
    method test_dict_nested_only_exclude_dump_only_load_only_propagated_to_nested (line 542) | def test_dict_nested_only_exclude_dump_only_load_only_propagated_to_ne...
    method test_dict_nested_only_and_exclude_merged_with_nested (line 562) | def test_dict_nested_only_and_exclude_merged_with_nested(self, param, ...
    method test_dict_nested_partial_propagated_to_nested (line 578) | def test_dict_nested_partial_propagated_to_nested(self):

FILE: tests/test_options.py
  class UserSchema (line 6) | class UserSchema(Schema):
  class ProfileSchema (line 16) | class ProfileSchema(Schema):
  class TestFieldOrdering (line 20) | class TestFieldOrdering:
    method test_declared_field_order_is_maintained_on_dump (line 21) | def test_declared_field_order_is_maintained_on_dump(self, user):
    method test_declared_field_order_is_maintained_on_load (line 35) | def test_declared_field_order_is_maintained_on_load(self, serialized_u...
    method test_nested_field_order_with_only_arg_is_maintained_on_dump (line 49) | def test_nested_field_order_with_only_arg_is_maintained_on_dump(self, ...
    method test_nested_field_order_with_only_arg_is_maintained_on_load (line 64) | def test_nested_field_order_with_only_arg_is_maintained_on_load(self):
    method test_nested_field_order_with_exclude_arg_is_maintained (line 91) | def test_nested_field_order_with_exclude_arg_is_maintained(self, user):
  class TestIncludeOption (line 102) | class TestIncludeOption:
    class AddFieldsSchema (line 103) | class AddFieldsSchema(Schema):
      class Meta (line 106) | class Meta:
    method test_fields_are_added (line 109) | def test_fields_are_added(self):
    method test_included_fields_ordered_after_declared_fields (line 115) | def test_included_fields_ordered_after_declared_fields(self):
    method test_added_fields_are_inherited (line 142) | def test_added_fields_are_inherited(self):
  class TestManyOption (line 152) | class TestManyOption:
    class ManySchema (line 153) | class ManySchema(Schema):
      class Meta (line 156) | class Meta:
    method test_many_by_default (line 159) | def test_many_by_default(self):
    method test_explicit_single (line 163) | def test_explicit_single(self):

FILE: tests/test_registry.py
  function test_serializer_has_class_registry (line 7) | def test_serializer_has_class_registry():
  function test_register_class_meta_option (line 22) | def test_register_class_meta_option():
  function test_serializer_class_registry_register_same_classname_different_module (line 54) | def test_serializer_class_registry_register_same_classname_different_mod...
  function test_serializer_class_registry_override_if_same_classname_same_module (line 90) | def test_serializer_class_registry_override_if_same_classname_same_modul...
  class A (line 123) | class A:
    method __init__ (line 124) | def __init__(self, _id, b=None):
  class B (line 129) | class B:
    method __init__ (line 130) | def __init__(self, _id, a=None):
  class C (line 135) | class C:
    method __init__ (line 136) | def __init__(self, _id, bs=None):
  class ASchema (line 141) | class ASchema(Schema):
  class BSchema (line 146) | class BSchema(Schema):
  class CSchema (line 151) | class CSchema(Schema):
  function test_two_way_nesting (line 156) | def test_two_way_nesting():
  function test_nesting_with_class_name_many (line 167) | def test_nesting_with_class_name_many():
  function test_invalid_class_name_in_nested_field_raises_error (line 176) | def test_invalid_class_name_in_nested_field_raises_error(user):
  class FooSerializer (line 186) | class FooSerializer(Schema):
  function test_multiple_classes_with_same_name_raises_error (line 190) | def test_multiple_classes_with_same_name_raises_error():
  function test_multiple_classes_with_all (line 205) | def test_multiple_classes_with_all():
  function test_can_use_full_module_path_to_class (line 213) | def test_can_use_full_module_path_to_class():

FILE: tests/test_schema.py
  function test_serializing_basic_object (line 44) | def test_serializing_basic_object(user):
  function test_serializer_dump (line 52) | def test_serializer_dump(user):
  function test_load_resets_errors (line 58) | def test_load_resets_errors():
  function test_load_validation_error_stores_input_data_and_valid_data (line 75) | def test_load_validation_error_stores_input_data_and_valid_data():
  function test_load_resets_error_fields (line 101) | def test_load_resets_error_fields():
  function test_errored_fields_do_not_appear_in_output (line 118) | def test_errored_fields_do_not_appear_in_output():
  function test_load_many_stores_error_indices (line 140) | def test_load_many_stores_error_indices():
  function test_dump_many (line 155) | def test_dump_many():
  function test_multiple_errors_can_be_stored_for_a_given_index (line 163) | def test_multiple_errors_can_be_stored_for_a_given_index():
  function test_dump_returns_a_dict (line 179) | def test_dump_returns_a_dict(user):
  function test_dumps_returns_a_string (line 185) | def test_dumps_returns_a_string(user):
  function test_dumping_single_object_with_collection_schema (line 191) | def test_dumping_single_object_with_collection_schema(user):
  function test_loading_single_object_with_collection_schema (line 198) | def test_loading_single_object_with_collection_schema():
  function test_dumps_many (line 206) | def test_dumps_many():
  function test_load_returns_an_object (line 215) | def test_load_returns_an_object():
  function test_load_many (line 221) | def test_load_many():
  function test_load_invalid_input_type (line 231) | def test_load_invalid_input_type(val):
  function test_load_many_invalid_input_type (line 243) | def test_load_many_invalid_input_type(val):
  function test_load_many_empty_collection (line 254) | def test_load_many_empty_collection(val):
  function test_load_many_in_nested_invalid_input_type (line 262) | def test_load_many_in_nested_invalid_input_type(val):
  function test_load_many_in_nested_empty_collection (line 280) | def test_load_many_in_nested_empty_collection(val):
  function test_loads_returns_a_user (line 291) | def test_loads_returns_a_user():
  function test_loads_many (line 297) | def test_loads_many():
  function test_loads_deserializes_from_json (line 306) | def test_loads_deserializes_from_json():
  function test_serializing_none (line 315) | def test_serializing_none():
  function test_default_many_symmetry (line 325) | def test_default_many_symmetry():
  function test_on_bind_field_hook (line 336) | def test_on_bind_field_hook():
  function test_nested_on_bind_field_hook (line 348) | def test_nested_on_bind_field_hook():
  class TestValidate (line 365) | class TestValidate:
    method test_validate_raises_with_errors_dict (line 366) | def test_validate_raises_with_errors_dict(self):
    method test_validate_many (line 377) | def test_validate_many(self):
    method test_validate_many_doesnt_store_index_if_index_errors_option_is_false (line 387) | def test_validate_many_doesnt_store_index_if_index_errors_option_is_fa...
    method test_validate (line 403) | def test_validate(self):
    method test_validate_required (line 408) | def test_validate_required(self):
  function test_fields_are_not_copies (line 418) | def test_fields_are_not_copies():
  function test_dumps_returns_json (line 424) | def test_dumps_returns_json(user):
  function test_naive_datetime_field (line 433) | def test_naive_datetime_field(user, serialized_user):
  function test_datetime_formatted_field (line 438) | def test_datetime_formatted_field(user, serialized_user):
  function test_datetime_iso_field (line 443) | def test_datetime_iso_field(user, serialized_user):
  function test_tz_datetime_field (line 447) | def test_tz_datetime_field(user, serialized_user):
  function test_class_variable (line 453) | def test_class_variable(serialized_user):
  function test_serialize_many (line 457) | def test_serialize_many():
  function test_inheriting_schema (line 467) | def test_inheriting_schema(user):
  function test_custom_field (line 476) | def test_custom_field(serialized_user, user):
  function test_url_field (line 480) | def test_url_field(serialized_user, user):
  function test_relative_url_field (line 484) | def test_relative_url_field():
  function test_stores_invalid_url_error (line 489) | def test_stores_invalid_url_error():
  function test_email_field (line 499) | def test_email_field():
  function test_stored_invalid_email (line 505) | def test_stored_invalid_email():
  function test_integer_field (line 514) | def test_integer_field():
  function test_as_string (line 521) | def test_as_string():
  function test_method_field (line 528) | def test_method_field(serialized_user):
  function test_function_field (line 534) | def test_function_field(serialized_user, user):
  function test_fields_must_be_declared_as_instances (line 538) | def test_fields_must_be_declared_as_instances(user):
  function test_bind_field_does_not_swallow_typeerror (line 548) | def test_bind_field_does_not_swallow_typeerror():
  function test_serializing_generator (line 559) | def test_serializing_generator():
  function test_serializing_empty_list_returns_empty_list (line 567) | def test_serializing_empty_list_returns_empty_list():
  function test_serializing_dict (line 571) | def test_serializing_dict():
  function test_exclude_in_init (line 584) | def test_exclude_in_init(user):
  function test_only_in_init (line 591) | def test_only_in_init(user):
  function test_invalid_only_param (line 598) | def test_invalid_only_param(user):
  function test_can_serialize_uuid (line 603) | def test_can_serialize_uuid(serialized_user, user):
  function test_can_serialize_time (line 607) | def test_can_serialize_time(user, serialized_user):
  function test_render_module (line 612) | def test_render_module():
  function test_custom_error_message (line 625) | def test_custom_error_message():
  function test_custom_unknown_error_message (line 641) | def test_custom_unknown_error_message():
  function test_custom_type_error_message (line 656) | def test_custom_type_error_message():
  function test_custom_type_error_message_with_many (line 671) | def test_custom_type_error_message_with_many():
  function test_custom_error_messages_with_inheritance (line 686) | def test_custom_error_messages_with_inheritance():
  function test_load_errors_with_many (line 720) | def test_load_errors_with_many():
  function test_error_raised_if_fields_option_is_not_list (line 739) | def test_error_raised_if_fields_option_is_not_list():
  function test_nested_custom_set_in_exclude_reusing_schema (line 749) | def test_nested_custom_set_in_exclude_reusing_schema():
  function test_nested_only (line 777) | def test_nested_only():
  function test_nested_only_inheritance (line 800) | def test_nested_only_inheritance():
  function test_nested_only_empty_inheritance (line 823) | def test_nested_only_empty_inheritance():
  function test_nested_exclude (line 846) | def test_nested_exclude():
  function test_nested_exclude_inheritance (line 869) | def test_nested_exclude_inheritance():
  function test_nested_only_and_exclude (line 892) | def test_nested_only_and_exclude():
  function test_nested_only_then_exclude_inheritance (line 915) | def test_nested_only_then_exclude_inheritance():
  function test_nested_exclude_then_only_inheritance (line 938) | def test_nested_exclude_then_only_inheritance():
  function test_nested_exclude_and_only_inheritance (line 961) | def test_nested_exclude_and_only_inheritance():
  function test_nested_instance_many (line 993) | def test_nested_instance_many():
  function test_nested_many_should_override_schema_many_case1 (line 1015) | def test_nested_many_should_override_schema_many_case1():
  function test_nested_many_should_override_schema_many_case2 (line 1037) | def test_nested_many_should_override_schema_many_case2():
  function test_nested_instance_only (line 1059) | def test_nested_instance_only():
  function test_nested_instance_exclude (line 1076) | def test_nested_instance_exclude():
  function test_meta_nested_exclude (line 1093) | def test_meta_nested_exclude():
  function test_nested_custom_set_not_implementing_getitem (line 1132) | def test_nested_custom_set_not_implementing_getitem():
  function test_deeply_nested_only_and_exclude (line 1186) | def test_deeply_nested_only_and_exclude():
  function test_nested_lambda (line 1221) | def test_nested_lambda():
  function test_data_key_collision (line 1271) | def test_data_key_collision(data_key):
  function test_attribute_collision (line 1286) | def test_attribute_collision(attribute):
  class TestDeeplyNestedLoadOnly (line 1300) | class TestDeeplyNestedLoadOnly:
    method schema (line 1302) | def schema(self):
    method data (line 1334) | def data(self):
    method test_load_only (line 1351) | def test_load_only(self, schema, data):
    method test_dump_only (line 1365) | def test_dump_only(self, schema, data):
  class TestDeeplyNestedListLoadOnly (line 1380) | class TestDeeplyNestedListLoadOnly:
    method schema (line 1382) | def schema(self):
    method data (line 1400) | def data(self):
    method test_load_only (line 1414) | def test_load_only(self, schema, data):
    method test_dump_only (line 1424) | def test_dump_only(self, schema, data):
  function test_nested_constructor_only_and_exclude (line 1435) | def test_nested_constructor_only_and_exclude():
  function test_only_and_exclude (line 1469) | def test_only_and_exclude():
  function test_invalid_only_and_exclude_with_fields (line 1482) | def test_invalid_only_and_exclude_with_fields():
  function test_exclude_invalid_attribute (line 1497) | def test_exclude_invalid_attribute():
  function test_only_bounded_by_fields (line 1505) | def test_only_bounded_by_fields():
  function test_only_bounded_by_additional (line 1514) | def test_only_bounded_by_additional():
  function test_only_empty (line 1523) | def test_only_empty():
  function test_only_and_exclude_as_string (line 1532) | def test_only_and_exclude_as_string(param):
  function test_nested_with_sets (line 1540) | def test_nested_with_sets():
  function test_meta_field_not_on_obj_raises_attribute_error (line 1557) | def test_meta_field_not_on_obj_raises_attribute_error(user):
  function test_exclude_fields (line 1567) | def test_exclude_fields(user):
  function test_fields_option_must_be_list_or_tuple (line 1574) | def test_fields_option_must_be_list_or_tuple():
  function test_exclude_option_must_be_list_or_tuple (line 1582) | def test_exclude_option_must_be_list_or_tuple():
  function test_datetimeformat_option (line 1590) | def test_datetimeformat_option(user):
  function test_dateformat_option (line 1606) | def test_dateformat_option(user):
  function test_timeformat_option (line 1622) | def test_timeformat_option(user):
  function test_default_dateformat (line 1638) | def test_default_dateformat(user):
  class CustomError (line 1648) | class CustomError(Exception):
  class MySchema (line 1652) | class MySchema(Schema):
    method handle_error (line 1657) | def handle_error(self, error, data, *args, **kwargs):
    method test_load_with_custom_error_handler (line 1660) | def test_load_with_custom_error_handler(self):
    method test_load_with_custom_error_handler_and_partially_valid_data (line 1677) | def test_load_with_custom_error_handler_and_partially_valid_data(self):
    method test_custom_error_handler_with_validates_decorator (line 1695) | def test_custom_error_handler_with_validates_decorator(self):
    method test_custom_error_handler_with_validates_schema_decorator (line 1717) | def test_custom_error_handler_with_validates_schema_decorator(self):
    method test_validate_with_custom_error_handler (line 1737) | def test_validate_with_custom_error_handler(self):
  class TestFieldValidation (line 1742) | class TestFieldValidation:
    method test_errors_are_cleared_after_loading_collection (line 1743) | def test_errors_are_cleared_after_loading_collection(self):
    method test_raises_error_with_list (line 1761) | def test_raises_error_with_list(self):
    method test_raises_error_with_dict (line 1773) | def test_raises_error_with_dict(self):
    method test_ignored_if_not_in_only (line 1784) | def test_ignored_if_not_in_only(self):
  function test_schema_repr (line 1802) | def test_schema_repr():
  class TestNestedSchema (line 1812) | class TestNestedSchema:
    method user (line 1814) | def user(self):
    method blog (line 1818) | def blog(self, user):
    method test_nested_many_with_missing_attribute (line 1829) | def test_nested_many_with_missing_attribute(self, user):
    method test_nested_with_attribute_none (line 1839) | def test_nested_with_attribute_none(self):
    method test_nested_field_does_not_validate_required (line 1857) | def test_nested_field_does_not_validate_required(self):
    method test_nested_none (line 1864) | def test_nested_none(self):
    method test_nested (line 1872) | def test_nested(self, user, blog):
    method test_nested_many_fields (line 1884) | def test_nested_many_fields(self, blog):
    method test_nested_only (line 1889) | def test_nested_only(self, blog):
    method test_exclude (line 1896) | def test_exclude(self, blog):
    method test_list_field (line 1900) | def test_list_field(self, blog):
    method test_nested_load_many (line 1904) | def test_nested_load_many(self):
    method test_nested_errors (line 1918) | def test_nested_errors(self):
    method test_nested_method_field (line 1930) | def test_nested_method_field(self, blog):
    method test_nested_function_field (line 1935) | def test_nested_function_field(self, blog, user):
    method test_nested_fields_must_be_passed_a_serializer (line 1941) | def test_nested_fields_must_be_passed_a_serializer(self, blog):
    method test_invalid_type_passed_to_nested_field (line 1949) | def test_invalid_type_passed_to_nested_field(self):
    method test_all_errors_on_many_nested_field_with_validates_decorator (line 1976) | def test_all_errors_on_many_nested_field_with_validates_decorator(self):
    method test_nested_unknown_validation (line 1995) | def test_nested_unknown_validation(self, unknown):
  class TestPluckSchema (line 2016) | class TestPluckSchema:
    method test_pluck (line 2018) | def test_pluck(self, user_schema, blog):
    method test_pluck_none (line 2029) | def test_pluck_none(self, blog):
    method test_pluck_with_data_key (line 2044) | def test_pluck_with_data_key(self, blog):
  class TestSelfReference (line 2064) | class TestSelfReference:
    method employer (line 2066) | def employer(self):
    method user (line 2070) | def user(self, employer):
    method test_nesting_schema_by_passing_lambda (line 2073) | def test_nesting_schema_by_passing_lambda(self, user, employer):
    method test_nesting_schema_by_passing_class_name (line 2086) | def test_nesting_schema_by_passing_class_name(self, user, employer):
    method test_nesting_within_itself_exclude (line 2097) | def test_nesting_within_itself_exclude(self, user, employer):
    method test_nested_self_with_only_param (line 2109) | def test_nested_self_with_only_param(self, user, employer):
    method test_multiple_pluck_self_lambda (line 2119) | def test_multiple_pluck_self_lambda(self, user):
    method test_nested_self_many_lambda (line 2136) | def test_nested_self_many_lambda(self):
    method test_nested_self_list (line 2150) | def test_nested_self_list(self):
  class RequiredUserSchema (line 2165) | class RequiredUserSchema(Schema):
  function test_serialization_with_required_field (line 2169) | def test_serialization_with_required_field():
  function test_deserialization_with_required_field (line 2174) | def test_deserialization_with_required_field():
  function test_deserialization_with_required_field_and_custom_validator (line 2185) | def test_deserialization_with_required_field_and_custom_validator():
  function test_serializer_can_specify_nested_object_as_attribute (line 2210) | def test_serializer_can_specify_nested_object_as_attribute(blog):
  class TestFieldInheritance (line 2219) | class TestFieldInheritance:
    method test_inherit_fields_from_schema_subclass (line 2220) | def test_inherit_fields_from_schema_subclass(self):
    method test_inherit_fields_from_non_schema_subclass (line 2234) | def test_inherit_fields_from_non_schema_subclass(self):
    method test_inheritance_follows_mro (line 2252) | def test_inheritance_follows_mro(self):
  function get_from_dict (line 2277) | def get_from_dict(schema, obj, key, default=None):
  class TestGetAttribute (line 2281) | class TestGetAttribute:
    method test_get_attribute_is_used (line 2282) | def test_get_attribute_is_used(self):
    method test_get_attribute_with_many (line 2300) | def test_get_attribute_with_many(self):
  class TestRequiredFields (line 2326) | class TestRequiredFields:
    class StringSchema (line 2327) | class StringSchema(Schema):
    method string_schema (line 2333) | def string_schema(self):
    method data (line 2337) | def data(self):
    method test_required_string_field_missing (line 2344) | def test_required_string_field_missing(self, string_schema, data):
    method test_required_string_field_failure (line 2349) | def test_required_string_field_failure(self, string_schema, data):
    method test_allow_none_param (line 2354) | def test_allow_none_param(self, string_schema, data):
    method test_allow_none_custom_message (line 2366) | def test_allow_none_custom_message(self, data):
  class TestDefaults (line 2377) | class TestDefaults:
    class MySchema (line 2378) | class MySchema(Schema):
    method schema (line 2388) | def schema(self):
    method data (line 2392) | def data(self):
    method test_missing_inputs_are_excluded_from_dump_output (line 2402) | def test_missing_inputs_are_excluded_from_dump_output(self, schema, da...
    method test_none_is_serialized_to_none (line 2417) | def test_none_is_serialized_to_none(self, schema, data):
    method test_default_and_value_missing (line 2425) | def test_default_and_value_missing(self, schema, data):
    method test_loading_none (line 2432) | def test_loading_none(self, schema, data):
    method test_missing_inputs_are_excluded_from_load_output (line 2437) | def test_missing_inputs_are_excluded_from_load_output(self, schema, da...
  class TestLoadOnly (line 2453) | class TestLoadOnly:
    class MySchema (line 2454) | class MySchema(Schema):
      class Meta (line 2455) | class Meta:
    method schema (line 2464) | def schema(self):
    method data (line 2468) | def data(self):
    method test_load_only (line 2475) | def test_load_only(self, schema, data):
    method test_dump_only (line 2481) | def test_dump_only(self, schema, data):
    method test_url_field_requre_tld_false (line 2488) | def test_url_field_requre_tld_false(self):
  class TestFromDict (line 2498) | class TestFromDict:
    method test_generates_schema (line 2499) | def test_generates_schema(self):
    method test_name (line 2503) | def test_name(self):
    method test_generated_schemas_are_not_registered (line 2511) | def test_generated_schemas_are_not_registered(self):
    method test_meta_options_are_applied (line 2521) | def test_meta_options_are_applied(self):
  function test_class_registry_returns_schema_type (line 2531) | def test_class_registry_returns_schema_type():
  function test_set_dict_class (line 2542) | def test_set_dict_class(dict_cls):

FILE: tests/test_serialization.py
  class Point (line 19) | class Point(NamedTuple):
  class DateTimeList (line 24) | class DateTimeList:
    method __init__ (line 25) | def __init__(self, dtimes):
  class IntegerList (line 29) | class IntegerList:
    method __init__ (line 30) | def __init__(self, ints):
  class DateTimeIntegerTuple (line 34) | class DateTimeIntegerTuple:
    method __init__ (line 35) | def __init__(self, dtime_int):
  class TestFieldSerialization (line 39) | class TestFieldSerialization:
    method user (line 41) | def user(self):
    method test_function_field_passed_func (line 44) | def test_function_field_passed_func(self, user):
    method test_function_field_passed_serialize_only_is_dump_only (line 48) | def test_function_field_passed_serialize_only_is_dump_only(self, user):
    method test_function_field_passed_deserialize_and_serialize_is_not_dump_only (line 52) | def test_function_field_passed_deserialize_and_serialize_is_not_dump_o...
    method test_function_field_passed_serialize (line 58) | def test_function_field_passed_serialize(self, user):
    method test_function_field_does_not_swallow_attribute_error (line 63) | def test_function_field_does_not_swallow_attribute_error(self, user):
    method test_serialize_with_load_only_param (line 71) | def test_serialize_with_load_only_param(self):
    method test_function_field_load_only (line 90) | def test_function_field_load_only(self):
    method test_function_field_passed_uncallable_object (line 94) | def test_function_field_passed_uncallable_object(self):
    method test_integer_field (line 98) | def test_integer_field(self, user):
    method test_integer_as_string_field (line 102) | def test_integer_as_string_field(self, user):
    method test_integer_field_default (line 106) | def test_integer_field_default(self, user):
    method test_integer_field_default_set_to_none (line 113) | def test_integer_field_default_set_to_none(self, user):
    method test_uuid_field (line 118) | def test_uuid_field(self, user):
    method test_ip_address_field (line 127) | def test_ip_address_field(self, user):
    method test_ipv4_address_field (line 147) | def test_ipv4_address_field(self, user):
    method test_ipv6_address_field (line 158) | def test_ipv6_address_field(self, user):
    method test_ip_interface_field (line 174) | def test_ip_interface_field(self, user):
    method test_ipv4_interface_field (line 199) | def test_ipv4_interface_field(self, user):
    method test_ipv6_interface_field (line 210) | def test_ipv6_interface_field(self, user):
    method test_enum_field_by_symbol_serialization (line 231) | def test_enum_field_by_symbol_serialization(self, user):
    method test_enum_field_by_value_true_serialization (line 236) | def test_enum_field_by_value_true_serialization(self, user):
    method test_enum_field_by_value_field_serialization (line 245) | def test_enum_field_by_value_field_serialization(self, user):
    method test_decimal_field (line 256) | def test_decimal_field(self, user):
    method test_decimal_field_string (line 289) | def test_decimal_field_string(self, user):
    method test_decimal_field_special_values (line 322) | def test_decimal_field_special_values(self, user):
    method test_decimal_field_special_values_not_permitted (line 382) | def test_decimal_field_special_values_not_permitted(self, user):
    method test_decimal_field_fixed_point_representation (line 392) | def test_decimal_field_fixed_point_representation(self, user):
    method test_email_field_serialize_none (line 414) | def test_email_field_serialize_none(self, user):
    method test_dict_field_serialize_none (line 419) | def test_dict_field_serialize_none(self, user):
    method test_dict_field_serialize (line 424) | def test_dict_field_serialize(self, user):
    method test_dict_field_serialize_ordereddict (line 433) | def test_dict_field_serialize_ordereddict(self, user):
    method test_structured_dict_value_serialize (line 440) | def test_structured_dict_value_serialize(self, user):
    method test_structured_dict_key_serialize (line 445) | def test_structured_dict_key_serialize(self, user):
    method test_structured_dict_key_value_serialize (line 450) | def test_structured_dict_key_value_serialize(self, user):
    method test_url_field_serialize_none (line 455) | def test_url_field_serialize_none(self, user):
    method test_method_field_with_method_missing (line 460) | def test_method_field_with_method_missing(self):
    method test_method_field_passed_serialize_only_is_dump_only (line 467) | def test_method_field_passed_serialize_only_is_dump_only(self, user):
    method test_method_field_passed_deserialize_only_is_load_only (line 472) | def test_method_field_passed_deserialize_only_is_load_only(self):
    method test_method_field_with_uncallable_attribute (line 477) | def test_method_field_with_uncallable_attribute(self):
    method test_method_field_does_not_swallow_attribute_error (line 486) | def test_method_field_does_not_swallow_attribute_error(self):
    method test_method_with_no_serialize_is_missing (line 496) | def test_method_with_no_serialize_is_missing(self):
    method test_serialize_with_data_key_param (line 502) | def test_serialize_with_data_key_param(self):
    method test_serialize_with_data_key_as_empty_string (line 511) | def test_serialize_with_data_key_as_empty_string(self):
    method test_serialize_with_attribute_and_data_key_uses_data_key (line 518) | def test_serialize_with_attribute_and_data_key_uses_data_key(self):
    method test_datetime_field_rfc822 (line 548) | def test_datetime_field_rfc822(self, fmt, value, expected):
    method test_datetime_field_timestamp (line 580) | def test_datetime_field_timestamp(self, fmt, value, expected):
    method test_datetime_field_iso8601 (line 603) | def test_datetime_field_iso8601(self, fmt, value, expected):
    method test_datetime_field_format (line 611) | def test_datetime_field_format(self, user):
    method test_string_field (line 616) | def test_string_field(self):
    method test_string_field_default_to_empty_string (line 624) | def test_string_field_default_to_empty_string(self, user):
    method test_time_field (line 628) | def test_time_field(self, user):
    method test_time_field_iso8601 (line 645) | def test_time_field_iso8601(self, fmt, value, expected):
    method test_time_field_format (line 653) | def test_time_field_format(self, user):
    method test_date_field (line 658) | def test_date_field(self, user):
    method test_timedelta_field (line 665) | def test_timedelta_field(self, user):
    method test_datetime_list_field (line 793) | def test_datetime_list_field(self):
    method test_list_field_serialize_none_returns_none (line 799) | def test_list_field_serialize_none_returns_none(self):
    method test_list_field_work_with_generator_single_value (line 804) | def test_list_field_work_with_generator_single_value(self):
    method test_list_field_work_with_generators_multiple_values (line 813) | def test_list_field_work_with_generators_multiple_values(self):
    method test_list_field_work_with_generators_empty_generator_returns_none_for_every_non_returning_yield_statement (line 822) | def test_list_field_work_with_generators_empty_generator_returns_none_...
    method test_list_field_work_with_set (line 836) | def test_list_field_work_with_set(self):
    method test_list_field_work_with_custom_class_with_iterator_protocol (line 846) | def test_list_field_work_with_custom_class_with_iterator_protocol(self):
    method test_bad_list_field (line 863) | def test_bad_list_field(self):
    method test_datetime_integer_tuple_field (line 876) | def test_datetime_integer_tuple_field(self):
    method test_tuple_field_serialize_none_returns_none (line 883) | def test_tuple_field_serialize_none_returns_none(self):
    method test_bad_tuple_field (line 888) | def test_bad_tuple_field(self):
    method test_serialize_does_not_apply_validators (line 903) | def test_serialize_does_not_apply_validators(self, user):
    method test_constant_field_serialization (line 908) | def test_constant_field_serialization(self, user):
    method test_constant_is_always_included_in_serialized_data (line 912) | def test_constant_is_always_included_in_serialized_data(self):
    method test_constant_field_serialize_when_omitted (line 920) | def test_constant_field_serialize_when_omitted(self):
    method test_all_fields_serialize_none_to_none (line 928) | def test_all_fields_serialize_none_to_none(self, FieldClass):
  class TestSchemaSerialization (line 934) | class TestSchemaSerialization:
    method test_serialize_with_missing_param_value (line 935) | def test_serialize_with_missing_param_value(self):
    method test_serialize_with_missing_param_callable (line 945) | def test_serialize_with_missing_param_callable(self):
  function test_serializing_named_tuple (line 956) | def test_serializing_named_tuple():
  function test_serializing_named_tuple_with_meta (line 964) | def test_serializing_named_tuple_with_meta():
  function test_serializing_slice (line 976) | def test_serializing_slice():
  function test_nested_field_many_serializing_generator (line 988) | def test_nested_field_many_serializing_generator():

FILE: tests/test_utils.py
  function test_missing_singleton_copy (line 12) | def test_missing_singleton_copy():
  class PointNT (line 17) | class PointNT(NamedTuple):
  class PointClass (line 22) | class PointClass:
    method __init__ (line 23) | def __init__(self, x, y):
  class PointDict (line 28) | class PointDict(dict):
    method __init__ (line 29) | def __init__(self, x, y):
  function test_get_value_from_object (line 37) | def test_get_value_from_object(obj):
  function test_get_value_from_namedtuple_with_default (line 42) | def test_get_value_from_namedtuple_with_default():
  class Triangle (line 50) | class Triangle:
    method __init__ (line 51) | def __init__(self, p1, p2, p3):
  function test_get_value_for_nested_object (line 58) | def test_get_value_for_nested_object():
  function test_get_value_from_dict (line 66) | def test_get_value_from_dict():
  function test_get_value (line 72) | def test_get_value():
  function test_set_value (line 82) | def test_set_value():
  function test_is_collection (line 100) | def test_is_collection():
  function test_from_timestamp (line 113) | def test_from_timestamp(value, expected):
  function test_from_timestamp_with_negative_value (line 119) | def test_from_timestamp_with_negative_value():
  function test_from_timestamp_with_overflow_value (line 125) | def test_from_timestamp_with_overflow_value():
  function test_function_field_using_type_annotation (line 132) | def test_function_field_using_type_annotation():

FILE: tests/test_validate.py
  function test_url_absolute_valid (line 37) | def test_url_absolute_valid(valid_url):
  function test_url_absolute_invalid (line 72) | def test_url_absolute_invalid(invalid_url):
  function test_url_relative_valid (line 93) | def test_url_relative_valid(valid_url):
  function test_url_relative_invalid (line 114) | def test_url_relative_invalid(invalid_url):
  function test_url_relative_only_valid (line 129) | def test_url_relative_only_valid(valid_url):
  function test_url_relative_only_invalid (line 156) | def test_url_relative_only_invalid(invalid_url):
  function test_url_dont_require_tld_valid (line 174) | def test_url_dont_require_tld_valid(valid_url):
  function test_url_dont_require_tld_invalid (line 191) | def test_url_dont_require_tld_invalid(invalid_url):
  function test_url_custom_scheme (line 197) | def test_url_custom_scheme():
  function test_url_custom_scheme_case_insensitive (line 208) | def test_url_custom_scheme_case_insensitive():
  function test_url_accepts_valid_file_urls (line 237) | def test_url_accepts_valid_file_urls(valid_url):
  function test_url_rejects_invalid_file_urls (line 252) | def test_url_rejects_invalid_file_urls(invalid_url):
  function test_url_relative_and_custom_schemes (line 258) | def test_url_relative_and_custom_schemes():
  function test_url_custom_message (line 269) | def test_url_custom_message():
  function test_url_repr (line 275) | def test_url_repr():
  function test_url_rejects_invalid_relative_usage (line 287) | def test_url_rejects_invalid_relative_usage():
  function test_email_valid (line 311) | def test_email_valid(valid_email):
  function test_email_invalid (line 336) | def test_email_invalid(invalid_email):
  function test_email_custom_message (line 342) | def test_email_custom_message():
  function test_email_repr (line 348) | def test_email_repr():
  function test_range_min (line 355) | def test_range_min():
  function test_range_max (line 372) | def test_range_max():
  function test_range_custom_message (line 389) | def test_range_custom_message():
  function test_range_repr (line 403) | def test_range_repr():
  function test_length_min (line 424) | def test_length_min():
  function test_length_max (line 444) | def test_length_max():
  function test_length_equal (line 464) | def test_length_equal():
  function test_length_custom_message (line 483) | def test_length_custom_message():
  function test_length_repr (line 501) | def test_length_repr():
  function test_equal (line 514) | def test_equal():
  function test_equal_custom_message (line 527) | def test_equal_custom_message():
  function test_equal_repr (line 533) | def test_equal_repr():
  function test_regexp_str (line 542) | def test_regexp_str():
  function test_regexp_compile (line 558) | def test_regexp_compile():
  function test_regexp_custom_message (line 577) | def test_regexp_custom_message():
  function test_regexp_repr (line 584) | def test_regexp_repr():
  function test_predicate (line 597) | def test_predicate():
  function test_predicate_custom_message (line 634) | def test_predicate_custom_message():
  function test_predicate_repr (line 647) | def test_predicate_repr():
  function test_noneof (line 660) | def test_noneof():
  function test_noneof_custom_message (line 678) | def test_noneof_custom_message():
  function test_noneof_repr (line 687) | def test_noneof_repr():
  function test_oneof (line 696) | def test_oneof():
  function test_oneof_options (line 719) | def test_oneof_options():
  function test_oneof_text (line 737) | def test_oneof_text():
  function test_oneof_custom_message (line 751) | def test_oneof_custom_message():
  function test_oneof_repr (line 767) | def test_oneof_repr():
  function test_containsonly_in_list (line 780) | def test_containsonly_in_list():
  function test_contains_only_unhashable_types (line 801) | def test_contains_only_unhashable_types():
  function test_containsonly_in_tuple (line 817) | def test_containsonly_in_tuple():
  function test_contains_only_in_string (line 833) | def test_contains_only_in_string():
  function test_containsonly_custom_message (line 850) | def test_containsonly_custom_message():
  function test_containsonly_repr (line 868) | def test_containsonly_repr():
  function test_containsnoneof_error_message (line 881) | def test_containsnoneof_error_message():
  function test_containsnoneof_in_list (line 903) | def test_containsnoneof_in_list():
  function test_containsnoneof_unhashable_types (line 924) | def test_containsnoneof_unhashable_types():
  function test_containsnoneof_in_tuple (line 949) | def test_containsnoneof_in_tuple():
  function test_containsnoneof_in_string (line 970) | def test_containsnoneof_in_string():
  function test_containsnoneof_custom_message (line 991) | def test_containsnoneof_custom_message():
  function test_containsnoneof_mixing_types (line 1000) | def test_containsnoneof_mixing_types():
  function is_even (line 1014) | def is_even(value):
  function test_and (line 1019) | def test_and():
Condensed preview — 100 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (846K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 60,
    "preview": "open_collective: \"marshmallow\"\ntidelift: \"pypi/marshmallow\"\n"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 216,
    "preview": "version: 2\nupdates:\n- package-ecosystem: pip\n  directory: \"/\"\n  schedule:\n    interval: daily\n  open-pull-requests-limit"
  },
  {
    "path": ".github/workflows/build-release.yml",
    "chars": 2517,
    "preview": "name: build\non:\n  push:\n    branches: [\"dev\", \"*.x-line\"]\n    tags: [\"*\"]\n  pull_request:\n\njobs:\n  docs:\n    name: docs\n"
  },
  {
    "path": ".gitignore",
    "chars": 681,
    "preview": "*.py[cod]\n\n# C extensions\n*.so\n\n# Packages\n*.egg\n*.egg-info\ndist\nbuild\neggs\nparts\nbin\nvar\nsdist\ndevelop-eggs\n.installed."
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 540,
    "preview": "ci:\n  autoupdate_schedule: monthly\nrepos:\n- repo: https://github.com/astral-sh/ruff-pre-commit\n  rev: v0.15.4\n  hooks:\n "
  },
  {
    "path": ".readthedocs.yml",
    "chars": 212,
    "preview": "version: 2\nsphinx:\n  configuration: docs/conf.py\nformats:\n  - pdf\nbuild:\n  os: ubuntu-22.04\n  tools:\n    python: \"3.13\"\n"
  },
  {
    "path": "AUTHORS.rst",
    "chars": 10433,
    "preview": "*******\nAuthors\n*******\n\nLeads\n=====\n\n- Steven Loria `@sloria <https://github.com/sloria>`_\n- Jérôme Lafréchoux  `@lafre"
  },
  {
    "path": "CHANGELOG.rst",
    "chars": 95638,
    "preview": "Changelog\n=========\n\n4.2.2 (2026-02-04)\n------------------\n\nBug fixes:\n\n- Fix behavior of ``fields.Contant(None)`` (:iss"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 107,
    "preview": "For the marshmallow code of conduct, see https://marshmallow.readthedocs.io/en/latest/code_of_conduct.html\n"
  },
  {
    "path": "CONTRIBUTING.rst",
    "chars": 5585,
    "preview": "Contributing guidelines\n=======================\n\nSo you're interested in contributing to marshmallow or `one of our asso"
  },
  {
    "path": "LICENSE",
    "chars": 1064,
    "preview": "Copyright Steven Loria and contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof"
  },
  {
    "path": "NOTICE",
    "chars": 1631,
    "preview": "marshmallow includes code adapted from Django.\n\nDjango License\n==============\n\nCopyright (c) Django Software Foundation "
  },
  {
    "path": "README.rst",
    "chars": 5408,
    "preview": "********************************************\nmarshmallow: simplified object serialization\n******************************"
  },
  {
    "path": "RELEASING.md",
    "chars": 275,
    "preview": "# Releasing\n\n1. Bump version in `pyproject.toml` and update the changelog\n   with today's date.\n2. Commit: `git commit -"
  },
  {
    "path": "SECURITY.md",
    "chars": 192,
    "preview": "# Security Contact Information\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://t"
  },
  {
    "path": "docs/.gitignore",
    "chars": 35,
    "preview": "marshmallow.docset\nmarshmallow.tgz\n"
  },
  {
    "path": "docs/_static/custom.css",
    "chars": 679,
    "preview": "/* Headings */\n\nh2, h3, h4, h5, h6 {\n  font-weight: 400;\n}\n\n/* UI elements: left and right sidebars, \"Back to top\" butto"
  },
  {
    "path": "docs/api_reference.rst",
    "chars": 397,
    "preview": ".. _api:\n\n.. toctree::\n    :caption: API Reference\n\n    top_level\n    marshmallow.schema\n    marshmallow.fields\n    mars"
  },
  {
    "path": "docs/authors.rst",
    "chars": 28,
    "preview": ".. include:: ../AUTHORS.rst\n"
  },
  {
    "path": "docs/changelog.rst",
    "chars": 135,
    "preview": ".. seealso::\n  Need help upgrading to newer versions? Check out the :doc:`upgrading guide <upgrading>`.\n\n.. include:: .."
  },
  {
    "path": "docs/code_of_conduct.rst",
    "chars": 10841,
    "preview": "Code of Conduct\n===============\n\nThis code of conduct applies to the marshmallow project and all associated\nprojects in "
  },
  {
    "path": "docs/conf.py",
    "chars": 2369,
    "preview": "import importlib.metadata\n\nextensions = [\n    \"autodocsumm\",\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.autodoc.typehints"
  },
  {
    "path": "docs/contributing.rst",
    "chars": 33,
    "preview": ".. include:: ../CONTRIBUTING.rst\n"
  },
  {
    "path": "docs/custom_fields.rst",
    "chars": 6328,
    "preview": "Custom fields\n=============\n\nThere are three ways to create a custom-formatted field for a `Schema <marshmallow.Schema>`"
  },
  {
    "path": "docs/dashing.json",
    "chars": 393,
    "preview": "{\n  \"name\": \"marshmallow\",\n  \"package\": \"marshmallow\",\n  \"index\": \"_build/index.html\",\n  \"selectors\": {\n    \"dl.class dt"
  },
  {
    "path": "docs/donate.rst",
    "chars": 346,
    "preview": "******\nDonate\n******\n\nIf you find marshmallow useful, please consider supporting the team with a donation:\n\n.. image:: h"
  },
  {
    "path": "docs/examples/index.rst",
    "chars": 506,
    "preview": "********\nExamples\n********\n\nThe below examples demonstrate how to use marshmallow in various contexts.\nTo run each examp"
  },
  {
    "path": "docs/examples/inflection.rst",
    "chars": 619,
    "preview": "*****************************\nInflection (camel-cased keys)\n*****************************\n\nHTTP APIs will often use came"
  },
  {
    "path": "docs/examples/quotes_api.rst",
    "chars": 2506,
    "preview": "*******************************\nQuotes API (Flask + SQLAlchemy)\n*******************************\n\nBelow is a full example"
  },
  {
    "path": "docs/examples/validating_package_json.rst",
    "chars": 1571,
    "preview": "***************************\nValidating ``package.json``\n***************************\n\nmarshmallow can be used to validate"
  },
  {
    "path": "docs/extending/custom_error_handling.rst",
    "chars": 1023,
    "preview": "Custom error handling\n=====================\n\nBy default, `Schema.load <marshmallow.Schema.load>` will raise a :exc:`Vali"
  },
  {
    "path": "docs/extending/custom_error_messages.rst",
    "chars": 1088,
    "preview": "Custom error messages\n=====================\n\nTo customize the schema-level error messages that `load <marshmallow.Schema"
  },
  {
    "path": "docs/extending/custom_options.rst",
    "chars": 2470,
    "preview": "Custom `class Meta <marshmallow.Schema.Meta>` options\n=====================================================\n\n`class Meta"
  },
  {
    "path": "docs/extending/index.rst",
    "chars": 312,
    "preview": "Extending schemas\n=================\n\nThe guides below demonstrate how to extend schemas in various ways.\n\n.. toctree::\n "
  },
  {
    "path": "docs/extending/overriding_attribute_access.rst",
    "chars": 742,
    "preview": "Overriding how attributes are accessed\n======================================\n\nBy default, marshmallow uses `utils.get_v"
  },
  {
    "path": "docs/extending/pre_and_post_processing_methods.rst",
    "chars": 6845,
    "preview": "Pre-processing and post-processing methods\n==========================================\n\nDecorator API\n-------------\n\nData"
  },
  {
    "path": "docs/extending/schema_validation.rst",
    "chars": 2925,
    "preview": ".. _schema_validation:\n\nSchema-level validation\n=======================\n\nYou can register schema-level validation functi"
  },
  {
    "path": "docs/extending/using_original_input_data.rst",
    "chars": 952,
    "preview": "Using original input data\n-------------------------\n\nIf you want to use the original, unprocessed input, you can add ``p"
  },
  {
    "path": "docs/index.rst",
    "chars": 1881,
    "preview": ".. meta::\n   :description:\n        marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes"
  },
  {
    "path": "docs/install.rst",
    "chars": 667,
    "preview": "Installation\n============\n\nInstalling/upgrading from the PyPI\n----------------------------------\n\nTo install the latest "
  },
  {
    "path": "docs/kudos.rst",
    "chars": 325,
    "preview": "*****\nKudos\n*****\n\nA hat tip to `Django Rest Framework`_ , `Flask-RESTful`_, and `colander`_ for ideas and API design.\n\n"
  },
  {
    "path": "docs/license.rst",
    "chars": 48,
    "preview": "License\n=======\n\n.. literalinclude:: ../LICENSE\n"
  },
  {
    "path": "docs/marshmallow.class_registry.rst",
    "chars": 88,
    "preview": "Class registry\n==============\n\n.. automodule:: marshmallow.class_registry\n    :members:\n"
  },
  {
    "path": "docs/marshmallow.decorators.rst",
    "chars": 94,
    "preview": "Decorators\n==========\n\n.. automodule:: marshmallow.decorators\n    :members:\n    :autosummary:\n"
  },
  {
    "path": "docs/marshmallow.error_store.rst",
    "chars": 101,
    "preview": "Error store\n===========\n\n.. automodule:: marshmallow.error_store\n    :members:\n    :private-members:\n"
  },
  {
    "path": "docs/marshmallow.exceptions.rst",
    "chars": 76,
    "preview": "Exceptions\n==========\n\n.. automodule:: marshmallow.exceptions\n    :members:\n"
  },
  {
    "path": "docs/marshmallow.experimental.context.rst",
    "chars": 110,
    "preview": "Context (experimental)\n======================\n\n.. automodule:: marshmallow.experimental.context\n    :members:\n"
  },
  {
    "path": "docs/marshmallow.fields.rst",
    "chars": 331,
    "preview": ".. _api_fields:\n\nFields\n======\n\nBase Field Class\n----------------\n\n.. autoclass:: marshmallow.fields.Field\n    :private-"
  },
  {
    "path": "docs/marshmallow.schema.rst",
    "chars": 170,
    "preview": "Schema\n======\n\n.. autoclass:: marshmallow.schema.Schema\n    :members:\n    :autosummary:\n    :exclude-members: OPTIONS_CL"
  },
  {
    "path": "docs/marshmallow.types.rst",
    "chars": 61,
    "preview": "Types\n=====\n\n.. automodule:: marshmallow.types\n    :members:\n"
  },
  {
    "path": "docs/marshmallow.utils.rst",
    "chars": 85,
    "preview": "Utility functions\n=================\n\n.. automodule:: marshmallow.utils\n    :members:\n"
  },
  {
    "path": "docs/marshmallow.validate.rst",
    "chars": 113,
    "preview": ".. _api_validators:\n\nValidators\n==========\n\n.. automodule:: marshmallow.validate\n    :members:\n    :autosummary:\n"
  },
  {
    "path": "docs/nesting.rst",
    "chars": 9134,
    "preview": "Nesting schemas\n===============\n\nSchemas can be nested to represent relationships between objects (e.g. foreign key rela"
  },
  {
    "path": "docs/quickstart.rst",
    "chars": 17904,
    "preview": "Quickstart\n==========\n\nThis guide will walk you through the basics of creating schemas for serializing and deserializing"
  },
  {
    "path": "docs/top_level.rst",
    "chars": 932,
    "preview": "Top-level API\n=============\n\n.. automodule:: marshmallow\n   :members:\n   :autosummary:\n   :exclude-members: OPTIONS_CLAS"
  },
  {
    "path": "docs/upgrading.rst",
    "chars": 67131,
    "preview": "Upgrading to newer releases\n===========================\n\nThis section documents migration paths to new releases.\n\n.. _up"
  },
  {
    "path": "docs/whos_using.rst",
    "chars": 271,
    "preview": "Who's using marshmallow?\n========================\n\nVisit the link below to see a list of companies using marshmallow.\n\nh"
  },
  {
    "path": "docs/why.rst",
    "chars": 4353,
    "preview": "Why marshmallow?\n================\n\nThe Python ecosystem has many great libraries for data formatting and schema validati"
  },
  {
    "path": "examples/flask_example.py",
    "chars": 4551,
    "preview": "# /// script\n# requires-python = \">=3.10\"\n# dependencies = [\n#     \"flask\",\n#     \"flask-sqlalchemy>=3.1.1\",\n#     \"mars"
  },
  {
    "path": "examples/inflection_example.py",
    "chars": 921,
    "preview": "# /// script\n# requires-python = \">=3.9\"\n# dependencies = [\n#     \"marshmallow\",\n# ]\n# ///\nfrom marshmallow import Schem"
  },
  {
    "path": "examples/invalid_package.json",
    "chars": 149,
    "preview": "{\n  \"name\": \"dunderscore\",\n  \"version\": \"INVALID\",\n  \"homepage\": \"INVALID\",\n  \"description\": \"The Pythonic JavaScript to"
  },
  {
    "path": "examples/package.json",
    "chars": 233,
    "preview": "{\n  \"name\": \"dunderscore\",\n  \"version\": \"1.2.3\",\n  \"description\": \"The Pythonic JavaScript toolkit\",\n  \"devDependencies\""
  },
  {
    "path": "examples/package_json_example.py",
    "chars": 1598,
    "preview": "# /// script\n# requires-python = \">=3.10\"\n# dependencies = [\n#     \"marshmallow\",\n#     \"packaging>=17.0\",\n# ]\n# ///\nimp"
  },
  {
    "path": "performance/benchmark.py",
    "chars": 3859,
    "preview": "\"\"\"Simple benchmark for marshmallow serialization of a moderately complex object.\n\nUses the `timeit` module to benchmark"
  },
  {
    "path": "pyproject.toml",
    "chars": 4859,
    "preview": "[project]\nname = \"marshmallow\"\nversion = \"4.2.2\"\ndescription = \"A lightweight library for converting complex datatypes t"
  },
  {
    "path": "src/marshmallow/__init__.py",
    "chars": 573,
    "preview": "from marshmallow.constants import EXCLUDE, INCLUDE, RAISE, missing\nfrom marshmallow.decorators import (\n    post_dump,\n "
  },
  {
    "path": "src/marshmallow/class_registry.py",
    "chars": 3029,
    "preview": "\"\"\"A registry of :class:`Schema <marshmallow.Schema>` classes. This allows for string\nlookup of schemas, which may be us"
  },
  {
    "path": "src/marshmallow/constants.py",
    "chars": 415,
    "preview": "import typing\n\nEXCLUDE: typing.Final = \"exclude\"\nINCLUDE: typing.Final = \"include\"\nRAISE: typing.Final = \"raise\"\n\n\nclass"
  },
  {
    "path": "src/marshmallow/decorators.py",
    "chars": 10165,
    "preview": "\"\"\"Decorators for registering schema pre-processing and post-processing methods.\nThese should be imported from the top-l"
  },
  {
    "path": "src/marshmallow/error_store.py",
    "chars": 2444,
    "preview": "\"\"\"Utilities for storing collections of error messages.\n\n.. warning::\n\n    This module is treated as private API.\n    Us"
  },
  {
    "path": "src/marshmallow/exceptions.py",
    "chars": 2273,
    "preview": "\"\"\"Exception classes for marshmallow-related errors.\"\"\"\n\nfrom __future__ import annotations\n\nimport typing\n\n# Key used f"
  },
  {
    "path": "src/marshmallow/experimental/__init__.py",
    "chars": 147,
    "preview": "\"\"\"Experimental features.\n\nThe features in this subpackage are experimental. Breaking changes may be\nintroduced in minor"
  },
  {
    "path": "src/marshmallow/experimental/context.py",
    "chars": 2040,
    "preview": "\"\"\"Helper API for setting serialization/deserialization context.\n\nExample usage:\n\n.. code-block:: python\n\n    import typ"
  },
  {
    "path": "src/marshmallow/fields.py",
    "chars": 72528,
    "preview": "# ruff: noqa: SLF001\nfrom __future__ import annotations\n\nimport abc\nimport collections\nimport copy\nimport datetime as dt"
  },
  {
    "path": "src/marshmallow/orderedset.py",
    "chars": 2953,
    "preview": "# OrderedSet\n# Copyright (c) 2009 Raymond Hettinger\n#\n# Permission is hereby granted, free of charge, to any person\n# ob"
  },
  {
    "path": "src/marshmallow/py.typed",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/marshmallow/schema.py",
    "chars": 49957,
    "preview": "\"\"\"The `Schema <marshmallow.Schema>` class, including its metaclass and options (`class Meta <marshmallow.Schema.Meta>`)"
  },
  {
    "path": "src/marshmallow/types.py",
    "chars": 1161,
    "preview": "\"\"\"Type aliases.\n\n.. warning::\n\n    This module is provisional. Types may be modified, added, and removed between minor "
  },
  {
    "path": "src/marshmallow/utils.py",
    "chars": 5334,
    "preview": "\"\"\"Utility methods for marshmallow.\"\"\"\n\nfrom __future__ import annotations\n\nimport datetime as dt\nimport inspect\nimport "
  },
  {
    "path": "src/marshmallow/validate.py",
    "chars": 23944,
    "preview": "\"\"\"Validation classes for various types of data.\"\"\"\n\nfrom __future__ import annotations\n\nimport re\nimport typing\nfrom ab"
  },
  {
    "path": "tests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "tests/base.py",
    "chars": 7203,
    "preview": "\"\"\"Test utilities and fixtures.\"\"\"\n\nimport datetime as dt\nimport functools\nimport typing\nimport uuid\nfrom enum import En"
  },
  {
    "path": "tests/conftest.py",
    "chars": 566,
    "preview": "\"\"\"Pytest fixtures that are available in all test modules.\"\"\"\n\nimport pytest\n\nfrom tests.base import Blog, User, UserSch"
  },
  {
    "path": "tests/foo_serializer.py",
    "chars": 97,
    "preview": "from marshmallow import Schema, fields\n\n\nclass FooSerializer(Schema):\n    _id = fields.Integer()\n"
  },
  {
    "path": "tests/mypy_test_cases/test_class_registry.py",
    "chars": 107,
    "preview": "from marshmallow import class_registry\n\n# Works without passing `all`\nclass_registry.get_class(\"MySchema\")\n"
  },
  {
    "path": "tests/mypy_test_cases/test_schema.py",
    "chars": 748,
    "preview": "import json\n\nfrom marshmallow import EXCLUDE, Schema\nfrom marshmallow.fields import Integer, String\n\n\n# Test that valid "
  },
  {
    "path": "tests/mypy_test_cases/test_validation_error.py",
    "chars": 579,
    "preview": "from __future__ import annotations\n\nimport marshmallow as ma\n\n# OK types for 'message'\nma.ValidationError(\"foo\")\nma.Vali"
  },
  {
    "path": "tests/test_context.py",
    "chars": 8390,
    "preview": "import typing\n\nimport pytest\n\nfrom marshmallow import (\n    Schema,\n    fields,\n    post_dump,\n    post_load,\n    pre_du"
  },
  {
    "path": "tests/test_decorators.py",
    "chars": 34392,
    "preview": "import pytest\n\nfrom marshmallow import (\n    EXCLUDE,\n    INCLUDE,\n    RAISE,\n    Schema,\n    ValidationError,\n    field"
  },
  {
    "path": "tests/test_deserialization.py",
    "chars": 89413,
    "preview": "# mypy: disable-error-code=\"arg-type\"\nimport datetime as dt\nimport decimal\nimport ipaddress\nimport math\nimport uuid\nfrom"
  },
  {
    "path": "tests/test_error_store.py",
    "chars": 5749,
    "preview": "from typing import NamedTuple\n\nfrom marshmallow import missing\nfrom marshmallow.error_store import ErrorStore, merge_err"
  },
  {
    "path": "tests/test_exceptions.py",
    "chars": 1416,
    "preview": "import pytest\n\nfrom marshmallow.exceptions import ValidationError\n\n\nclass TestValidationError:\n    def test_stores_messa"
  },
  {
    "path": "tests/test_fields.py",
    "chars": 23244,
    "preview": "import pytest\n\nfrom marshmallow import (\n    EXCLUDE,\n    INCLUDE,\n    RAISE,\n    Schema,\n    ValidationError,\n    field"
  },
  {
    "path": "tests/test_options.py",
    "chars": 4752,
    "preview": "import datetime as dt\n\nfrom marshmallow import EXCLUDE, Schema, fields\n\n\nclass UserSchema(Schema):\n    name = fields.Str"
  },
  {
    "path": "tests/test_registry.py",
    "chars": 7328,
    "preview": "import pytest\n\nfrom marshmallow import Schema, class_registry, fields\nfrom marshmallow.exceptions import RegistryError\n\n"
  },
  {
    "path": "tests/test_schema.py",
    "chars": 78701,
    "preview": "import datetime as dt\nimport math\nimport random\nfrom collections import OrderedDict\nfrom typing import NamedTuple, cast\n"
  },
  {
    "path": "tests/test_serialization.py",
    "chars": 37606,
    "preview": "\"\"\"Tests for field serialization.\"\"\"\n\nimport datetime as dt\nimport decimal\nimport ipaddress\nimport itertools\nimport math"
  },
  {
    "path": "tests/test_utils.py",
    "chars": 3759,
    "preview": "from __future__ import annotations\n\nimport datetime as dt\nfrom copy import copy, deepcopy\nfrom typing import NamedTuple\n"
  },
  {
    "path": "tests/test_validate.py",
    "chars": 34271,
    "preview": "\"\"\"Tests for marshmallow.validate\"\"\"\n\nimport re\n\nimport pytest\n\nfrom marshmallow import ValidationError, validate\n\n\n@pyt"
  },
  {
    "path": "tox.ini",
    "chars": 861,
    "preview": "[tox]\nenvlist = lint,mypy,py{310,311,312,313,314},docs\n\n[testenv]\nextras = tests\ncommands = pytest {posargs}\n\n[testenv:l"
  }
]

About this extraction

This page contains the full source code of the marshmallow-code/marshmallow GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 100 files (785.1 KB), approximately 194.6k tokens, and a symbol index with 1109 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!