dyntastic
A DynamoDB library on top of Pydantic and boto3.
What it is and what it does
Dyntastic bridges Pydantic models and DynamoDB by letting you define table schemas as Python classes that inherit from Dyntastic (itself a Pydantic BaseModel). You get automatic serialization, validation, and type hints, plus a fluent API for DynamoDB operations: single-item reads and writes, queries with range-key conditions and filters, scans, batch reads and writes, and transactions. All operations are built on top of boto3, so they integrate with your existing AWS authentication and configuration.
The library handles common DynamoDB patterns—pagination, consistent reads, sparse indexes, and conditional updates—without requiring you to write raw boto3 calls or manage item marshalling. Because it extends Pydantic, models work seamlessly in FastAPI and other frameworks that already know how to serialize and validate Pydantic objects.
Use it for:
- Define a DynamoDB table schema as a Pydantic model and perform type-safe CRUD operations without raw boto3 calls.
- Query DynamoDB with range-key conditions and filter expressions using a fluent attribute API (e.g., A.timestamp < datetime(...)).
- Batch read or write multiple items in a single operation, with automatic chunking to respect DynamoDB's 25-item and 16MB limits.
- Use transactional writes to ensure multiple items are updated atomically or fail together.
- Integrate DynamoDB models directly into FastAPI endpoints or other Pydantic-aware frameworks for request/response validation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Dyntastic is a DynamoDB object-relational mapper built on Pydantic and boto3 that lets you define tables as Pydantic models and perform CRUD, query, scan, batch, and transactional operations against DynamoDB.
Yes, if you are building on DynamoDB and want to avoid raw boto3 boilerplate. The package is stable, has no known vulnerabilities, and integrates cleanly with Pydantic and FastAPI. Maintenance is aging but the repository is active; if you need ongoing updates or encounter issues, be prepared to contribute or maintain a fork. The three dependencies are lightweight and widely used.
Install
dyntastic on PyPI
pip
pip install dyntasticuv
uv add dyntasticpoetry
poetry add dyntasticInstalling dyntastic
Before you install
Low friction: pure Python wheel with three runtime dependencies (boto3, pydantic, importlib-metadata). Maintenance is aging—last commit was 2025-04-08 and the project has not released since 2025-04-06, but the repository is active and not archived.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
from dyntastic import Dyntastic
from pydantic import Field
import uuid
class Product(Dyntastic):
__table_name__ = "products"
__hash_key__ = "product_id"
product_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
name: str
price: float
product = Product(name="bread", price=3.99)
product.save()
fetched = Product.get(product.product_id)
Requires AWS credentials configured (via environment variables, IAM role, or boto3 config) and an existing DynamoDB table matching the model's __table_name__.
Verify before relying
- Whether the package supports DynamoDB Streams or change data capture.
- Performance characteristics under high-throughput workloads or large result sets.
- Compatibility with DynamoDB local or moto for testing.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — boto3, pydantic, importlib-metadata |
| Maintenance | aging — 495 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 238,333/month — #8,940 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dyntastic-0.18.0-py3-none-any.whl
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
pydynamodbPyDynamoDB is a DB API 2.0 client for Amazon…
permissive · top 15,000 on PyPI
pydantic_yamlPydantic-YAML adds YAML serialization and…
permissive · top 5,000 on PyPI
numpydanticNumpydantic adds type annotations and…
permissive · top 15,000 on PyPI
beanieBeanie is an asynchronous Python…
permissive · top 5,000 on PyPI
python-dynamodb-lockProvides distributed locking on top of DynamoDB…
permissive · top 15,000 on PyPI
types-boto3-dynamodbProvides type annotations for boto3's DynamoDB…
permissive · top 5,000 on PyPI
mypy-boto3-dynamodbProvides type annotations and IDE…
permissive · top 5,000 on PyPI
drf-pydanticBridges pydantic models and Django REST…
permissive · top 15,000 on PyPI
pynamodbPynamoDB provides a Pythonic ORM-like interface…
permissive · top 5,000 on PyPI
aws-cdk.aws-dynamodbProvides AWS CDK constructs for defining,…
permissive · top 15,000 on PyPI