mypy-boto3-proton Type Stubs

1.42.3 · active · verified Sat Apr 11

Type annotations for boto3 Proton 1.42.3 service generated with mypy-boto3-builder 8.12.0. This library provides type stubs, not the actual `boto3` implementation, to enable static type checking for AWS Proton operations. It is frequently updated to align with `boto3` and `botocore` releases, often multiple times a month.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `boto3` client and apply `mypy-boto3-proton` type hints to enable static analysis for AWS Proton operations, then lists environments.

import boto3
from mypy_boto3_proton.client import ProtonClient
from mypy_boto3_proton.type_defs import ListEnvironmentsOutputTypeDef

# Ensure boto3 is installed: pip install boto3
# Ensure stubs are installed: pip install mypy-boto3-proton

def get_proton_environments(client: ProtonClient) -> ListEnvironmentsOutputTypeDef:
    """Lists Proton environments using a type-hinted client."""
    response = client.list_environments()
    return response

if __name__ == "__main__":
    # Initialize a boto3 client (region may vary)
    # Use a region where Proton is available, e.g., 'us-west-2'
    boto3_client = boto3.client("proton", region_name="us-west-2")

    # Type-hint the boto3 client with mypy-boto3-proton's Client
    proton_client: ProtonClient = boto3_client

    print("Listing Proton environments:")
    try:
        environments_data = get_proton_environments(proton_client)
        for env in environments_data.get("environments", []):
            print(f"  Environment: {env['name']} ({env['arn']}) - {env['provisioning']}")
    except Exception as e:
        print(f"An error occurred: {e}")
        print("Please ensure you have AWS credentials configured and Proton is available in 'us-west-2'.")

view raw JSON →