Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

DynamORM is a Python object relation mapping library for Amazon's DynamoDB service.

Project Description


This package is a work in progress – Feedback / Suggestions / Etc welcomed!

DynamORM (pronounced Dynamo-R-M) is a Python object relation mapping library for Amazon’s DynamoDB service.

The project has two goals:

  1. Abstract away the interaction with the underlying DynamoDB libraries. Python access to the DynamoDB service has evolved quickly, from Dynamo v1 in boto to Dynamo v2 in boto and then the new resource model in boto3. By providing a consistent interface that will feel familiar to users of other Python ORMs (SQLAlchemy, Django, Peewee, etc) means that we can always provide best-practices for queries and take advantages of new features without needing to refactor any application logic.
  2. Delegate schema validation and serialization to more focused libraries. Building ORM semantics is “easy”, doing data validation and serialization is not. We support both Marshmallow and Schematics for building your object schemas. You can take advantage of the full power of these libraries as they are transparently exposed in your code.

Supported Versions

  • Schematics >= 2.0
  • Marshmallow >= 2.0


from dynamorm import DynaModel

# In this example we'll use Marshmallow, but you can also use Schematics too!
# You can see that you have to import the schema library yourself, it is not abstracted at all
from marshmallow import fields

# Our objects are defined as DynaModel classes
class Book(DynaModel):
    # Define our DynamoDB properties
    class Table:
        name = 'prod-books'
        hash_key = 'isbn'
        read = 25
        write = 5

    # Define our data schema, each property here will become a property on instances of the Book class
    class Schema:
        isbn = fields.String(validate=validate_isbn)
        title = fields.String()
        author = fields.String()
        publisher = fields.String()
        year = fields.Number()

# Store new documents directly from dictionaries
    "isbn": "12345678910",
    "title": "Foo",
    "author": "Mr. Bar",
    "publisher": "Publishorama"

# Work with the classes as objects.  You can pass attributes from the schema to the constructor
foo = Book(isbn="12345678910", title="Foo", author="Mr. Bar",

# Or assign attributes
foo = Book()
foo.isbn = "12345678910"
foo.title = "Foo" = "Mr. Bar"
foo.publisher = "Publishorama"

# In all cases they go through Schema validation, calls to .put or .save can result in ValidationError

# You can then fetch, query and scan your tables.
# Get on the hash key, and/or range key
book = Book.get(isbn="12345678910")

# Update items, with conditions
# Here our condition ensures we don't have a race condition where someone else updates the title first
book.update(title='Corrected Foo', conditions=(title=book.title,))

# Query based on the keys

# Scan based on attributes
Book.scan(author="Mr. Bar")
Book.scan(author__ne="Mr. Bar")


Full documentation is built from the sources each build and can be found online at:

The tests/ also contain the most complete documentation on how to actually use the library, so you are encouraged to read through them to really familiarize yourself with some of the more advanced concepts and use cases.


These are broken down by milestone release.


  • Indexes – Currently there is no support for indexes.
  • Partial updates on save()


  • Schema Migrations
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dynamorm-0.2.5-py2.py3-none-any.whl (20.6 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Aug 2, 2017
dynamorm-0.2.5.tar.gz (14.8 kB) Copy SHA256 Checksum SHA256 Source Aug 2, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting