mypy-boto3-iotwireless Type Annotations
mypy-boto3-iotwireless provides type annotations for the `boto3` IoTWireless service. It is generated by `mypy-boto3-builder` and enables static type checking with tools like MyPy, improved IDE autocompletion, and enhanced code navigation for `boto3` users. The current version is 1.42.3, typically released in sync with `boto3` updates.
Warnings
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0, affecting all generated packages including `mypy-boto3-iotwireless`. Users must upgrade to Python 3.9 or newer.
- breaking TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. This might affect existing code that relies on specific TypedDict names. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and the `Extra` postfix moved to the end.
- gotcha `mypy-boto3-iotwireless` is a stub-only package. For runtime functionality, the `boto3` library itself must be installed in your environment. These stubs provide type information only.
- gotcha When using standalone `mypy-boto3-` service packages, explicit type annotations are often required for `boto3.client()` or `session.client()` calls to ensure MyPy and IDEs correctly infer the specific client type (e.g., `client: IoTWirelessClient = boto3.client(...)`).
Install
-
pip install mypy-boto3-iotwireless
Imports
- IoTWirelessClient
from mypy_boto3_iotwireless.client import IoTWirelessClient
- IoTWirelessServiceResource
from mypy_boto3_iotwireless.service_resource import IoTWirelessServiceResource
- IoTWirelessTypeDef
from mypy_boto3_iotwireless.type_defs import <SomeIoTWirelessTypeDef>
- IoTWirelessLiterals
from mypy_boto3_iotwireless.literals import <SomeLiteral>
Quickstart
import boto3
from mypy_boto3_iotwireless.client import IoTWirelessClient
from mypy_boto3_iotwireless.type_defs import ListDestinationsResponseTypeDef
import os
def get_iotwireless_client() -> IoTWirelessClient:
# Using explicit type annotation for the client
client: IoTWirelessClient = boto3.client(
"iotwireless",
region_name=os.environ.get('AWS_REGION', 'us-east-1'),
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')
)
return client
if __name__ == "__main__":
client = get_iotwireless_client()
try:
# Example: Listing IoTWireless destinations with type-checked response
response: ListDestinationsResponseTypeDef = client.list_destinations(
MaxResults=10
)
print("Successfully listed IoTWireless destinations:")
for dest in response.get('DestinationList', []):
print(f" - Name: {dest.get('Name')}, ARN: {dest.get('Arn')}")
except Exception as e:
print(f"Error listing destinations: {e}")