Skip to main content

Moto - Mock AWS Services

Join the chat at https://gitter.im/awsmoto/Lobby

Build Status Coverage Status Docs PyPI PyPI - Python Version PyPI - Downloads Code style: Ruff Financial Contributors

Install

$ pip install 'moto[ec2,s3,all]'

In a nutshell

Moto is a library that allows your tests to easily mock out AWS Services.

Imagine you have the following python code that you want to test:

import boto3


class MyModel:
    def __init__(self, name, value):
        self.name = name
        self.value = value

    def save(self):
        s3 = boto3.client("s3", region_name="us-east-1")
        s3.put_object(Bucket="mybucket", Key=self.name, Body=self.value)

Take a minute to think how you would have tested that in the past.

Now see how you could test it with Moto:

import boto3
from moto import mock_aws
from mymodule import MyModel


@mock_aws
def test_my_model_save():
    conn = boto3.resource("s3", region_name="us-east-1")
    # We need to create the bucket since this is all in Moto's 'virtual' AWS account
    conn.create_bucket(Bucket="mybucket")
    model_instance = MyModel("steve", "is awesome")
    model_instance.save()
    body = conn.Object("mybucket", "steve").get()["Body"].read().decode("utf-8")
    assert body == "is awesome"

With the decorator wrapping the test, all the calls to s3 are automatically mocked out. The mock keeps track of the state of the buckets and keys.

For a full list of which services and features are covered, please see our implementation coverage.

Documentation

The full documentation can be found here:

https://docs.getmoto.org/en/latest/

Financial Contributions

Support this project and its continued development, by sponsoring us!

Click the Sponsor-button at the top of the page for more information.

Our finances are managed by OpenCollective, which means you have full visibility into all our contributions and expenses: https://opencollective.com/moto

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Powered by

JetBrains logo.

Metadata

Release files for moto 5.2.6

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

Source distribution (sdist)

Source distribution for moto 5.2.6
File Size Uploaded Provenance Actions
moto-5.2.6.tar.gz 9.9 MB With provenance Details for moto-5.2.6.tar.gz

Built distribution (wheel)

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

Total release size: 17.6 MB

Release files / moto-5.2.6.tar.gz

Download URL moto-5.2.6.tar.gz
Size 9.9 MB
Tags Source
SHA-256 checksum
How to use checksums
247351594cfa4917ec74834a0be62915804d568ad3b667988194668ad39c44a7
BLAKE2b-256 checksum
How to use checksums
5d3bf78761d8d22f172159f5e306928e88d7d5058d4853d4963eaee41261117a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Release files / moto-5.2.6-py3-none-any.whl

Download URL moto-5.2.6-py3-none-any.whl
Size 7.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1f0b99bceaead4543b743a961df0353d6fbc584fab658f9f84ef17df6ae6f24a
BLAKE2b-256 checksum
How to use checksums
3109fe35cd5d4c2bc1307e9d8bdcdcac746e802214ea3521cc1ae6b391208a26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Security for moto 5.2.6

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for moto-5.2.6.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 Nov 23, 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.

Release history Release notifications | RSS feed

This release

5.2.6 This release

2 release files Full provenance

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