{"id":10317,"library":"types-aiobotocore-lite","title":"types-aiobotocore-lite","description":"types-aiobotocore-lite provides lite type annotations for the `aiobotocore` library, version 3.4.0. It offers Mypy-compatible stubs for a common subset of AWS services, generated by `mypy-boto3-builder`. The project maintains a frequent release cadence, often aligning with `aiobotocore` and `mypy-boto3-builder` updates.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aiobotocore","type hints","mypy","AWS","stubs","type checking"],"install":[{"cmd":"pip install types-aiobotocore-lite","lang":"bash","label":"Install core package"}],"dependencies":[{"reason":"Provides type stubs for this runtime library; typically, `types-aiobotocore-lite` should be installed alongside `aiobotocore`.","package":"aiobotocore","optional":false}],"imports":[{"note":"types-aiobotocore-lite provides type hints for aiobotocore at runtime. Your code continues to import from the aiobotocore library, and type checkers (like Mypy) will automatically pick up the installed stubs.","symbol":"get_session","correct":"from aiobotocore.session import get_session"}],"quickstart":{"code":"import asyncio\nfrom aiobotocore.session import get_session\nfrom typing import TYPE_CHECKING, Dict, Any\n\n# These imports are for type checking only and won't be executed at runtime\nif TYPE_CHECKING:\n    # Example: S3Client is made available by types-aiobotocore-lite for common services\n    from types_aiobotocore_s3.client import S3Client\n    from types_aiobotocore_s3.type_defs import CreateBucketRequestRequestTypeDef, CreateBucketOutputTypeDef\n\nasync def create_s3_bucket(bucket_name: str) -> Dict[str, Any]:\n    session = get_session()\n    async with session.create_client(\"s3\") as client:  # type: S3Client\n        # Now 'client' is type-checked as S3Client\n        request_params: CreateBucketRequestRequestTypeDef = {\n            \"Bucket\": bucket_name\n        }\n        response: CreateBucketOutputTypeDef = await client.create_bucket(**request_params)\n        print(f\"Bucket '{bucket_name}' created: {response}\")\n        return response\n\nasync def main():\n    # Replace with a unique bucket name, AWS credentials must be configured\n    await create_s3_bucket(\"my-unique-test-bucket-12345\")\n\nif __name__ == \"__main__\":\n    # Make sure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set in your environment\n    # or ~/.aws/credentials is configured.\n    asyncio.run(main())\n","lang":"python","description":"This example demonstrates how to use `aiobotocore` with `types-aiobotocore-lite` installed. The type hints for `S3Client`, `CreateBucketRequestRequestTypeDef`, and `CreateBucketOutputTypeDef` are provided by the stub package. To verify type checking, run `mypy your_script_name.py` after installing `aiobotocore` and `types-aiobotocore-lite`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support has been removed in versions generated by mypy-boto3-builder 8.12.0 and newer. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder >= 8.12.0)"},{"fix":"Migrate your code to use the `pinpoint-sms-voice` client and types.","message":"The `sms-voice` service is no longer supported and has been removed from generated packages. Use `pinpoint-sms-voice` instead.","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder >= 8.11.0)"},{"fix":"Update your TypeDef imports and usage to reflect the new naming conventions, or pin to an older `types-aiobotocore-lite` version if backward compatibility is critical.","message":"TypeDef naming conventions changed in builder 8.9.0, leading to shorter names for packed method arguments and reordered postfixes for conflicting TypeDefs (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder >= 8.9.0)"},{"fix":"Always install `types-aiobotocore-lite` that matches the major.minor version of your `aiobotocore` installation (e.g., `types-aiobotocore-lite==3.4.*` for `aiobotocore==3.4.*`).","message":"It is crucial to keep the `types-aiobotocore-lite` version aligned with the `aiobotocore` version you are using. Mismatched versions can lead to incorrect type hints or `mypy` errors.","severity":"gotcha","affected_versions":"all"},{"fix":"If `mypy` reports missing types for a specific service, consider installing the full `types-aiobotocore` or the specific service stub: `pip install types-aiobotocore` or `pip install types-aiobotocore-<service>`.","message":"`types-aiobotocore-lite` provides type stubs for a *subset* of commonly used AWS services. If you require type hints for a less common service not included in the 'lite' package, you may need to install the full `types-aiobotocore` package or the individual service stub package (e.g., `types-aiobotocore-rekognition`).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure `types-aiobotocore-lite` (or `types-aiobotocore`) is installed and that its version is compatible with your `aiobotocore` version. Mypy should then automatically find the stubs.","cause":"The type stubs for aiobotocore are not installed or are not being picked up by Mypy.","error":"error: Missing type parameters for generic type \"Client\" [type-arg]"},{"fix":"Consult the `aiobotocore` (or Boto3) documentation for the correct method names and parameters for the AWS service you are interacting with.","cause":"Attempting to call a method on an aiobotocore client that does not exist for that specific service, or a typo in the method name. This error indicates that the type stubs are correctly catching potential runtime issues.","error":"error: \"Client\" has no attribute \"non_existent_method\" [attr-defined]"},{"fix":"Your runtime imports should always come from `aiobotocore` (e.g., `from aiobotocore.session import get_session`). If you need specific type definitions (like `S3Client` for type-checking annotations), wrap them in a `if TYPE_CHECKING:` block, as shown in the quickstart, to prevent runtime import errors.","cause":"You are trying to import directly from a `types-aiobotocore-lite` specific module at runtime. Type stub packages are not meant for direct runtime imports; they provide `.pyi` files for type checkers.","error":"ModuleNotFoundError: No module named 'types_aiobotocore_s3_lite'"}]}