Skip to main content

aiomoto

aiomoto is Moto for aiobotocore (while staying compatible with classic botocore / boto3). It adapts Moto's stubber so async and sync clients share the same in-memory backend: you can write to a mock S3 bucket with boto3 and read it back via aiobotocore in the same process.

📖 Full documentation: https://aiomoto.pages.dev/

Supported today

  • mock_aws() usable as with or async with, guarding against real HTTP requests.
  • Actively exercised in tests: S3 (CRUD + listings + streaming reads), DynamoDB (create/describe/put/get), Secrets Manager, SES, SNS, SQS, KMS, STS, Lambda, Events, Kafka/MSK, and s3fs async integration — all sharing one Moto backend between sync boto3/botocore and async aiobotocore clients.
  • Other Moto services often work out of the box through the same patch layer; if you hit a service-specific gap, open an issue with a minimal repro so we can add a focused slice.

Installation

pip install aiomoto
# or, in a uv project:
uv add aiomoto

aiomoto re-exposes Moto's service extras (for example aiomoto[s3], aiomoto[dynamodb], or aiomoto[all]), plus aiomoto-specific extras (aiomoto[server], aiomoto[pandas], aiomoto[polars]). See the installation guide for details.

Usage

Use aiomoto.mock_aws as a drop-in replacement for Moto's mock_aws that works with both synchronous boto3/botocore clients and asynchronous aiobotocore clients in the same process. It supports with, async with, and decorating sync/async callables.

import boto3
from aiobotocore.session import AioSession
from aiomoto import mock_aws


async def demo() -> None:
    async with mock_aws():
        # Write with a synchronous boto3 client.
        boto3.client("s3", region_name="us-east-1").create_bucket(Bucket="example")

        # Read it back with an async aiobotocore client.
        session = AioSession()
        async with session.create_client("s3", region_name="us-east-1") as s3:
            result = await s3.list_buckets()
            assert any(b["Name"] == "example" for b in result["Buckets"])

The documentation covers more:

  • Contexts and decoratorswith / async with, @mock_aws, reset / remove_data, and the AWS_ENDPOINT_URL gotcha.
  • Server mode — run a local Moto server, endpoint-injection modes, and attaching to an existing server.
  • Pandas and Polarss3:// DataFrame I/O.
  • Examples — S3, DynamoDB, SQS, SNS, s3fs, and streaming reads.
  • API referencemock_aws, mock_aws_decorator, AutoEndpointMode, and the exception types.

Motivation

Like many others I've wanted to use Moto with aiobotocore but found that wasn't supported. The motivation page explains the background and why aiomoto avoids depending on Moto's server mode by default.

Limitations

aiomoto keeps version ranges narrow and tested together, and a few integrations (notably pandas/polars S3 I/O) only work in server mode. See the limitations page for the full list, including free-threaded CPython support.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiomoto-0.5.4.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiomoto-0.5.4-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file aiomoto-0.5.4.tar.gz.

File metadata

  • Download URL: aiomoto-0.5.4.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aiomoto-0.5.4.tar.gz
Algorithm Hash digest
SHA256 aec04d30acb01bfc3a607ee6ec97c08e5b1c1692e3a2c5967f9059eeec2e4510
MD5 cdf86969de3ff1ab8e90b8df3883b91b
BLAKE2b-256 d1b3cef13ff2eaad3df314c254f563f023741bd4fc64b557696be6d6c1fdc26d

See more details on using hashes here.

File details

Details for the file aiomoto-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: aiomoto-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aiomoto-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b8d2e872c2977c87b4a2d03eeffe95f1bf971337f0ce8b226499bfcd8202b005
MD5 ce6879f67906bd76a947f3fbbcdf5d3d
BLAKE2b-256 5f343dd46035fd7ae290bbfcef90719fbb48bd73d55e12187cb0a40c4ca25ead

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page