{"id":5137,"library":"boto3-stubs-full","title":"boto3-stubs-full","description":"boto3-stubs-full provides comprehensive type annotations (stubs) for the dynamically typed boto3 library, enhancing static analysis, IDE autocompletion, and early error detection for AWS Python development. It is generated by `mypy-boto3-builder` and currently supports boto3 version 1.42.88. The project maintains an active release cadence, typically aligning with boto3 updates.","status":"active","version":"1.42.88","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","typing","stubs","mypy","type-checking"],"install":[{"cmd":"pip install boto3 boto3-stubs-full","lang":"bash","label":"Install boto3 with full stubs"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed to run your code.","package":"boto3","optional":false},{"reason":"Core dependency for boto3 stubs.","package":"botocore-stubs","optional":false},{"reason":"Core dependency for boto3 stubs related to S3 transfer.","package":"types-s3transfer","optional":false},{"reason":"Provides backported typing features for broader Python version compatibility.","package":"typing-extensions","optional":false}],"imports":[{"note":"boto3-stubs-full provides type hints; at runtime, you import boto3 as usual.","symbol":"boto3","correct":"import boto3"},{"note":"For explicit type annotations in type-checking contexts, import specific client types from `mypy_boto3_*` sub-packages. Avoid `BaseClient` as it lacks service-specific details.","wrong":"from botocore.client import BaseClient","symbol":"S3Client","correct":"from typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_s3.client import S3Client"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\nimport os\n\n# Boto3-stubs-full enhances type checking for standard boto3 usage.\n# For explicit type annotations, import service clients within a TYPE_CHECKING block.\nif TYPE_CHECKING:\n    from mypy_boto3_s3.client import S3Client\n\ndef list_s3_buckets(region: str) -> None:\n    # Initialize an S3 client. IDEs and type checkers will recognize the type\n    # even without explicit type hints if boto3-stubs-full is installed.\n    s3_client: S3Client = boto3.client('s3', region_name=region)\n\n    print(f\"Listing S3 buckets in {region}:\")\n    try:\n        response = s3_client.list_buckets()\n        for bucket in response.get('Buckets', []):\n            print(f\"- {bucket['Name']}\")\n    except Exception as e:\n        print(f\"Error listing buckets: {e}\")\n\nif __name__ == \"__main__\":\n    aws_region = os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')\n    list_s3_buckets(aws_region)","lang":"python","description":"This quickstart demonstrates using `boto3-stubs-full` with a standard boto3 S3 client. After installing `boto3-stubs-full`, your IDE and static type checkers like MyPy will automatically provide type hints for `boto3` calls. For explicit type annotations, `mypy_boto3_s3.client.S3Client` is imported conditionally for type-checking only."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher, or explicitly specify an older `boto3-stubs-full` version (e.g., `<8.12.0`).","message":"Python 3.8 support has been removed. Projects using Python 3.8 must either upgrade Python or pin `boto3-stubs-full` to a version prior to 8.12.0.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Migrate your code to use the `pinpoint-sms-voice` service client instead of `sms-voice`.","message":"The `sms-voice` service is no longer supported and has been removed. Use `pinpoint-sms-voice` instead.","severity":"breaking","affected_versions":">=8.11.0"},{"fix":"Update your code to reflect the new `TypeDef` naming conventions as indicated by your type checker.","message":"Breaking changes were introduced to `TypeDef` naming conventions. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":">=8.9.0"},{"fix":"Always install `boto3-stubs-full` with a version compatible with your `boto3` installation, ideally by matching their major and minor versions (e.g., `pip install 'boto3==1.28.x' 'boto3-stubs-full==1.28.x'`).","message":"Mismatched versions between `boto3` and `boto3-stubs-full` can lead to incorrect or missing type hints. The `boto3-stubs` project generally aims to keep pace with `boto3` releases.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For PyCharm, consider `pip install boto3-stubs-lite` or disable PyCharm's built-in type checker and use `mypy` or `pyright` externally.","message":"PyCharm users may experience slow performance or high CPU usage due to `Literal` overloads. It is recommended to use `boto3-stubs-lite` or an external type checker (like MyPy or Pyright) with PyCharm's type checker disabled.","severity":"gotcha","affected_versions":"All versions with PyCharm"},{"fix":"Always use `from typing import TYPE_CHECKING` and `if TYPE_CHECKING: ...` for explicit type imports to ensure they are only processed by type checkers.","message":"When importing specific `mypy_boto3_*` types (e.g., `from mypy_boto3_s3.client import S3Client`), it is best practice to wrap these imports within an `if TYPE_CHECKING:` block. Failing to do so can make the stubs an unnecessary runtime dependency, potentially leading to circular import issues or larger deployment sizes.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}