Skip to main content

PynamoDB integration with the marshmallow (de)serialization library

Project description



`PynamoDB <>`_ integration with the `marshmallow <>`_ (de)serialization library.

From PyPi::

$ pip install marshmallow-pynamodb

From GitHub::

$ pip install git+

Declare your models

.. code-block:: python

from pynamodb.models import Model
from pynamodb.attributes import UnicodeAttribute

class User(Model):
class Meta:
table_name = "user"
email = UnicodeAttribute(null=True)
first_name = UnicodeAttribute(range_key=True)
last_name = UnicodeAttribute(hash_key=True)

Generate marshmallow schemas

.. code-block:: python

from marshmallow_pynamodb import ModelSchema

class UserSchema(ModelSchema):
class Meta:
model = User

user_schema = UserSchema()

(De)serialize your data

.. code-block:: python

user = User(last_name="Smith", first_name="John")

# {u'first_name': u'John', u'last_name': u'Smith', u'email': None}

user_schema.load({"last_name": "Smith", "first_name": "John"}).data
# user<Smith>

.. |pypi-package| image::
:alt: Latest version


MIT licensed. See the bundled `LICENSE <>`_ file for more details.

Project details

Download files

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

Files for marshmallow-pynamodb, version 0.2.5
Filename, size File type Python version Upload date Hashes
Filename, size marshmallow-pynamodb-0.2.5.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page