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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.9MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.4s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
EventBridgeClient
✓ from mypy_boto3_events import EventBridgeClient
✗ from mypy_boto3_events.client import EventBridgeClient
This quickstart demonstrates how to get a type-hinted EventBridge client and use a method with its corresponding TypeDefs. The `TYPE_CHECKING` block ensures that `mypy-boto3-events` is only a dev dependency. Note the explicit type annotation for `boto3.client` is often required for full IDE auto-completion.
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_events.client import EventBridgeClient
from mypy_boto3_events.type_defs import PutRuleResponseTypeDef, PutRuleRequestRequestTypeDef
def get_eventbridge_client() -> 'EventBridgeClient':
"""Initializes and returns a type-hinted EventBridge client."""
# boto3.client implicitly returns Any, mypy-boto3 provides the type stubs
client: EventBridgeClient = boto3.client('events')
return client
def put_example_rule():
client = get_eventbridge_client()
rule_params: PutRuleRequestRequestTypeDef = {
"Name": "MyTestRule",
"EventPattern": "{\"source\":[\"aws.ec2\"]}",
"State": "ENABLED"
}
response: PutRuleResponseTypeDef = client.put_rule(**rule_params)
print(f"Rule ARN: {response.get('RuleArn')}")
if __name__ == "__main__":
put_example_rule()
Debug
Known issues
breakingSupport for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequently across all generated `mypy-boto3-*` packages. Python 3.9 or higher is now required.fixUpgrade your Python environment to 3.9 or newer. If stuck on Python 3.8, pin `mypy-boto3-events` to a version older than 1.42.3 (e.g., `mypy-boto3-events<1.42.3`).
affects: >=8.12.0 of mypy-boto3-builder and derived packages
breakingThe project migrated to PEP 561 compliant packages in `mypy-boto3-builder` version 8.12.0. This change affects how type stubs are discovered and might require adjustments in some build systems or explicit `mypy` configurations.fixEnsure your `mypy` configuration (e.g., `pyproject.toml`) and environment are set up to correctly discover installed PEP 561 packages. For most users, this will work automatically with recent `mypy` versions.
affects: >=8.12.0 of mypy-boto3-builder and derived packages
breakingTypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`) in `mypy-boto3-builder` version 8.9.0. Conflicting TypeDefs also had their 'Extra' postfix moved to the end.fixUpdate any explicit imports or references to TypeDefs in your code to reflect the new naming conventions. Consult the specific service's documentation for the exact new names.
affects: >=8.9.0 of mypy-boto3-builder and derived packages
gotchaFor optimal auto-completion and type inference in some IDEs (e.g., VSCode) and type checkers, explicit type annotations for `boto3.client()`, `boto3.session.client()`, `client.get_waiter()`, and `client.get_paginator()` calls are often recommended, despite the stubs providing implicit discovery.fixExplicitly annotate the return type of `boto3.client('service')` with the corresponding `ServiceClient` type (e.g., `client: EventBridgeClient = boto3.client('events')`). affects: All versions
gotchaWhen using Pylint, it may report 'undefined variable' errors for type-hinted imports (e.g., `from mypy_boto3_events.client import EventBridgeClient`).fixWrap your `mypy-boto3` imports in a `if TYPE_CHECKING:` block and define placeholder `object` types for runtime when `TYPE_CHECKING` is false. This makes `mypy-boto3-events` a dev-only dependency and satisfies Pylint.
affects: All versions
gotchaService names within the `mypy-boto3` ecosystem can change (e.g., `sms-voice` became `pinpoint-sms-voice`). While not directly affecting `events` currently, this indicates a potential for future updates to require changes to import paths for specific services.fixRegularly check release notes for `mypy-boto3-builder` and `mypy-boto3-events` for any service name changes or package renames, and update import paths accordingly.
affects: All versions (ecosystem-wide)
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the underlying AWS SDK for Python that these stubs type-hint.
mypyoptionalStatic type checker to leverage the annotations.
pyrightoptionalAlternative static type checker to leverage the annotations.