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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.598s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.554s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
IoTEventsClient
✓ from mypy_boto3_iotevents import IoTEventsClient
ListDetectorModelsResponseTypeDef
✓ from mypy_boto3_iotevents.type_defs import ListDetectorModelsResponseTypeDef
Type definitions for service responses are typically found in the `type_defs` submodule.
This quickstart demonstrates how to initialize a type-hinted boto3 IoTEvents client and make a simple API call. It shows how to import the specific client type and a response type definition for improved static analysis and IDE autocomplete. Ensure `boto3` is installed alongside `mypy-boto3-iotevents`.
import boto3
from mypy_boto3_iotevents import IoTEventsClient
from mypy_boto3_iotevents.type_defs import ListDetectorModelsResponseTypeDef
import os
def get_iotevents_client() -> IoTEventsClient:
"""Initializes and returns a type-hinted IoTEvents client."""
# AWS credentials are typically configured via environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
# or AWS CLI configuration.
# Using os.environ.get for example purposes; in production, boto3 handles credential resolution.
client: IoTEventsClient = boto3.client(
"iotevents",
region_name=os.environ.get('AWS_REGION', 'us-east-1')
)
return client
if __name__ == "__main__":
try:
iotevents_client = get_iotevents_client()
print("Successfully initialized IoTEvents client.")
# Example: List detector models with type-hinted response
response: ListDetectorModelsResponseTypeDef = iotevents_client.list_detector_models()
print(f"Found {len(response.get('detectorModelSummaries', []))} detector models.")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 should update their Python version or use an older version of `mypy-boto3-iotevents` if available.fixUpgrade to Python 3.9 or newer.
affects: >=8.12.0 of mypy-boto3-builder (which generates this package)
breakingIn `mypy-boto3-builder` version 8.9.0, some TypeDef names were shortened or reordered (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). While not specific to `iotevents`, this general change in naming conventions for packed method arguments can break existing type hints if specific TypeDefs are imported.fixReview your code for any explicit `TypeDef` imports and update names according to the latest definitions.
affects: >=8.9.0 of mypy-boto3-builder (which generates this package)
gotchaFor optimal type checking and IDE support (especially in VSCode and PyCharm), it is recommended to explicitly type annotate `boto3.client()` and `boto3.session.client()` calls with the imported client type (e.g., `client: IoTEventsClient = boto3.client("iotevents")`).fixAlways add explicit type annotations when creating boto3 clients or resources.
affects: All
gotchaThis package only provides type annotations. You must install the `boto3` library separately for your code to function at runtime.fixEnsure `boto3` is installed via `pip install boto3` alongside `mypy-boto3-iotevents`.
affects: All
gotchaPyCharm users might experience slow performance with `Literal` overloads (issue PY-40997). If this occurs, `boto3-stubs-lite` is suggested as a more RAM-friendly alternative (though it requires more explicit type annotations), or disabling PyCharm's type checker and relying on an external tool like MyPy or Pyright.fixConsider `boto3-stubs-lite`, an alternative type checker (MyPy/Pyright), or adjusting PyCharm's type checking settings.
affects: All, specifically PyCharm users
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for the boto3 library, which must be installed separately for runtime functionality.
mypyoptionalRequired for static type checking of Python code.
pyrightoptionalAlternative static type checker.