mypy-boto3-cleanrooms Type Stubs

1.42.52 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `boto3` CleanRooms client and perform a basic operation (`list_configured_tables`) with full type-hinting provided by `mypy-boto3-cleanrooms`. It highlights how `CleanRoomsClient` and `ListConfiguredTablesOutputTypeDef` enable static analysis and autocompletion.

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)

view raw JSON →