mypy-boto3-cleanrooms Type Stubs
mypy-boto3-cleanrooms provides type annotations for the boto3 CleanRoomsService. It enhances development experience by offering static type checking, auto-completion, and improved error detection for AWS CleanRooms operations using boto3. This library is generated by `mypy-boto3-builder` and is currently at version 1.42.52, with updates typically aligning with boto3 releases.
Warnings
- breaking Python 3.8 support has been removed. All `mypy-boto3-*` packages, including `mypy-boto3-cleanrooms`, now require Python 3.9 or newer.
- breaking TypeDef naming conventions changed, shortening names (e.g., `CreateConfiguredTableRequestRequestTypeDef` to `CreateConfiguredTableInputRequestTypeDef`) and moving 'Extra' postfixes. This may break existing explicit type hints.
- gotcha This library provides only type stubs, not the runtime functionality of boto3. You must install `boto3` separately for your code to run.
- gotcha The `mypy-boto3-cleanrooms` version aligns with the `boto3` version it provides stubs for. Significant mismatches between your installed `boto3` version and `mypy-boto3-cleanrooms` version can lead to incorrect or missing type hints.
- gotcha The builder migrated to PEP 561 compliance, which typically improves type checker discovery but might affect custom build or packaging setups that relied on older stub discovery mechanisms.
Install
-
pip install mypy-boto3-cleanrooms boto3
Imports
- CleanRoomsClient
from mypy_boto3_cleanrooms.client import CleanRoomsClient
- CreateConfiguredTableInputRequestTypeDef
from mypy_boto3_cleanrooms.type_defs import CreateConfiguredTableInputRequestTypeDef
- Paginator
from mypy_boto3_cleanrooms.paginator import ListConfiguredTablesPaginator
- Waiter
from mypy_boto3_cleanrooms.waiter import ConfiguredTableReadyWaiter
Quickstart
import boto3
from mypy_boto3_cleanrooms.client import CleanRoomsClient
from mypy_boto3_cleanrooms.type_defs import ListConfiguredTablesOutputTypeDef
import os
# Initialize a CleanRooms client with type hints
cleanrooms_client: CleanRoomsClient = boto3.client(
"cleanrooms",
region_name=os.environ.get("AWS_REGION", "us-east-1")
)
# Use the client with type-checked parameters and responses
try:
response: ListConfiguredTablesOutputTypeDef = cleanrooms_client.list_configured_tables(
maxResults=10
)
print("Successfully listed configured tables:")
for table in response.get("configuredTableSummaries", []):
print(f" - {table['name']} ({table['id']})")
except Exception as e:
print(f"Error listing configured tables: {e}")
# Example of using a specific type definition for input
# from mypy_boto3_cleanrooms.type_defs import CreateConfiguredTableInputRequestTypeDef
# create_table_input: CreateConfiguredTableInputRequestTypeDef = {
# "name": "my-test-table",
# "description": "My configured table description",
# "tableReferences": [{"lambda": {...}}],
# "allowedColumns": ["id", "name"]
# }
# cleanrooms_client.create_configured_table(**create_table_input)