pynamodb-attributes
Common attributes for PynamoDB
What it is and what it does
pynamodb-attributes is a library of pre-built attribute classes that wrap PynamoDB's base types to provide native Python serialization for common data structures. It lets you store Python enums, UUIDs, timedeltas, and timestamps directly in DynamoDB without manual conversion, and adds support for composite keys via delimited tuples. The library is maintained by Lyft and sits on top of pynamodb, the popular DynamoDB ORM for Python.
You use it by importing the attribute class you need and adding it to your PynamoDB model definition. For example, instead of storing a UUID as a string and converting it yourself, you declare a UUIDAttribute and the library handles serialization to and from DynamoDB's native format. It covers a range of common types—integers, floats, enums (both Python and Protobuf), timestamps at multiple resolutions, and date objects—making model definitions cleaner and reducing boilerplate.
Use it for:
- Store and retrieve Python UUID objects directly in DynamoDB without manual string conversion.
- Serialize Python Enum values into DynamoDB attributes while preserving type safety.
- Record event timestamps at millisecond or microsecond precision as Unix epoch integers.
- Build composite keys using delimited tuples for complex partition or sort key patterns.
- Store timedelta durations as integer seconds, milliseconds, or microseconds for duration fields.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides typed attribute classes for PynamoDB that extend DynamoDB's native types with Python-native serialization for enums, timestamps, UUIDs, timedeltas, and composite keys.
Yes, if you are already using PynamoDB and need typed attribute support for common Python types. The library is stable, has no known vulnerabilities, and low install friction. However, verify the license status before committing to production use, and be aware that maintenance is aging—last release was March 2024 with no activity since then.
Install
pynamodb-attributes on PyPI
pip
pip install pynamodb-attributesuv
uv add pynamodb-attributespoetry
poetry add pynamodb-attributesInstalling pynamodb-attributes
Before you install
Low friction installation with a single pure-Python dependency (pynamodb). Last release was March 2024 and the repository remains active, though the project shows aging maintenance signals with no release in over a year.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata, so you cannot verify licensing terms before use.
Quickstart
pip install pynamodb-attributes
from pynamodb_attributes import UUIDAttribute, TimestampAttribute
class MyModel(Model):
id = UUIDAttribute(hash_key=True)
created = TimestampAttribute()
Requires pynamodb and an active DynamoDB instance (local or AWS); Python 3 is required.
Verify before relying
- Whether the unclear license status reflects a genuine omission or an intentional choice by the maintainer.
- Current maintenance commitment and likelihood of future updates or bug fixes.
- Whether all attribute types handle edge cases (e.g., timezone-aware vs. naive datetimes, protobuf enum compatibility).
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pynamodb |
| Maintenance | aging — 885 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 175,110/month — #10,271 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pynamodb_attributes-0.5.0-py2.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
pynamodbPynamoDB provides a Pythonic ORM-like interface…
permissive · top 5,000 on PyPI
dynamodb-jsonConverts Python objects to and from DynamoDB's…
unclear · top 5,000 on PyPI
dynamo-jsonConverts between DynamoDB's native JSON format…
permissive · top 15,000 on PyPI
pydynamodbPyDynamoDB is a DB API 2.0 client for Amazon…
permissive · top 15,000 on PyPI
uuid-extensionGenerates UUID version 7…
unclear · top 15,000 on PyPI
dynamodb-encryption-sdkEncrypts and decrypts DynamoDB items…
permissive · top 15,000 on PyPI
types-boto3-dynamodbProvides type annotations for boto3's DynamoDB…
permissive · top 5,000 on PyPI
nanotimeNanotime provides a 64-bit UNIX timestamp type…
permissive · top 15,000 on PyPI
mypy-boto3-dynamodbProvides type annotations and IDE…
permissive · top 5,000 on PyPI
types-aiobotocore-dynamodbProvides type annotations and IDE…
permissive · top 5,000 on PyPI