marshmallow


Namemarshmallow JSON
Version 2.11.1 PyPI version JSON
home_pagehttps://github.com/marshmallow-code/marshmallow
SummaryA lightweight library for converting complex datatypes to and from native Python datatypes.
upload_time2017-01-08 21:24:25
maintainer
docs_urlNone
authorSteven Loria
requires_python
licenseMIT
keywords serialization rest json api marshal marshalling deserialization validation schema
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
Coveralis test coverage No Coveralis.
            ********************************************
marshmallow: simplified object serialization
********************************************

.. image:: https://badge.fury.io/py/marshmallow.svg
    :target: http://badge.fury.io/py/marshmallow
    :alt: Latest version

.. image:: https://travis-ci.org/marshmallow-code/marshmallow.svg?branch=pypi
    :target: https://travis-ci.org/marshmallow-code/marshmallow
    :alt: Travis-CI

.. image:: https://readthedocs.org/projects/flask-marshmallow/badge/
   :target: http://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 marshmallow import Schema, fields, pprint

    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.data, 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 http://marshmallow.readthedocs.io/ .

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

- Python >= 2.6 or >= 3.3

marshmallow has no external dependencies outside of the Python standard library, although `python-dateutil <https://pypi.python.org/pypi/python-dateutil>`_ is recommended for robust datetime deserialization.


Ecosystem
=========

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

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

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

- Docs: http://marshmallow.readthedocs.io/
- Changelog: http://marshmallow.readthedocs.io/en/latest/changelog.html
- PyPI: https://pypi.python.org/pypi/marshmallow
- Issues: https://github.com/marshmallow-code/marshmallow/issues

License
=======

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



            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "coveralis": false, 
    "keywords": "serialization,rest,json,api,marshal,marshalling,deserialization,validation,schema", 
    "upload_time": "2017-01-08 21:24:25", 
    "author": "Steven Loria", 
    "home_page": "https://github.com/marshmallow-code/marshmallow", 
    "github_user": "marshmallow-code", 
    "download_url": "https://pypi.python.org/packages/9c/9a/80d8fdc567cf92f24f8a4777a9aeb6cf318d086a3490bdcfff54bd0b0fd4/marshmallow-2.11.1.tar.gz", 
    "platform": "", 
    "version": "2.11.1", 
    "cheesecake_documentation_id": null, 
    "description": "********************************************\nmarshmallow: simplified object serialization\n********************************************\n\n.. image:: https://badge.fury.io/py/marshmallow.svg\n    :target: http://badge.fury.io/py/marshmallow\n    :alt: Latest version\n\n.. image:: https://travis-ci.org/marshmallow-code/marshmallow.svg?branch=pypi\n    :target: https://travis-ci.org/marshmallow-code/marshmallow\n    :alt: Travis-CI\n\n.. image:: https://readthedocs.org/projects/flask-marshmallow/badge/\n   :target: http://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 marshmallow import Schema, fields, pprint\n\n    class ArtistSchema(Schema):\n        name = fields.Str()\n\n    class AlbumSchema(Schema):\n        title = fields.Str()\n        release_date = fields.Date()\n        artist = fields.Nested(ArtistSchema())\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.data, 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 http://marshmallow.readthedocs.io/ .\n\nRequirements\n============\n\n- Python >= 2.6 or >= 3.3\n\nmarshmallow has no external dependencies outside of the Python standard library, although `python-dateutil <https://pypi.python.org/pypi/python-dateutil>`_ is recommended for robust datetime deserialization.\n\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\nProject Links\n=============\n\n- Docs: http://marshmallow.readthedocs.io/\n- Changelog: http://marshmallow.readthedocs.io/en/latest/changelog.html\n- PyPI: https://pypi.python.org/pypi/marshmallow\n- Issues: https://github.com/marshmallow-code/marshmallow/issues\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE <https://github.com/marshmallow-code/marshmallow/blob/pypi/LICENSE>`_ file for more details.\n\n\n", 
    "tox": true, 
    "lcname": "marshmallow", 
    "bugtrack_url": null, 
    "github": true, 
    "name": "marshmallow", 
    "license": "MIT", 
    "travis_ci": true, 
    "github_project": "marshmallow", 
    "summary": "A lightweight library for converting complex datatypes to and from native Python datatypes.", 
    "split_keywords": [
        "serialization", 
        "rest", 
        "json", 
        "api", 
        "marshal", 
        "marshalling", 
        "deserialization", 
        "validation", 
        "schema"
    ], 
    "author_email": "sloria1@gmail.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2017-01-08T21:24:18", 
            "comment_text": "", 
            "python_version": "py2.py3", 
            "url": "https://pypi.python.org/packages/51/52/ebe69c46ca0f58644a4e862734bd7a675871a20863e5af92614a41a494c2/marshmallow-2.11.1-py2.py3-none-any.whl", 
            "md5_digest": "514bb8ac2bc1ea61c953ae99aeca1cb8", 
            "downloads": 0, 
            "filename": "marshmallow-2.11.1-py2.py3-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "path": "51/52/ebe69c46ca0f58644a4e862734bd7a675871a20863e5af92614a41a494c2/marshmallow-2.11.1-py2.py3-none-any.whl", 
            "size": 45051
        }, 
        {
            "has_sig": false, 
            "upload_time": "2017-01-08T21:24:25", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/9c/9a/80d8fdc567cf92f24f8a4777a9aeb6cf318d086a3490bdcfff54bd0b0fd4/marshmallow-2.11.1.tar.gz", 
            "md5_digest": "d28a9f8e94a6d876fda6e132b66c63ad", 
            "downloads": 0, 
            "filename": "marshmallow-2.11.1.tar.gz", 
            "packagetype": "sdist", 
            "path": "9c/9a/80d8fdc567cf92f24f8a4777a9aeb6cf318d086a3490bdcfff54bd0b0fd4/marshmallow-2.11.1.tar.gz", 
            "size": 136633
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}