{"id":1754,"library":"types-aiobotocore","title":"Type Annotations for aiobotocore","description":"types-aiobotocore provides PEP 561 compliant type annotations for the `aiobotocore` library, enabling static type checking for asynchronous AWS client interactions. It helps catch type-related errors before runtime and improves IDE autocompletion. The current version is 3.4.0, and new versions are released frequently, tied to updates in the `mypy-boto3-builder` and `aiobotocore` itself.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["typing","stubs","aws","aiobotocore","async","mypy"],"install":[{"cmd":"pip install types-aiobotocore","lang":"bash","label":"Install core types"}],"dependencies":[{"reason":"This package provides type stubs for aiobotocore. aiobotocore must be installed separately for runtime functionality.","package":"aiobotocore","optional":false}],"imports":[{"note":"Type annotation for the aiobotocore session object. The runtime object comes from `aiobotocore.session.get_session()`.","symbol":"AioSession","correct":"from types_aiobotocore.session import AioSession"},{"note":"Type annotation for the generic aiobotocore client. For service-specific clients (e.g., S3Client), import from `types_aiobotocore_<service_name>.client` (requires installing `types-aiobotocore-<service_name>`).","symbol":"Client","correct":"from types_aiobotocore.client import Client"}],"quickstart":{"code":"import asyncio\nfrom aiobotocore.session import get_session\n\nasync def main():\n    session = get_session()\n    # `types-aiobotocore` provides type stubs for the session and client.\n    # For S3 specific types, you would also install `types-aiobotocore-s3`.\n    async with session.create_client(\"s3\") as client:\n        response = await client.list_buckets()\n        print(\"S3 Buckets:\", [b[\"Name\"] for b in response.get(\"Buckets\", [])])\n\nif __name__ == \"__main__\":\n    asyncio.run(main())","lang":"python","description":"This quickstart demonstrates how to use `aiobotocore` to list S3 buckets. By installing `types-aiobotocore` (and potentially `types-aiobotocore-s3`), your static type checker (like MyPy) will understand the types of `session` and `client`, providing autocompletion and error checking without altering the runtime code. Note that `aiobotocore` itself must be installed."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support has been removed as of `mypy-boto3-builder` version 8.12.0 (which generates `types-aiobotocore` 3.4.0). Users on Python 3.8 will need to upgrade to Python 3.9+.","severity":"breaking","affected_versions":">=3.4.0"},{"fix":"Ensure your type checker (e.g., MyPy) is up-to-date and correctly configured to discover PEP 561 stubs. Reinstalling the package might resolve issues.","message":"The builder migrated to PEP 561 compliant packages in version 8.12.0. While this is generally an improvement for type checker discovery, older type checker configurations or specific environments might require re-evaluation of how stub packages are found.","severity":"breaking","affected_versions":">=3.4.0"},{"fix":"Install service-specific type stub packages (`pip install types-aiobotocore-<service_name>`) for type checking related to individual AWS services.","message":"This `types-aiobotocore` package specifically provides type stubs for the *core* `aiobotocore` library (e.g., `AioSession`, generic `Client`). For service-specific type stubs (e.g., `S3Client`, `EC2Client`, `ListBucketsOutputTypeDef`), you must install the corresponding service package like `types-aiobotocore-s3`.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure you have `aiobotocore` installed via `pip install aiobotocore` alongside `types-aiobotocore`.","message":"`types-aiobotocore` only provides type annotations; it does not include the `aiobotocore` runtime library itself. Both must be installed for your code to execute and be type-checked.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}