mypy-boto3-codecatalyst Type Stubs

1.42.3 · active · verified Sat Apr 11

mypy-boto3-codecatalyst provides comprehensive type annotations for the AWS CodeCatalyst service within the `boto3` library. It enables static type checking with tools like MyPy, Pyright, and enhances IDE features like auto-completion and error detection for `boto3.client('codecatalyst')`. The library is actively maintained and generated with `mypy-boto3-builder`, following a frequent release cadence to align with `boto3` updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain a type-annotated `CodeCatalystClient` using `mypy-boto3-codecatalyst`. This enables full type checking and IDE assistance for all CodeCatalyst service operations.

import boto3
from boto3.session import Session
from mypy_boto3_codecatalyst import CodeCatalystClient
import os

# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# For a runnable example, we'll simulate an empty config if not set

# Explicitly set up a session for clarity, though boto3.client() uses a default session
session = Session(
    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),
    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),
    region_name=os.environ.get('AWS_REGION', 'us-east-1')
)

# Get a typed CodeCatalyst client
client: CodeCatalystClient = session.client("codecatalyst")

# Now, the 'client' object is fully type-checked by MyPy and provides IDE auto-completion
# For example, calling a method with incorrect arguments will be flagged.
# try:
#    response = client.list_dev_environments(InvalidArg=True) # This would be a type error
# except Exception as e:
#    print(f"Expected error: {e}")

response = client.list_dev_environments()
print(f"Successfully called list_dev_environments. Found {len(response.get('items', []))} dev environments.")

# Access type-safe response data
# if response['items']:
#     first_env_name = response['items'][0]['devEnvironmentName']

view raw JSON →