skillfed

pynamodb

A Pythonic Interface to DynamoDB

pynamodb v6.1.0 4.7M downloads/30d#2,263 on PyPI2,649
Permissive license MIT Active released

What it is and what it does

PynamoDB is an ORM-like library that wraps the AWS DynamoDB API to make it more developer-friendly. Instead of writing verbose API calls, you define models as Python classes with typed attributes, then use simple method calls to create tables, save items, query, and scan. It handles the low-level details of serialization, pagination, and batch operations automatically.

The library supports the full DynamoDB feature set: hash and range keys, global and local secondary indexes, streams, and complex filter expressions. It works with both AWS-hosted DynamoDB and local development instances. Dependencies are minimal (botocore for AWS communication and typing-extensions for type hints), and it supports Python 3.7 through 3.12, making it suitable for modern production applications.

Use it for:

  • Define and manage DynamoDB tables as Python classes without writing raw JSON schemas or verbose API calls.
  • Query and filter DynamoDB items using Pythonic expressions instead of low-level attribute notation.
  • Batch save, update, or delete multiple items with automatic pagination and error handling.
  • Develop and test locally against DynamoDB Local by changing a single host configuration.
  • Stream DynamoDB changes (new/old images) into application logic for real-time event processing.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PynamoDB provides a Pythonic ORM-like interface to Amazon DynamoDB, simplifying table definition, querying, and data operations compared to the raw AWS API.

Yes. PynamoDB is actively maintained, has no known vulnerabilities, installs with minimal friction, and is widely used. It significantly reduces boilerplate for DynamoDB applications. Install it if you're building on DynamoDB and want a cleaner API than raw boto3; skip it only if you need very low-level control or are already committed to a different ORM.

Install

pynamodb on PyPI

pip

pip install pynamodb

uv

uv add pynamodb

poetry

poetry add pynamodb

Installing pynamodb

Before you install

Low friction: pure Python wheel with only two runtime dependencies (botocore and typing-extensions). Repository is actively maintained with recent commits and 2649 stars.

License in practice

MIT license is permissive; you can use, modify, and distribute PynamoDB freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pynamodb

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

class UserModel(Model):
    class Meta:
        table_name = "dynamodb-user"
    last_name = UnicodeAttribute(hash_key=True)
    first_name = UnicodeAttribute(range_key=True)

user = UserModel("John", "Denver")
user.save()

Requires an active AWS DynamoDB table or a local DynamoDB instance; AWS credentials must be configured in your environment.

Verify before relying

  • Performance characteristics and throughput limits compared to direct boto3 calls.
  • Compatibility with DynamoDB features added after the latest release date.
  • Whether monthly download figures reflect production usage or include test/CI environments.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — botocore, typing-extensions
Maintenance actively maintained — 438 days since the last release
Last repo commit
First released
Downloads 4,657,066/month — #2,263 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pynamodb-6.1.0-py3-none-any.whl

Keywords: python, dynamodb, amazon

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

dynamodb python ormaws dynamodb client librarynosql database pythondynamodb query interfaceamazon dynamodb wrapperpython dynamodb modelsdynamodb attribute mapping
dynamodbaws-integrationorm

More Database packages