Registry /
type-stubs / mypy-boto3-codeconnections
Install & Compatibility
Where this runs
tested against v1.43.0 · 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 0.586s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.546s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CodeConnectionsClient
✓ from mypy_boto3_codeconnections.client import CodeConnectionsClient
The primary client interface for the CodeConnections service.
ListConnectionsOutputTypeDef
✓ from mypy_boto3_codeconnections.type_defs import ListConnectionsOutputTypeDef
Type definition for the output of the `list_connections` API call, enabling precise type checking of responses.
This quickstart demonstrates how to obtain a type-hinted `CodeConnectionsClient` and interact with it. It uses `TYPE_CHECKING` for conditional import and `cast` to inform the type checker, ensuring that your IDE provides correct auto-completion and static analysis while `boto3` handles the runtime. A dummy response is used to make the example runnable without actual AWS credentials.
import boto3
from typing import TYPE_CHECKING, cast
import os
if TYPE_CHECKING:
from mypy_boto3_codeconnections.client import CodeConnectionsClient
from mypy_boto3_codeconnections.type_defs import ListConnectionsOutputTypeDef
def get_codeconnections_client() -> "CodeConnectionsClient":
"""
Returns a type-hinted boto3 CodeConnections client.
"""
# In a real application, region_name might come from environment or config.
client = boto3.client("codeconnections", region_name=os.environ.get("AWS_REGION_NAME", "us-east-1"))
return cast("CodeConnectionsClient", client)
def list_all_connections():
"""
Lists all CodeConnections connections with type hints.
"""
client = get_codeconnections_client()
# In a live environment, this would be an actual API call:
# response: ListConnectionsOutputTypeDef = client.list_connections()
# For a runnable example, we use a dummy response matching the expected type.
response: "ListConnectionsOutputTypeDef" = {
"Connections": [
{
"ConnectionArn": "arn:aws:codeconnections:us-east-1:123456789012:connection/a1b2c3d4",
"ConnectionName": "my-github-connection",
"ProviderType": "GitHub",
"OwnerAccountId": "123456789012",
"ConnectionStatus": "AVAILABLE"
}
],
"NextToken": None
}
print("CodeConnections:")
for connection in response.get("Connections", []):
print(f" - Name: {connection['ConnectionName']}, ARN: {connection['ConnectionArn']}")
return response
if __name__ == '__main__':
# Set dummy environment variables for the example to run locally without actual AWS credentials.
# In a real scenario, boto3 would automatically pick these up or use IAM roles.
os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY')
os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET')
os.environ['AWS_REGION_NAME'] = os.environ.get('AWS_REGION_NAME', 'us-east-1')
list_all_connections()
Debug
Known issues
breakingAs of `mypy-boto3-builder` 8.12.0 (which generates this stub package), support for Python 3.8 has been removed. Ensure your projects use Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or a later version.
affects: mypy-boto3-builder >=8.12.0 (and generated stubs)
breakingThe `mypy-boto3-builder` (which generates these stubs) migrated to PEP 561 packages in version 8.12.0. While this generally improves stub discovery, it might require updates to custom build processes or `mypy` configurations that relied on older stub distribution methods.fixVerify `mypy` is correctly discovering the stubs; rebuild local stubs if using `mypy-boto3-builder` directly.
affects: mypy-boto3-builder >=8.12.0 (and generated stubs)
gotchaThis library provides *type stubs* for `boto3`, not the `boto3` library itself. You must install `boto3` separately (e.g., `pip install boto3`) for your code to run at runtime.fixAlways install `boto3` alongside `mypy-boto3-codeconnections` (e.g., `pip install boto3 mypy-boto3-codeconnections`).
affects: All versions
gotchaPrevious versions of `mypy-boto3-builder` (8.9.0) introduced breaking changes to TypeDef naming conventions (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). If upgrading from very old versions, check for such changes in generated type definitions.fixReview your code for TypeDef names and update them according to the new conventions, typically by removing redundant 'Request' or adjusting 'Extra' postfixes.
affects: mypy-boto3-builder >=8.9.0
gotchaPyCharm users might experience slow performance or high CPU usage due to an issue with Literal overloads (PY-40997). For better performance in PyCharm, `boto3-stubs-lite` is recommended as an alternative.fixConsider installing `boto3-stubs-lite[codeconnections]` instead of `mypy-boto3-codeconnections`, or disable PyCharm's type checker and rely solely on `mypy` for static analysis.
affects: All versions, specifically impacting PyCharm IDE users.
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the actual runtime functionality for interacting with AWS. `mypy-boto3-codeconnections` only provides type stubs for it.