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 decorators — with / 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 Polars — s3:// DataFrame I/O.
  • Examples — S3, DynamoDB, SQS, SNS, s3fs, and streaming reads.
  • API reference — mock_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.

Metadata

Release files for aiomoto 0.5.5

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

Source distribution (sdist)

Source distribution for aiomoto 0.5.5
File Size Uploaded
aiomoto-0.5.5.tar.gz 18.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiomoto 0.5.5
File Interpreter ABI Platform
aiomoto-0.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 37.8 kB

Release files / aiomoto-0.5.5.tar.gz

Download URL aiomoto-0.5.5.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6b48093cc26cb58230ca1b539af4ccd733503f366443e7fc3101646833e14652
BLAKE2b-256 checksum
How to use checksums
fe6f8f62bdaf0ad876103b1bf95107bd56ad44b15c178dc40c68ac46b160e48b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}

Release files / aiomoto-0.5.5-py3-none-any.whl

Download URL aiomoto-0.5.5-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
415a8aaefd3682f3b6bbb3eb9ec566fe44626fc1cd44da132d1619347b7854e6
BLAKE2b-256 checksum
How to use checksums
8b9995eb03a6222634126ef2000de6c65ab9e1261264332180c461ca13db5d27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}

Release history Release notifications | RSS feed

This release

0.5.5 This release

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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