Knowledge Base updated: 2026-11-19
aiobotocore knowledge base
aiobotocore provides asynchronous counterparts to botocore sessions, clients, request execution, and selected service helpers while preserving botocore-compatible models, configuration, and event behavior.
The main runtime path starts with an async session and client, resolves configuration and credentials, signs and dispatches requests through async HTTP transports, then parses responses into botocore-shaped results. Higher-level pagination, waiters, event streams, retries, and test tooling build on that path.
Critical shared state is concentrated in session components and client configuration; transport sessions and streaming responses have explicit asynchronous cleanup boundaries.
flowchart TD
App[Application] --> Session[AioSession]
Session --> Client[Async client]
Session --> Config[Configuration and credentials]
Client --> Events[Botocore event system]
Client --> Endpoint[Endpoint resolver]
Config --> Signer[Request signer]
Client --> Signer
Signer --> Request[AWS request]
Endpoint --> Transport[aiohttp / HTTPX session]
Request --> Transport
Transport --> Response[Async response body]
Response --> Parser[Protocol parser and checksums]
Parser --> Result[Service result]
Client --> Retry[Retry handlers]
Client --> Features[Paginators, waiters, event streams]
Retry --> Endpoint
Glossary
- AioSession: the asynchronous session implementation that supplies botocore-compatible components and creates clients.
- AioEndpoint: the endpoint layer that coordinates request dispatch through an asynchronous HTTP session.
- AioBaseClient: the async client surface that exposes generated service operations and higher-level helpers.
- AioStubber: the asynchronous test double used to queue modeled responses and errors for client calls.
- StreamingBody: the async response-body wrapper used for incremental reads and cleanup.
Invariants
- Client and transport resources must be closed asynchronously; callers use async context managers or explicit
close()paths (aiobotocore/session.py, aiobotocore/httpsession.py, aiobotocore/httpxsession.py). - aiohttp and HTTPX transports preserve botocore request semantics while adapting I/O to awaitable operations (aiobotocore/httpsession.py, aiobotocore/httpxsession.py).
- Client operation behavior remains driven by botocore service models and event hooks rather than bespoke per-service implementations (aiobotocore/client.py, aiobotocore/session.py).
- Credential acquisition and refresh can perform asynchronous work before signing requests (aiobotocore/credentials.py, aiobotocore/signers.py).
- Test fixtures validate compatibility against botocore behavior as well as async-specific transport behavior (
tests/botocore_tests/**, tests/test_httpsession.py).
Routing table
- aiobotocore/session.py -> Session and client API
- aiobotocore/client.py -> Session and client API
- aiobotocore/session.py -> Session lifecycle and service resolution
- aiobotocore/loaders.py -> Session lifecycle and service resolution
- aiobotocore/client.py -> Client construction and customization
- aiobotocore/args.py -> Client construction and customization
- aiobotocore/endpoint.py -> Request execution
- aiobotocore/client.py -> Request execution
- aiobotocore/endpoint.py -> Endpoint and HTTP transport
- aiobotocore/httpsession.py -> Endpoint and HTTP transport
- aiobotocore/httpxsession.py -> Endpoint and HTTP transport
- aiobotocore/awsrequest.py -> AWS requests and responses
- aiobotocore/response.py -> AWS requests and responses
- aiobotocore/parsers.py -> Protocol parsing and checksums
- aiobotocore/httpchecksum.py -> Protocol parsing and checksums
- aiobotocore/credentials.py -> Identity and configuration
- aiobotocore/config.py -> Identity and configuration
- aiobotocore/credentials.py -> Credentials, tokens, and signing
- aiobotocore/tokens.py -> Credentials, tokens, and signing
- aiobotocore/signers.py -> Credentials, tokens, and signing
- aiobotocore/config.py -> Configuration, regions, and endpoint discovery
- aiobotocore/discovery.py -> Configuration, regions, and endpoint discovery
- aiobotocore/client.py -> Asynchronous service features
- aiobotocore/paginate.py -> Paginators and waiters
- aiobotocore/waiter.py -> Paginators and waiters
- aiobotocore/eventstream.py -> Event streams
- aiobotocore/retryhandler.py -> Retry and resilience
aiobotocore/retries/**-> Retry strategies and rate controltests/botocore_tests/**-> Testing and compatibility tooling- tests/test_httpsession.py -> Testing and compatibility tooling
- aiobotocore/stub.py -> Stubbing and test support
- tests/…/test_stub*.py -> Stubbing and test support