mypy-boto3-autoscaling-plans Type Annotations
This library provides PEP 561 compliant type annotations for the boto3 AutoScalingPlans service. It enhances static analysis for boto3 users, allowing tools like MyPy to catch type-related errors before runtime. The current version is 1.42.3, which corresponds to boto3 1.42.3, and it receives frequent updates in sync with boto3 releases and the underlying mypy-boto3-builder project.
Warnings
- breaking Starting with `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-autoscaling-plans 1.42.3`), Python 3.8 is no longer supported for any `mypy-boto3` stub packages.
- gotcha These packages provide type stubs, not the actual runtime. You must have `boto3` installed alongside `mypy-boto3-autoscaling-plans` for your application to run.
- gotcha For accurate type checking, the minor version of `mypy-boto3-autoscaling-plans` should match your `boto3` runtime version. Significant mismatches can lead to incorrect type hints or missing attributes.
- breaking The `mypy-boto3-builder` (which this package is based on) changed TypeDef naming conventions in version 8.9.0. If upgrading from very old `mypy-boto3` versions, custom TypeDef imports might break.
Install
-
pip install boto3 mypy-boto3-autoscaling-plans
Imports
- AutoScalingPlansClient
from mypy_boto3_autoscaling_plans import AutoScalingPlansClient
- AutoScalingPlansServiceName
from mypy_boto3_autoscaling_plans import AutoScalingPlansServiceName
- DescribeScalingPlansOutputTypeDef
from mypy_boto3_autoscaling_plans.type_defs import DescribeScalingPlansOutputTypeDef
Quickstart
import boto3
from mypy_boto3_autoscaling_plans import AutoScalingPlansClient
# Initialize a typed boto3 client for Auto Scaling Plans
client: AutoScalingPlansClient = boto3.client("autoscaling-plans")
try:
# Example: List existing scaling plans
response = client.describe_scaling_plans(
ScalingPlanNames=['my-scaling-plan'],
MaxResults=5
)
print(f"Found {len(response.get('ScalingPlans', []))} scaling plans.")
for plan in response.get('ScalingPlans', []):
print(f" - Plan Name: {plan['ScalingPlanName']}")
except Exception as e:
print(f"Error describing scaling plans: {e}")