mypy-boto3 Chime SDK Identity Stubs
mypy-boto3-chime-sdk-identity is a type annotation package for the boto3 Chime SDK Identity service, currently at version 1.42.3. It provides comprehensive type hints for boto3 clients, resources, paginators, and waiters, enhancing developer experience with static analysis tools like mypy, PyCharm, and VSCode by enabling better autocomplete and compile-time error checking. The library follows a continuous release cadence, closely mirroring boto3 updates, and is generated by the mypy-boto3-builder.
Warnings
- breaking Starting with `mypy-boto3-builder` version 8.12.0, Python 3.8 is no longer supported for any generated `mypy-boto3` package. This package specifically requires Python >=3.9.
- breaking `mypy-boto3-builder` version 8.12.0 migrated all packages to follow PEP 561 standards. This primarily affects how type checkers resolve modules, potentially changing behavior if you relied on older resolution methods.
- breaking Builder version 8.9.0 introduced breaking changes to TypeDef naming conventions. Method argument TypeDefs may have shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and `Extra` postfixes in conflicting TypeDefs were moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).
- gotcha This package provides *type stubs* for `boto3`. For your Python code to run and interact with AWS, the `boto3` library itself must be installed in your environment alongside these stubs.
- gotcha PyCharm users might experience slow performance or high CPU usage due to how it handles `Literal` overloads (PyCharm issue PY-40997).
Install
-
pip install mypy-boto3-chime-sdk-identity boto3
Imports
- ChimeSDKIdentityClient
from mypy_boto3_chime_sdk_identity.client import ChimeSDKIdentityClient
- ListAppInstancesResponseTypeDef
from mypy_boto3_chime_sdk_identity.type_defs import ListAppInstancesResponseTypeDef
Quickstart
import boto3
from mypy_boto3_chime_sdk_identity.client import ChimeSDKIdentityClient
from mypy_boto3_chime_sdk_identity.type_defs import ListAppInstancesResponseTypeDef
import os
# Ensure boto3 is configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars)
# For a runnable example, these might be placeholders or rely on default AWS config
# client: ChimeSDKIdentityClient = boto3.client(
# "chime-sdk-identity",
# region_name=os.environ.get('AWS_REGION', 'us-east-1')
# )
# Type-hinted client
client: ChimeSDKIdentityClient = boto3.client(
"chime-sdk-identity",
region_name="us-east-1" # Replace with your desired region
)
try:
# Use the client with type hints for methods and arguments
response: ListAppInstancesResponseTypeDef = client.list_app_instances(
MaxResults=5
)
print("Successfully listed App Instances:")
for app_instance in response.get('AppInstances', []):
print(f" - AppInstanceArn: {app_instance['AppInstanceArn']}")
print(f" Name: {app_instance['Name']}")
except client.exceptions.NotFoundException as e:
print(f"Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")