mypy-boto3-autoscaling-plans Type Annotations

1.42.3 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the `AutoScalingPlansClient` type for static analysis. It shows the creation of a typed boto3 client and a simple call to `describe_scaling_plans`, benefiting from type hints for parameters and return values.

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}")

view raw JSON →