mypy-boto3 Type Stubs for RTBFabric
mypy-boto3-rtbfabric provides type annotations for the `boto3` RTBFabric service, enabling static type checking for AWS SDK operations. It is generated by the `mypy-boto3-builder` project. The current version is 1.42.88, with frequent releases often multiple times a month, synchronized with upstream `boto3` API changes and `mypy-boto3-builder` updates.
Warnings
- breaking Starting with `mypy-boto3-builder` version 8.12.0 (and consequently `mypy-boto3` packages), Python 3.8 is no longer supported. Ensure your project uses Python 3.9 or newer.
- breaking In `mypy-boto3-builder` version 8.9.0, there were breaking changes to `TypeDef` naming conventions. Request type definitions became shorter (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This might affect custom type hints based on older `TypeDef` names.
- gotcha This package (`mypy-boto3-rtbfabric`) provides only type stubs. It does not include the actual `boto3` runtime library. You must install `boto3` separately for your application to function at runtime.
- gotcha To benefit from these type stubs, you need a static type checker like `mypy` configured in your development environment. Without running a type checker, the stubs have no effect on runtime behavior.
- deprecated The `sms-voice` service was deprecated and removed from `mypy-boto3` (and `boto3`) starting with builder version 8.11.0. Users should migrate to the `pinpoint-sms-voice` service instead.
Install
-
pip install mypy-boto3-rtbfabric boto3 -
pip install mypy-boto3-rtbfabric
Imports
- RTBFabricClient
from mypy_boto3_rtbfabric import RTBFabricClient
- ListProfilesResponseTypeDef
from mypy_boto3_rtbfabric.type_defs import ListProfilesResponseTypeDef
- ListProfilesPaginator
from mypy_boto3_rtbfabric.paginator import ListProfilesPaginator
Quickstart
import boto3
from mypy_boto3_rtbfabric import RTBFabricClient
from mypy_boto3_rtbfabric.type_defs import ResponseMetadataTypeDef # Using a common base TypeDef for demo
# Initialize the boto3 client with type hints
# The 'rtbfabric' service might be an internal or less common AWS service.
# Replace with your actual service details and methods if available.
client: RTBFabricClient = boto3.client("rtbfabric")
# Call a hypothetical API method and type-hint its response.
# This demonstrates how type stubs enable static analysis for your boto3 calls.
print("Attempting to call a hypothetical RTBFabric method (e.g., list_profiles)...")
try:
# Actual method names and TypeDefs depend on the RTBFabric service API.
# Using get_paginator('list_profiles') as a plausible example of stub interaction.
paginator = client.get_paginator("list_profiles")
# The paginate() method typically returns a generator of response dicts.
# For simplicity, we'll just demonstrate the client's type-hinted methods.
response_meta: ResponseMetadataTypeDef = client.list_tags_for_resource(ResourceArn="dummy-arn")["ResponseMetadata"]
print(f"Successfully interacted with RTBFabric client. Status Code: {response_meta['HTTPStatusCode']}")
except client.exceptions.RTBFabricException as e:
print(f"RTBFabric specific exception caught: {e} (Expected if service is not configured or method is unknown).")
except Exception as e:
print(f"Generic exception caught: {e} (Expected if service or method is unavailable).")
print("\nClient methods available (demonstration of type-hinted access):")
# dir(client) will show many methods, demonstrating the stubs are active
print(f"Client methods (first 5): {dir(client)[10:15]}")