marshmallow


Namemarshmallow JSON
Version 3.21.0 PyPI version JSON
download
home_page
SummaryA lightweight library for converting complex datatypes to and from native Python datatypes.
upload_time2024-02-26 19:45:08
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ********************************************
marshmallow: simplified object serialization
********************************************

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

.. 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

.. 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

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

**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
==========

::

    $ pip install -U marshmallow


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

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

Requirements
============

- Python >= 3.8

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
--------

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

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

.. image:: https://opencollective.com/marshmallow/sponsor/0/avatar.svg
    :target: https://opencollective.com/marshmallow/sponsor/0/website
    :alt: Sponsors

.. image:: https://opencollective.com/static/images/become_sponsor.svg
    :target: https://opencollective.com/marshmallow#sponsor
    :alt: Become a sponsor


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.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "marshmallow",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Steven Loria <sloria1@gmail.com>, J\u00e9r\u00f4me Lafr\u00e9choux <jerome@jolimont.fr>, Jared Deckard <jared@shademaps.com>",
    "keywords": "",
    "author": "",
    "author_email": "Steven Loria <sloria1@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/86/14/0dec31a81b16d39b6cfcb5ddd7e560d46dc5ea0d1d1bca0bb275a679071f/marshmallow-3.21.0.tar.gz",
    "platform": null,
    "description": "********************************************\nmarshmallow: simplified object serialization\n********************************************\n\n.. image:: https://badgen.net/pypi/v/marshmallow\n    :target: https://pypi.org/project/marshmallow/\n    :alt: Latest version\n\n.. image:: https://github.com/marshmallow-code/marshmallow/actions/workflows/build-release.yml/badge.svg\n    :target: https://github.com/marshmallow-code/marshmallow/actions/workflows/build-release.yml\n    :alt: Build status\n\n.. image:: https://results.pre-commit.ci/badge/github/marshmallow-code/marshmallow/dev.svg\n   :target: https://results.pre-commit.ci/latest/github/marshmallow-code/marshmallow/dev\n   :alt: pre-commit.ci status\n\n.. image:: https://readthedocs.org/projects/marshmallow/badge/\n   :target: https://marshmallow.readthedocs.io/\n   :alt: Documentation\n\n**marshmallow** is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.\n\n.. code-block:: python\n\n    from datetime import date\n    from pprint import pprint\n\n    from marshmallow import Schema, fields\n\n\n    class ArtistSchema(Schema):\n        name = fields.Str()\n\n\n    class AlbumSchema(Schema):\n        title = fields.Str()\n        release_date = fields.Date()\n        artist = fields.Nested(ArtistSchema())\n\n\n    bowie = dict(name=\"David Bowie\")\n    album = dict(artist=bowie, title=\"Hunky Dory\", release_date=date(1971, 12, 17))\n\n    schema = AlbumSchema()\n    result = schema.dump(album)\n    pprint(result, indent=2)\n    # { 'artist': {'name': 'David Bowie'},\n    #   'release_date': '1971-12-17',\n    #   'title': 'Hunky Dory'}\n\n\nIn short, marshmallow schemas can be used to:\n\n- **Validate** input data.\n- **Deserialize** input data to app-level objects.\n- **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.\n\nGet It Now\n==========\n\n::\n\n    $ pip install -U marshmallow\n\n\nDocumentation\n=============\n\nFull documentation is available at https://marshmallow.readthedocs.io/ .\n\nRequirements\n============\n\n- Python >= 3.8\n\nEcosystem\n=========\n\nA list of marshmallow-related libraries can be found at the GitHub wiki here:\n\nhttps://github.com/marshmallow-code/marshmallow/wiki/Ecosystem\n\nCredits\n=======\n\nContributors\n------------\n\nThis project exists thanks to all the people who contribute.\n\n**You're highly encouraged to participate in marshmallow's development.**\nCheck out the `Contributing Guidelines <https://marshmallow.readthedocs.io/en/latest/contributing.html>`_ to see how you can help.\n\nThank you to all who have already contributed to marshmallow!\n\n.. image:: https://opencollective.com/marshmallow/contributors.svg?width=890&button=false\n    :target: https://marshmallow.readthedocs.io/en/latest/authors.html\n    :alt: Contributors\n\nBackers\n-------\n\nIf you find marshmallow useful, please consider supporting the team with\na donation. Your donation helps move marshmallow forward.\n\nThank you to all our backers! [`Become a backer`_]\n\n.. _`Become a backer`: https://opencollective.com/marshmallow#backer\n\n.. image:: https://opencollective.com/marshmallow/backers.svg?width=890\n    :target: https://opencollective.com/marshmallow#backers\n    :alt: Backers\n\nSponsors\n--------\n\nSupport this project by becoming a sponsor (or ask your company to support this project by becoming a sponsor).\nYour logo will show up here with a link to your website. [`Become a sponsor`_]\n\n.. _`Become a sponsor`: https://opencollective.com/marshmallow#sponsor\n\n.. image:: https://opencollective.com/marshmallow/sponsor/0/avatar.svg\n    :target: https://opencollective.com/marshmallow/sponsor/0/website\n    :alt: Sponsors\n\n.. image:: https://opencollective.com/static/images/become_sponsor.svg\n    :target: https://opencollective.com/marshmallow#sponsor\n    :alt: Become a sponsor\n\n\nProfessional Support\n====================\n\nProfessionally-supported marshmallow is now available through the\n`Tidelift Subscription <https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=pypi-marshmallow&utm_medium=readme>`_.\n\nTidelift gives software development teams a single source for purchasing and maintaining their software,\nwith professional-grade assurances from the experts who know it best,\nwhile seamlessly integrating with existing tools. [`Get professional support`_]\n\n.. _`Get professional support`: https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=marshmallow&utm_medium=referral&utm_campaign=github\n\n.. image:: https://user-images.githubusercontent.com/2379650/45126032-50b69880-b13f-11e8-9c2c-abd16c433495.png\n    :target: https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=pypi-marshmallow&utm_medium=readme\n    :alt: Get supported marshmallow with Tidelift\n\n\nProject Links\n=============\n\n- Docs: https://marshmallow.readthedocs.io/\n- Changelog: https://marshmallow.readthedocs.io/en/latest/changelog.html\n- Contributing Guidelines: https://marshmallow.readthedocs.io/en/latest/contributing.html\n- PyPI: https://pypi.org/project/marshmallow/\n- Issues: https://github.com/marshmallow-code/marshmallow/issues\n- Donate: https://opencollective.com/marshmallow\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE <https://github.com/marshmallow-code/marshmallow/blob/dev/LICENSE>`_ file for more details.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A lightweight library for converting complex datatypes to and from native Python datatypes.",
    "version": "3.21.0",
    "project_urls": {
        "Changelog": "https://marshmallow.readthedocs.io/en/latest/changelog.html",
        "Funding": "https://opencollective.com/marshmallow",
        "Issues": "https://github.com/marshmallow-code/marshmallow/issues",
        "Source": "https://github.com/marshmallow-code/marshmallow",
        "Tidelift": "https://tidelift.com/subscription/pkg/pypi-marshmallow?utm_source=pypi-marshmallow&utm_medium=pypi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5976e4ddd6713bba5ede1d18f3959d7bffde38e56f7f7ae7c031c9a3d746b95",
                "md5": "311751f1c942446421fd91e623c92e6c",
                "sha256": "e7997f83571c7fd476042c2c188e4ee8a78900ca5e74bd9c8097afa56624e9bd"
            },
            "downloads": -1,
            "filename": "marshmallow-3.21.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "311751f1c942446421fd91e623c92e6c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 49357,
            "upload_time": "2024-02-26T19:45:04",
            "upload_time_iso_8601": "2024-02-26T19:45:04.728088Z",
            "url": "https://files.pythonhosted.org/packages/f5/97/6e4ddd6713bba5ede1d18f3959d7bffde38e56f7f7ae7c031c9a3d746b95/marshmallow-3.21.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86140dec31a81b16d39b6cfcb5ddd7e560d46dc5ea0d1d1bca0bb275a679071f",
                "md5": "1c278e35ccf9b27e6360123f0bac14f4",
                "sha256": "20f53be28c6e374a711a16165fb22a8dc6003e3f7cda1285e3ca777b9193885b"
            },
            "downloads": -1,
            "filename": "marshmallow-3.21.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1c278e35ccf9b27e6360123f0bac14f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 176342,
            "upload_time": "2024-02-26T19:45:08",
            "upload_time_iso_8601": "2024-02-26T19:45:08.392411Z",
            "url": "https://files.pythonhosted.org/packages/86/14/0dec31a81b16d39b6cfcb5ddd7e560d46dc5ea0d1d1bca0bb275a679071f/marshmallow-3.21.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-26 19:45:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "marshmallow-code",
    "github_project": "marshmallow",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "marshmallow"
}
        
Elapsed time: 0.22313s