skillfed

dyntastic

A DynamoDB library on top of Pydantic and boto3.

dyntastic v0.18.0 238.3K downloads/30d#8,940 on PyPI79
Permissive license MIT AGING released

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 dyntastic

uv

uv add dyntastic

poetry

poetry add dyntastic

Installing 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

Programming Language :: PythonProgramming Language :: Python :: 3

Tags

dynamodb orm pythonpydantic dynamodb modelsdynamodb query libraryboto3 wrapper dynamodbdynamodb batch operationsdynamodb transactions pythontype-safe dynamodb
dynamodbormpydantic-integration

More Database packages