$ show getmoto/moto
Moto is a Python library that emulates AWS service APIs in-process for testing and local development. It intercepts boto3/botocore HTTP requests via a custom botocore stubber, dispatches them to per-service in-memory backends registered through a BackendDict pattern, and returns AWS-compatible responses. The library supports decorator/context-manager use, a standalone Flask-based server mode, and an HTTPS proxy mode, making it usable from Python tests, CI pipelines, and non-Python SDKs via a local endpoint.
The LLM identified 5 files worth highlighting for reuse:
Core interception layer that hooks into botocore's request pipeline and routes AWS API calls to Moto's in-memory backends. Demonstrates a clean, non-obvious pattern for faking an external SDK at the transport layer and is the foundational mechanism that makes the entire mocking library work.
A reusable paginate decorator driven by PAGINATION_MODEL dictionaries. It provides consistent token-based pagination across dozens of services, is largely decoupled from any single AWS service, and could be extracted for any Python API that needs declarative pagination behavior.
Centralized TaggingService used by many Moto service backends to manage resource tags uniformly. It implements tag validation, filtering, and ARN-keyed storage in a self-contained module, making it a solid reusable component for any project needing consistent resource-tag semantics.
ManagedState models configurable state transitions (immediate, manual, time-based) for simulating AWS eventual-consistency behavior in tests. The abstraction is isolated and demonstrates a clean way to let testers manipulate resource lifecycle timing without coupling to a specific service.
Contains small foundational types such as Base64EncodedString that centralize encoding/decoding concerns across response serialization. It is isolated, easy to reuse, and shows disciplined handling of a cross-cutting format concern.