skillfed

pynamodb-attributes

Common attributes for PynamoDB

pynamodb-attributes v0.5.0 175.1K downloads/30d#10,271 on PyPI62
License unclear AGING released

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-attributes

uv

uv add pynamodb-attributes

poetry

poetry add pynamodb-attributes

Installing 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

Programming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

pynamodb custom attributesdynamodb python typed attributesenum serialization dynamodbtimestamp uuid pynamodbcomposite key dynamodb pythonpynamodb type extensionsdynamodb attribute wrappers
dynamodborm-extensiontype-serialization

More Database packages