marshmallow 4.0.1


pip install marshmallow

  Latest version

Released: Aug 28, 2025


Meta
Author: Steven Loria
Maintainer: Steven Loria, Jérôme Lafréchoux, Jared Deckard
Requires Python: >=3.9

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Latest version Build status pre-commit.ci status Documentation

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!

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]

Backers

Sponsors

marshmallow is sponsored by Route4Me.

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]

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]

Get supported marshmallow with Tidelift

License

MIT licensed. See the bundled LICENSE file for more details.

4.0.1 Aug 28, 2025
4.0.0 Apr 17, 2025
3.26.1 Feb 03, 2025
3.26.0 Jan 23, 2025
3.25.1 Jan 11, 2025
3.25.0 Jan 09, 2025
3.24.2 Jan 08, 2025
3.24.1 Jan 07, 2025
3.24.0 Jan 06, 2025
3.23.3 Jan 03, 2025
3.23.2 Dec 19, 2024
3.23.1 Nov 01, 2024
3.23.0 Oct 17, 2024
3.22.0 Aug 20, 2024
3.21.3 Jun 06, 2024
3.21.2 May 01, 2024
3.21.1 Mar 04, 2024
3.21.0 Feb 26, 2024
3.20.2 Jan 09, 2024
3.20.1 Jul 20, 2023
3.20.0 Jul 20, 2023
3.19.0 Nov 11, 2022
3.18.0 Sep 15, 2022
3.17.1 Aug 22, 2022
3.17.0 Jun 26, 2022
3.16.0 May 29, 2022
3.15.0 Mar 12, 2022
3.14.1 Nov 15, 2021
3.14.0 Oct 17, 2021
3.13.0 Jul 21, 2021
3.12.2 Jul 06, 2021
3.12.1 May 10, 2021
3.12.0 May 10, 2021
3.11.1 Mar 30, 2021
3.11.0 Mar 28, 2021
3.10.0 Dec 19, 2020
3.9.1 Nov 08, 2020
3.9.0 Oct 31, 2020
3.8.0 Sep 16, 2020
3.7.1 Jul 20, 2020
3.7.0 Jul 09, 2020
3.6.1 Jun 02, 2020
3.6.0 May 08, 2020
3.5.2 Apr 30, 2020
3.5.1 Mar 05, 2020
3.5.0 Feb 19, 2020
3.4.0 Feb 02, 2020
3.3.0 Dec 06, 2019
3.2.2 Nov 04, 2019
3.2.1 Oct 01, 2019
3.2.0 Sep 17, 2019
3.1.1 Sep 16, 2019
3.1.0 Sep 15, 2019
3.0.5 Sep 13, 2019
3.0.4 Sep 12, 2019
3.0.3 Sep 05, 2019
3.0.2 Sep 04, 2019
3.0.1 Aug 21, 2019
3.0.0 Aug 18, 2019
3.0.0rc9 Jul 31, 2019
3.0.0rc8 Jul 04, 2019
3.0.0rc7 Jun 15, 2019
3.0.0rc6 May 05, 2019
3.0.0rc5 Mar 30, 2019
3.0.0rc4 Feb 08, 2019
3.0.0rc3 Jan 14, 2019
3.0.0rc2 Jan 03, 2019
3.0.0rc1 Nov 30, 2018
3.0.0b20 Nov 02, 2018
3.0.0b19 Oct 25, 2018
3.0.0b18 Oct 16, 2018
3.0.0b17 Oct 13, 2018
3.0.0b16 Sep 21, 2018
3.0.0b15 Sep 19, 2018
3.0.0b14 Sep 15, 2018
3.0.0b13 Aug 04, 2018
3.0.0b12 Jul 05, 2018
3.0.0b11 May 20, 2018
3.0.0b10 May 11, 2018
3.0.0b9 Apr 26, 2018
3.0.0b8 Mar 24, 2018
3.0.0b7 Feb 03, 2018
3.0.0b6 Jan 12, 2018
3.0.0b5 Dec 30, 2017
3.0.0b4 Oct 23, 2017
3.0.0b3 Aug 20, 2017
3.0.0b2 Mar 20, 2017
3.0.0b1 Mar 10, 2017
3.0.0a1 Feb 26, 2017
2.21.0 Mar 05, 2020
2.20.5 Sep 15, 2019
2.20.4 Sep 12, 2019
2.20.3 Sep 04, 2019
2.20.2 Aug 20, 2019
2.20.1 Aug 13, 2019
2.20.0 Aug 10, 2019
2.19.5 Jun 18, 2019
2.19.4 Jun 17, 2019
2.19.3 Jun 15, 2019
2.19.2 Mar 30, 2019
2.19.1 Mar 16, 2019
2.19.0 Mar 08, 2019
2.18.1 Feb 15, 2019
2.18.0 Jan 14, 2019
2.17.0 Dec 26, 2018
2.16.3 Nov 02, 2018
2.16.2 Oct 31, 2018
2.16.1 Oct 23, 2018
2.16.0 Oct 11, 2018
2.15.6 Sep 21, 2018
2.15.5 Sep 15, 2018
2.15.4 Aug 04, 2018
2.15.3 May 20, 2018
2.15.2 May 11, 2018
2.15.1 Apr 26, 2018
2.15.0 Dec 02, 2017
2.14.0 Oct 23, 2017
2.13.6 Aug 16, 2017
2.13.5 Apr 13, 2017
2.13.4 Mar 20, 2017
2.13.3 Mar 11, 2017
2.13.2 Mar 10, 2017
2.13.1 Mar 04, 2017
2.13.0 Feb 18, 2017
2.12.2 Jan 30, 2017
2.12.1 Jan 24, 2017
2.12.0 Jan 22, 2017
2.11.1 Jan 08, 2017
2.11.0 Jan 08, 2017
2.10.5 Dec 20, 2016
2.10.4 Nov 18, 2016
2.10.3 Oct 02, 2016
2.10.2 Sep 25, 2016
2.10.1 Sep 15, 2016
2.10.0 Sep 05, 2016
2.9.1 Jul 22, 2016
2.9.0 Jul 07, 2016
2.8.0 Jun 24, 2016
2.7.3 May 06, 2016
2.7.2 Apr 28, 2016
2.7.1 Apr 09, 2016
2.7.0 Apr 04, 2016
2.6.1 Mar 18, 2016
2.6.0 Feb 02, 2016
2.5.0 Jan 16, 2016
2.4.2 Dec 09, 2015
2.4.1 Dec 08, 2015
2.4.0 Dec 06, 2015
2.3.0 Nov 23, 2015
2.2.1 Nov 12, 2015
2.2.0 Oct 26, 2015
2.1.3 Oct 18, 2015
2.1.2 Oct 15, 2015
2.1.1 Oct 08, 2015
2.1.0 Oct 01, 2015
2.0.0 Sep 25, 2015
2.0.0rc2 Sep 16, 2015
2.0.0rc1 Sep 14, 2015
2.0.0b5 Aug 23, 2015
2.0.0b4 Jul 08, 2015
2.0.0b3 Jun 14, 2015
2.0.0b2 May 03, 2015
2.0.0b1 Apr 26, 2015
2.0.0a1 Apr 25, 2015
1.2.6 May 03, 2015
1.2.5 Apr 25, 2015
1.2.4 Mar 22, 2015
1.2.3 Mar 16, 2015
1.2.2 Feb 23, 2015
1.2.1 Jan 11, 2015
1.2.0 Dec 23, 2014
1.1.0 Dec 03, 2014
1.0.1 Nov 19, 2014
1.0.0 Oct 19, 2014
1.0.0a0 Oct 19, 2014
0.7.0 Jun 22, 2014
0.6.0 Jun 04, 2014
0.5.5 May 03, 2014
0.5.4 Apr 18, 2014
0.5.3 Mar 03, 2014
0.5.2 Feb 10, 2014
0.5.1 Feb 03, 2014
0.5.0 Dec 29, 2013
0.4.1 Dec 02, 2013
0.4.0 Nov 25, 2013
0.3.1 Nov 16, 2013
0.3.0 Nov 14, 2013
0.2.1 Nov 12, 2013
0.2.0 Nov 12, 2013
0.1.0 Nov 11, 2013

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
backports-datetime-fromisoformat
typing-extensions