Skip to main content

Async fork of PynamoDB powered by aiobotocore. Requires Python 3.10+. This fork tracks brunobelloni/AioPynamoDB and publishes fork builds on PyPI as as-aiopynamodb.

Installation

From PyPI:

$ pip install as-aiopynamodb -U

From GitHub:

$ pip install git+https://github.com/AppSolves/AioPynamoDB#egg=as-aiopynamodb

Basic Usage

Create a model that describes your DynamoDB table.

from aiopynamodb.models import Model
from aiopynamodb.attributes import UnicodeAttribute

class UserModel(Model):
    """
    A DynamoDB User
    """
    class Meta:
        table_name = "dynamodb-user"
    email = UnicodeAttribute(null=True)
    first_name = UnicodeAttribute(range_key=True)
    last_name = UnicodeAttribute(hash_key=True)

AioPynamoDB allows you to create the table if needed (it must exist before you can use it!):

await UserModel.create_table(read_capacity_units=1, write_capacity_units=1)

Create a new user:

user = UserModel("John", "Denver")
user.email = "djohn@company.org"
await user.save()

Now, search your table for all users with a last name of ‘Denver’ and whose first name begins with ‘J’:

async for user in UserModel.query("Denver", UserModel.first_name.startswith("J")):
    print(user.first_name)

Examples of ways to query your table with filter conditions:

async for user in UserModel.query("Denver", UserModel.email=="djohn@company.org"):
    print(user.first_name)

Retrieve an existing user:

try:
    user = await UserModel.get("John", "Denver")
    print(user)
except UserModel.DoesNotExist:
    print("User does not exist")

Advanced Usage

Want to use indexes? No problem:

from aiopynamodb.models import Model
from aiopynamodb.indexes import GlobalSecondaryIndex, AllProjection
from aiopynamodb.attributes import NumberAttribute, UnicodeAttribute

class ViewIndex(GlobalSecondaryIndex):
    class Meta:
        read_capacity_units = 2
        write_capacity_units = 1
        projection = AllProjection()
    view = NumberAttribute(default=0, hash_key=True)

class TestModel(Model):
    class Meta:
        table_name = "TestModel"
    forum = UnicodeAttribute(hash_key=True)
    thread = UnicodeAttribute(range_key=True)
    view = NumberAttribute(default=0)
    view_index = ViewIndex()

Now query the index for all items with 0 views:

async for item in TestModel.view_index.query(0):
    print("Item queried from index: {0}".format(item))

It’s really that simple.

Metadata

Release files for as-aiopynamodb 1.0.4

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

Source distribution (sdist)

Source distribution for as-aiopynamodb 1.0.4
File Size Uploaded Provenance Actions
as_aiopynamodb-1.0.4.tar.gz 96.8 kB With provenance Details for as_aiopynamodb-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for as-aiopynamodb 1.0.4
File Interpreter ABI Platform Actions
as_aiopynamodb-1.0.4-py3-none-any.whl Python 3 none any Details for as_aiopynamodb-1.0.4-py3-none-any.whl

Total release size: 159.6 kB

Release files / as_aiopynamodb-1.0.4.tar.gz

Download URL as_aiopynamodb-1.0.4.tar.gz
Size 96.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b108f3377d6583c5c96bdbc12e2eaaf65f353b874eaa2a47dce8c84322545b7e
BLAKE2b-256 checksum
How to use checksums
e6dca63de8adb358232ebc5958ebbf99a24a4d5e8d370a863663dbe473edac1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 19, 2026.

Transparency log

Release files / as_aiopynamodb-1.0.4-py3-none-any.whl

Download URL as_aiopynamodb-1.0.4-py3-none-any.whl
Size 62.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f264b47861e28d3b2b5ae85004afbd6e2648fe55468b837ae93c5be6daa33617
BLAKE2b-256 checksum
How to use checksums
13e7e4814e843b2ad8afb8e3a9e22dc3b516ac745c0849c1a0ba609b7f3e8f0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 19, 2026.

Transparency log

Security for as-aiopynamodb 1.0.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for as_aiopynamodb-1.0.4.tar.gz

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 Jun 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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