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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pynamodb_async-0.1.1.tar.gz | 82.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynamodb_async-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.8 kB
Release files / pynamodb_async-0.1.1.tar.gz
| Download URL | pynamodb_async-0.1.1.tar.gz |
|---|---|
| Size | 82.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e17a6b3570bfa15e77c6fecccf5385430292bdccf1a80c083fc0dd17f4042c1e
|
|
BLAKE2b-256 checksum How to use checksums |
ae942a214209cfe3555881697d0b61a5986011421f9b58f83fe237ad6166ebc4
|
| 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 logRelease files / pynamodb_async-0.1.1-py3-none-any.whl
| Download URL | pynamodb_async-0.1.1-py3-none-any.whl |
|---|---|
| Size | 36.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3afccce1c3ac034cc58d912f419c16394a943beecaf55c4fb1ac9680fdc12068
|
|
BLAKE2b-256 checksum How to use checksums |
6a3edce5fcdac90f52c9e1cd2ce35e27381b1953516f21d1ea4955c5f4980676
|
| 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