mypy-boto3-devops-guru Type Stubs

1.42.3 · active · verified Sat Apr 11

mypy-boto3-devops-guru provides type annotations for the AWS boto3 DevOps Guru service, generated with mypy-boto3-builder. It enhances type checking for boto3 clients, resources, and various service-specific data structures. The current version is 1.42.3, and it follows a frequent release cadence, often aligning with new boto3 releases and updates to the mypy-boto3-builder.

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use the `DevOpsGuruClient` type stub with a boto3 client, and how to use a specific TypedDict for a response. This allows static type checkers like MyPy to validate client calls and response structures.

import boto3
from mypy_boto3_devops_guru import DevOpsGuruClient
from mypy_boto3_devops_guru.type_defs import DescribeAccountHealthResponseTypeDef

# Instantiate the boto3 client, typed with mypy-boto3 stubs
client: DevOpsGuruClient = boto3.client(
    "devops-guru", 
    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''),
    region_name=os.environ.get('AWS_REGION', 'us-east-1')
)

try:
    # Call a service method
    response: DescribeAccountHealthResponseTypeDef = client.describe_account_health()
    print(f"Account health details: {response}")
except Exception as e:
    print(f"Error describing account health: {e}")

view raw JSON →