marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.
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
$ pip install -U marshmallow
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 to see how you can help.
Thank you to all who have already contributed to marshmallow!
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]
Sponsors
marshmallow is sponsored by Route4Me.
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]
Professional Support
Professionally-supported marshmallow is now available through the Tidelift Subscription.
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]
Project Links
Changelog: https://marshmallow.readthedocs.io/en/latest/changelog.html
Contributing Guidelines: https://github.com/marshmallow-code/.github/blob/main/CONTRIBUTING.md
Issues: https://github.com/marshmallow-code/marshmallow/issues
License
MIT licensed. See the bundled LICENSE file for more details.
Release files for marshmallow 4.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| marshmallow-4.3.1.tar.gz | 218.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| marshmallow-4.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:267.5 kB
Release files / marshmallow-4.3.1.tar.gz
| Download URL | marshmallow-4.3.1.tar.gz |
|---|---|
| Size | 218.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb6b8048af08d4ab061610d5b7d3696a7e4c95337dbda880edb9f95812cabc20
|
|
BLAKE2b-256 checksum How to use checksums |
4ed7611e68d57e6a903c29cb33b5afec0f93b4baecacc6c6c62e33cde9eb9dcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logRelease files / marshmallow-4.3.1-py3-none-any.whl
| Download URL | marshmallow-4.3.1-py3-none-any.whl |
|---|---|
| Size | 49.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e65accfbe277546df92ed7996a678c90e063e9a7c2a2f5e03f7d0b90e3768c42
|
|
BLAKE2b-256 checksum How to use checksums |
43574526ca0e214a3d158690e3393f6d547a2f8070f88d6388ab21d5b0aac8a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency log