marshmallow


Namemarshmallow JSON
Version 3.0.0b2 PyPI version JSON
download
home_pagehttps://github.com/marshmallow-code/marshmallow
SummaryA lightweight library for converting complex datatypes to and from native Python datatypes.
upload_time2017-03-20 01:34:01
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/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 --pre


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

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

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

- Python >= 2.7 or >= 3.4

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-03-20 01:34:01", 
    "author": "Steven Loria", 
    "home_page": "https://github.com/marshmallow-code/marshmallow", 
    "github_user": "marshmallow-code", 
    "download_url": "https://pypi.python.org/packages/fa/12/4a837dc26173819a29e713cbfb490a83d5296545abbe53422d7b14604d8f/marshmallow-3.0.0b2.tar.gz", 
    "platform": "", 
    "version": "3.0.0b2", 
    "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/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 --pre\n\n\nDocumentation\n=============\n\nFull documentation is available at http://marshmallow.readthedocs.io/ .\n\nRequirements\n============\n\n- Python >= 2.7 or >= 3.4\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-03-20T01:33:58", 
            "comment_text": "", 
            "python_version": "py2.py3", 
            "url": "https://pypi.python.org/packages/be/ae/94a6d1854be8ded2528cd29fde90c70dc30a360b11ef71cfe9c5e7000ff9/marshmallow-3.0.0b2-py2.py3-none-any.whl", 
            "md5_digest": "3145ffb9f6a650e3714f036e968af496", 
            "downloads": 292, 
            "filename": "marshmallow-3.0.0b2-py2.py3-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "path": "be/ae/94a6d1854be8ded2528cd29fde90c70dc30a360b11ef71cfe9c5e7000ff9/marshmallow-3.0.0b2-py2.py3-none-any.whl", 
            "size": 43215
        }, 
        {
            "has_sig": false, 
            "upload_time": "2017-03-20T01:34:01", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/fa/12/4a837dc26173819a29e713cbfb490a83d5296545abbe53422d7b14604d8f/marshmallow-3.0.0b2.tar.gz", 
            "md5_digest": "58ad7d3ae90d15b1168266e5e0a6e440", 
            "downloads": 144, 
            "filename": "marshmallow-3.0.0b2.tar.gz", 
            "packagetype": "sdist", 
            "path": "fa/12/4a837dc26173819a29e713cbfb490a83d5296545abbe53422d7b14604d8f/marshmallow-3.0.0b2.tar.gz", 
            "size": 140009
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}