{"id":3028,"library":"mypy-boto3-autoscaling","title":"Type annotations for boto3 AutoScaling","description":"mypy-boto3-autoscaling provides comprehensive type annotations (stubs) for the boto3 AutoScaling service. It enables static type checking for your boto3 code using tools like mypy, catching potential errors at development time. The current version is 1.42.79, and it's part of the frequently updated mypy-boto3-builder ecosystem, with releases typically aligning with new boto3/botocore versions.","status":"active","version":"1.42.79","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","typing","mypy","stubs","autoscaling","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-autoscaling boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Provides the underlying AWS SDK runtime. mypy-boto3-autoscaling provides type stubs for boto3's AutoScaling client, but does not include the boto3 library itself. While `botocore` is a direct dependency of the stub package, users generally interact with `boto3`.","package":"boto3","optional":false},{"reason":"Required for some advanced type features on older Python versions (e.g., Python 3.9, 3.10) but not strictly for Python 3.11+ due to built-in features.","package":"typing-extensions","optional":true}],"imports":[{"symbol":"AutoScalingClient","correct":"from mypy_boto3_autoscaling.client import AutoScalingClient"},{"symbol":"DescribeAutoScalingGroupsResponseTypeDef","correct":"from mypy_boto3_autoscaling.type_defs import DescribeAutoScalingGroupsResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_autoscaling.client import AutoScalingClient\nfrom mypy_boto3_autoscaling.type_defs import DescribeAutoScalingGroupsResponseTypeDef\nimport os\n\n# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION\n# or AWS CLI config files.\n# Using os.environ.get for demonstration purposes, actual credentials should be handled securely.\n\n# Instantiate the AutoScaling client with type hints\nclient: AutoScalingClient = boto3.client(\"autoscaling\", region_name=os.environ.get('AWS_REGION', 'us-east-1'))\n\ntry:\n    # Call a method and apply type hints for the response\n    response: DescribeAutoScalingGroupsResponseTypeDef = client.describe_auto_scaling_groups()\n\n    print(f\"Found {len(response['AutoScalingGroups'])} Auto Scaling Groups:\")\n    for group in response['AutoScalingGroups']:\n        print(f\"  - {group['AutoScalingGroupName']} (Min: {group['MinSize']}, Max: {group['MaxSize']})\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize an AutoScaling client with type hints provided by `mypy-boto3-autoscaling` and make a basic API call, ensuring that the client and response objects are correctly typed for static analysis."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. The minimum required Python version is now 3.9.","message":"Python 3.8 is no longer supported. Releases of `mypy-boto3-builder` version 8.12.0 and later (which this package relies on) removed support for Python 3.8.","severity":"breaking","affected_versions":"mypy-boto3-autoscaling versions built with mypy-boto3-builder 8.12.0+ (e.g., 1.42.79+)"},{"fix":"Review your code for direct references to TypeDef names and update them according to the new naming conventions. This primarily affects users who directly import and use these specific TypeDefs.","message":"Specific TypeDef names used in method arguments or for conflicting types were changed for brevity and consistency. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef` and `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`.","severity":"breaking","affected_versions":"mypy-boto3-autoscaling versions built with mypy-boto3-builder 8.9.0+"},{"fix":"Always install `boto3` alongside `mypy-boto3-autoscaling` (e.g., `pip install boto3 mypy-boto3-autoscaling`).","message":"While `mypy-boto3-autoscaling` lists `botocore` as a dependency, it only provides type stubs. You still need to install `boto3` (which includes `botocore`) separately for the actual runtime functionality of the AWS SDK. The stub package does not provide the SDK implementation.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Try to keep `mypy-boto3-autoscaling` and `boto3` versions as closely aligned as possible. Refer to the `mypy-boto3-builder` GitHub releases to see which `boto3`/`botocore` versions are targeted by a given stub release.","message":"Using mismatched versions of `mypy-boto3-autoscaling` and `boto3` (or `botocore`) can lead to incorrect type hints or runtime errors. The stub package is generated against a specific version of `boto3`'s API.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}