Skip to main content

pynamodb-async

A native asyncio API for PynamoDB, built on aiobotocore. It runs next to official PynamoDB: you keep using PynamoDB's attributes, indexes and expressions, and get awaitable models, queries, batches and transactions.

pip install pynamodb-async

Needs Python 3.10+. This installs official pynamodb (6.1.x) and aiobotocore.

Usage

Declare a model with Model from pynamodb_async.models and attributes from pynamodb.attributes:

import pynamodb_async
from pynamodb.attributes import UnicodeAttribute
from pynamodb_async.models import Model


class User(Model):
    class Meta:
        table_name = "users"
        region = "us-east-1"

    email = UnicodeAttribute(hash_key=True)
    name = UnicodeAttribute(null=True)


async def main():
    async with pynamodb_async.connections():
        await User("ada@example.com", name="Ada").save()
        user = await User.get("ada@example.com")
        async for u in User.query("ada@example.com"):
            print(u.name)

Closing clients and event loops

Every async client holds an HTTP session. Close it when you are done with await User.close(), or wrap your code in async with pynamodb_async.connections():, which closes every connection opened inside the block. A client belongs to the event loop that created it, so use each model and Connection from one event loop at a time, and prefer one long-lived event loop for the whole program.

Relationship to PynamoDB

This package works alongside official PynamoDB. Its code is generated from a private source repository, a fork that also offers the same async API as a drop-in replacement for pynamodb. This add-on has its own async Connection.get_client(). What it does not have are the fork's sync additions: pynamodb.models.Model.close(), pynamodb.connections() and the sync pynamodb.connection.Connection.get_client(). It also lacks upstream fixes merged after the supported PynamoDB release (for example #1302) until upstream ships them.

Contributing

The code here is generated from a private source repository. Please open issues in this repository; pull requests are ported over by hand.

License

MIT, derived from PynamoDB. See LICENSE.

Metadata

Release files for pynamodb-async 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynamodb-async 0.1.0
File Size Uploaded
pynamodb_async-0.1.0.tar.gz 80.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynamodb-async 0.1.0
File Interpreter ABI Platform
pynamodb_async-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 115.7 kB

Release files / pynamodb_async-0.1.0.tar.gz

Download URL pynamodb_async-0.1.0.tar.gz
Size 80.0 kB
Tags Source
SHA-256 checksum
How to use checksums
62a825ac397d96c45152bbe6b2171ba31a9d3f488aa8de1e5e85578bb943ea60
BLAKE2b-256 checksum
How to use checksums
16b14af41b69bdc5c9e7139bf5356138cd3fbfc023d85ad64e6234ac28b865de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / pynamodb_async-0.1.0-py3-none-any.whl

Download URL pynamodb_async-0.1.0-py3-none-any.whl
Size 35.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
308f041ff9bee2ef7fdef4df87e936c8c22f3e3e1687e1ac007e7290b7e650eb
BLAKE2b-256 checksum
How to use checksums
1f8cca812619539bd4e4e300020db21deadea11a556fd37b9e6b0a020edf5595
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page