Install & Compatibility
Where this runs
tested against v1.43.79 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.352s · 118.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.2s · import 1.182s · 116MB
116MB installed
● package 116MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ConnectClient
✓ from mypy_boto3_connect import ConnectClient
ConnectServiceResource
✓ from mypy_boto3_connect import ConnectServiceResource
InstanceTypeDef
✓ from mypy_boto3_connect.type_defs import InstanceTypeDef
✗ from mypy_boto3_connect.client import InstanceTypeDef
Type definitions are typically found in the `type_defs` submodule, not directly in `client`.
This quickstart demonstrates how to import `ConnectClient` and use it to type-hint a `boto3` AWS Connect client. It shows an example of using type-hinted request parameters for `create_instance` and retrieving `InstanceTypeDef` from the response, leveraging the static type checking provided by `mypy-boto3-connect`.
import boto3
from mypy_boto3_connect import ConnectClient
from mypy_boto3_connect.type_defs import CreateInstanceRequestRequestTypeDef, InstanceTypeDef
# Instantiate the boto3 client and cast it to the Mypy-Boto3 type for type checking
connect_client: ConnectClient = boto3.client("connect")
# Example usage with type-hinted data
# Note: This is a placeholder; actual Connect operations might require more complex setup.
# Replace with actual data relevant to your AWS Connect instance.
create_instance_request: CreateInstanceRequestRequestTypeDef = {
"ClientToken": "example-token",
"IdentityManagementType": "SAML", # Other options: 'CONNECT_MANAGED', 'EXISTING_DIRECTORY'
"InstanceAlias": "my-test-instance-alias",
"DirectoryId": "dir-xxxxxxxx", # Required if IdentityManagementType is EXISTING_DIRECTORY
"InboundCallsEnabled": True,
"OutboundCallsEnabled": True
}
# The actual call might fail without correct setup, this demonstrates type usage
try:
# This call is illustrative for type checking, it will likely fail without a real setup.
response = connect_client.create_instance(
IdentityManagementType=create_instance_request["IdentityManagementType"],
InstanceAlias=create_instance_request["InstanceAlias"],
InboundCallsEnabled=create_instance_request["InboundCallsEnabled"],
OutboundCallsEnabled=create_instance_request["OutboundCallsEnabled"]
)
# The response object will also be type-hinted if Mypy is run
instance_summary: InstanceTypeDef = response["InstanceSummary"]
print(f"Instance created with ARN: {instance_summary['Arn']}")
except Exception as e:
print(f"Could not create instance (this is expected without a valid setup): {e}")
# Example of getting an existing instance (requires an actual instance ARN)
try:
# Replace with a real instance ARN if you want to test live
instance_id = "arn:aws:connect:REGION:ACCOUNT_ID:instance/INSTANCE_ID"
# This call is illustrative for type checking
response = connect_client.describe_instance(InstanceId=instance_id)
instance_summary: InstanceTypeDef = response['Instance']['InstanceSummary']
print(f"Described instance ID: {instance_summary['Id']}")
except connect_client.exceptions.ResourceNotFoundException:
print(f"Instance {instance_id} not found.")
except Exception as e:
print(f"Could not describe instance (this is expected without a valid ARN): {e}")
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. This affects all generated stubs, including `mypy-boto3-connect`. Ensure your project uses Python 3.9 or higher.fixUpgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >=8.12.0 (and dependent stubs)
breakingAll `mypy-boto3` packages, including `mypy-boto3-connect`, migrated to PEP 561 compliant packages in `mypy-boto3-builder` version 8.12.0. This might affect how some tools discover and use stubs, though `mypy` typically handles this gracefully.fixEnsure your type-checking environment (e.g., `mypy`) is up-to-date. No specific code changes are typically required unless you're using custom stub discovery.
affects: mypy-boto3-builder >=8.12.0 (and dependent stubs)
breakingIn `mypy-boto3-builder` version 8.9.0, TypeDef naming conventions changed for packed method arguments and conflicting names. TypeDefs like `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). While `mypy-boto3-connect` may not directly use these specific examples, similar renames could affect Connect-specific TypeDefs.fixReview your code for any explicit imports of TypeDefs. If you encounter `NameError` or type-checking issues with TypeDefs, consult the `mypy_boto3_connect.type_defs` module for the updated names.
affects: mypy-boto3-builder >=8.9.0 (and dependent stubs)
deprecatedThe `sms-voice` service was deprecated and removed from `mypy-boto3-builder` in version 8.11.0. Users should migrate to `pinpoint-sms-voice` instead. This is a general `mypy-boto3` warning, not directly affecting `mypy-boto3-connect`, but important for users of the overall `mypy-boto3` ecosystem.fixIf using SMS Voice, migrate to `mypy-boto3-pinpoint-sms-voice`.
affects: mypy-boto3-builder >=8.11.0
gotchaYou must install `boto3` alongside `mypy-boto3-connect`. `mypy-boto3-connect` only provides type stubs and does not include the runtime `boto3` library itself. Without `boto3`, your code will fail at runtime.fixEnsure `pip install boto3 mypy-boto3-connect` is run to install both the runtime library and its type stubs.
affects: All versions
Upgrade
Version history
1.43.79latest on PyPI · released Aug 24, 2026
Audit
Dependencies
boto3requiredThis library provides type stubs for boto3; boto3 itself is required for runtime functionality.
mypyoptionalmypy is the static type checker that utilizes these stubs for type validation.