Registry / type-stubs / mypy-boto3-controltower

mypy-boto3-controltower

JSON →
library1.43.0pypypi✓ verified 22d ago

mypy-boto3-controltower provides comprehensive type annotations for the `boto3` AWS Control Tower service client. It enhances the development experience by enabling static type checking with tools like `mypy` for `boto3` operations, catching potential errors at development time. This package provides stubs for `boto3` version 1.42.3 and is part of the `mypy-boto3-builder` ecosystem, which actively generates stubs for all `boto3` services. It is actively maintained with frequent updates reflecting `boto3` changes.

pip install mypy-boto3-controltower boto3
INSTALL
IMPORT
SIG · MYPY-BOTO3-CONTROL
M
mypy-boto3-controltower
type-stubspythonv1.43.0
Install
3.8s avg
Import
582ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.604s · 52MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.8s · import 0.560s · 52MB
50MB installed
● package 50MB
Code
Verified usage

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

ControlTowerClient
from mypy_boto3_controltower.client import ControlTowerClient
Use this for explicit type hinting of the Control Tower client returned by boto3.client("controltower").
ListControlTowerResourcesOutputTypeDef
from mypy_boto3_controltower.type_defs import ListControlTowerResourcesOutputTypeDef
Use this for explicit type hinting of Control Tower service response objects or method parameters.

Demonstrates how to obtain a type-hinted Control Tower client and use it to list resources. This setup allows `mypy` and other type checkers to perform static analysis on your `boto3` Control Tower code, catching potential errors at development time.

import boto3 from mypy_boto3_controltower.client import ControlTowerClient from mypy_boto3_controltower.type_defs import ListControlTowerResourcesOutputTypeDef # Get a typed client for Control Tower # Ensure AWS credentials are configured (e.g., via ~/.aws/credentials or environment variables) # For local testing, ensure your default region is set. client: ControlTowerClient = boto3.client("controltower") # Example: List Control Tower resources with type hints try: print("Attempting to list Control Tower resources...") response: ListControlTowerResourcesOutputTypeDef = client.list_control_tower_resources( # You can add filters or pagination parameters here if needed # max_results=5 ) resources = response.get('controlTowerResources', []) if resources: print(f"Found {len(resources)} Control Tower resources:") for resource in resources: print(f" - ARN: {resource.get('arn')}, Type: {resource.get('resourceType')}") else: print("No Control Tower resources found or access is restricted.") except client.exceptions.AccessDeniedException: print("Access Denied: Ensure your AWS credentials have sufficient permissions for Control Tower (e.g., 'controltower:ListControlTowerResources').") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingSupport for Python 3.8 was removed starting with version 8.12.0 of `mypy-boto3-builder` (which this package is part of).
fix
Upgrade your Python environment to 3.9 or newer. If you must use Python 3.8, pin `mypy-boto3-*` packages to versions prior to 8.12.0.
affects: >=8.12.0
breakingVersion 8.9.0 introduced breaking changes to `TypeDef` naming conventions across services (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef` by removing redundant `Request` postfix).
fix
Review and update explicit `TypeDef` imports and usage in your codebase to match the new, shorter naming conventions, especially for request/response payloads.
affects: >=8.9.0
gotchaThese `mypy-boto3-*` packages provide only type annotations and do not add any runtime functionality to `boto3`. They are solely for static analysis tools like `mypy`.
fix
Always install `boto3` alongside `mypy-boto3-controltower`. Do not attempt to import or use `mypy_boto3_controltower` directly for runtime operations; instead, use `boto3.client('controltower')` and rely on the installed stubs for type checking.
affects: all
gotchaAWS service names can change or be deprecated (e.g., `sms-voice` changed to `pinpoint-sms-voice` in a previous release). Ensure you are using the correct and current service name string for `boto3.client()`.
fix
Refer to the official `boto3` documentation for the most up-to-date service names and API methods. If a service name or its API changes, update your `boto3.client()` calls and potentially your `mypy-boto3-*` package version.
affects: all
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRuntime library for AWS SDK client operations, type hints are applied to its objects.
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
mypy-boto3-controltower — pip install mypy-boto3-controltower · libregistry