Skip to main content

A simple library for converting complex datatypes into native Python datatypes.

Project description

Latest version Travis-CI

Homepage: http://marshmallow.readthedocs.org/

marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, into native Python datatypes. The serialized objects can then be rendered to standard formats such as JSON for use in a REST API.

from datetime import datetime
from marshmallow import Serializer, fields

# A "model"
class Person(object):
    def __init__(self, name):
        self.name = name
        self.date_born = datetime.now()

# A serializer
class PersonSerializer(Serializer):
    name = fields.String()
    date_born = fields.DateTime()

person = Person("Guido van Rossum")
serialized = PersonSerializer(person)
serialized.data
# {"name": "Guido van Rossum", "date_born": "Sun, 10 Nov 2013 14:24:50 -0000"}

Get It Now

$ pip install -U marshmallow

Documentation

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

Requirements

  • Python >= 2.7 or >= 3.3

License

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

Changelog

0.1.0 (2013-11-10)

  • First release.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marshmallow-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

marshmallow-0.1.0-py2.py3-none-any.whl (13.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file marshmallow-0.1.0.tar.gz.

File metadata

  • Download URL: marshmallow-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for marshmallow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7857de852b5170be1cab48d26c5eb1eeb5dbfb1037257680b6ca8de2b4157c33
MD5 b39d50e165c3b4e89a74376d24d2debd
BLAKE2b-256 ab3c1db68d3e9b391405f979a019c5455c6326261bb86c8655fb0f0d7e551e68

See more details on using hashes here.

Provenance

File details

Details for the file marshmallow-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for marshmallow-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b2a6f1df3c475cd9c1ae29d9ef46ab1f24110bf7721d4e91c8ee90e2eaf604e8
MD5 46f63d6115650600b7ad84369bc20e5c
BLAKE2b-256 becda4b993ec048239cb5f3a984ff6c892b3fb7a80628df7b0f1ecb3b6c27812

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page