Registry / type-stubs / mypy-boto3-directconnect

mypy-boto3-directconnect

JSON →
library1.43.76pypypi✓ verified 23d ago

mypy-boto3-directconnect provides type annotations for the `boto3` AWS Direct Connect service client. It ensures type-safe usage of `boto3` calls related to Direct Connect in Python projects, catching potential errors during static analysis with `mypy`. The current version is `1.42.3`, and it's released in conjunction with `boto3` updates and `mypy-boto3-builder` enhancements.

pip install mypy-boto3-directconnect boto3 mypy
INSTALL
IMPORT
SIG · MYPY-BOTO3-DIRECTC
M
mypy-boto3-directconnect
type-stubspythonv1.43.76
Install
6.1s avg
Import
623ms
Disk
114MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.76 · 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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.650s · 116.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 6.1s · import 0.596s · 114MB
114MB installed
● package 114MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DirectConnectClient
from mypy_boto3_directconnect import DirectConnectClient
from mypy_boto3_directconnect.client import DirectConnectClient
While `client` submodule import works, the top-level package import is idiomatic for the main client type.
DescribeConnectionsPaginator
from mypy_boto3_directconnect.paginator import DescribeConnectionsPaginator
ConnectionStatusType
from mypy_boto3_directconnect.type_defs import ConnectionStatusType

This quickstart demonstrates how to use `mypy-boto3-directconnect` to add type hints to your `boto3` Direct Connect client. It shows how to import the `DirectConnectClient` type and apply it to a `boto3.client()` call, enabling `mypy` to validate your service interactions. It also includes an example of importing and using a specific `TypeDef` for enhanced type safety when accessing response data.

import boto3 from mypy_boto3_directconnect import DirectConnectClient from mypy_boto3_directconnect.type_defs import ConnectionTypePairTypeDef def list_direct_connect_connections() -> None: # Initialize the boto3 client with type hints client: DirectConnectClient = boto3.client('directconnect') print("Listing Direct Connect connections...") try: response = client.describe_connections() for connection in response.get('connections', []): print(f" Connection ID: {connection['connectionId']}") print(f" Connection Name: {connection['connectionName']}") print(f" Connection State: {connection['connectionState']}") if 'connectionType' in connection: # Example of using a TypedDict for a specific field type_info: ConnectionTypePairTypeDef = { 'connectionType': connection['connectionType'] } print(f" Connection Type: {type_info['connectionType']}") except Exception as e: print(f"Error listing connections: {e}") if __name__ == '__main__': list_direct_connect_connections()
Debug
Known issues
breakingPython 3.8 is no longer supported. `mypy-boto3-builder` version 8.12.0 and subsequent packages (including `mypy-boto3-directconnect`) require Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer. Ensure your CI/CD pipelines reflect this change.
affects: mypy-boto3-builder >= 8.12.0 and generated packages
breakingThe `mypy-boto3-builder` migrated to PEP 561 packages, which may affect how `mypy` discovers and uses the type stubs, especially for custom configurations.
fix
Verify your `mypy` configuration (e.g., `mypy_path`) is compatible with PEP 561 package discovery. In most standard setups, no manual changes should be required.
affects: mypy-boto3-builder >= 8.12.0 and generated packages
gotchaVersion mismatch between `boto3` and `mypy-boto3-*` stubs can lead to incorrect type checking or missing types. These packages are generated for specific `boto3` versions.
fix
Always install `mypy-boto3-directconnect` with a version that closely matches your `boto3` version. For example, if `boto3` is `1.26.x`, try `mypy-boto3-directconnect~=1.26.x`.
affects: All
gotchaService-specific TypedDict names were shortened or adjusted in `mypy-boto3-builder` 8.9.0 to avoid conflicts or reduce verbosity (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).
fix
If upgrading from older versions, review your code for explicit imports or usage of TypedDicts, especially for API request parameters, and update names if they changed for your service.
affects: mypy-boto3-builder >= 8.9.0 and generated packages
Upgrade
Version history
1.43.76latest on PyPI · released Aug 20, 2026
Audit
Dependencies
boto3requiredRuntime dependency for the AWS SDK functions being type-checked.
mypyrequiredRequired for static type checking.
typing-extensionsoptionalMay be a dependency for older Python versions, automatically managed by builder.
Agent activity
26 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
mypy-boto3-directconnect — pip install mypy-boto3-directconnect · libregistry