pynamodb
A Pythonic Interface to DynamoDB
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 pynamodbuv
uv add pynamodbpoetry
poetry add pynamodbInstalling 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
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
pynamodb-attributesProvides typed attribute classes for PynamoDB…
unclear · top 15,000 on PyPI
pydynamodbPyDynamoDB is a DB API 2.0 client for Amazon…
permissive · top 15,000 on PyPI
dynamodb-encryption-sdkEncrypts and decrypts DynamoDB items…
permissive · top 15,000 on PyPI
botoBoto is a Python interface to Amazon Web…
permissive · top 5,000 on PyPI
amazon-dax-clientA Python client library that provides nearly…
permissive · top 15,000 on PyPI
dynamo-jsonConverts between DynamoDB's native JSON format…
permissive · top 15,000 on PyPI
dynamodb-jsonConverts Python objects to and from DynamoDB's…
unclear · top 5,000 on PyPI
aws-cdk.aws-dynamodbProvides AWS CDK constructs for defining,…
permissive · top 15,000 on PyPI
pynautobotpynautobot is a Python API client library for…
permissive · top 15,000 on PyPI
pynetboxPynetbox is a Python client library for…
permissive · top 5,000 on PyPI