Type Annotations for boto3 CloudWatch Internet Monitor
mypy-boto3-internetmonitor provides comprehensive type annotations for the boto3 CloudWatch Internet Monitor service (version 1.42.3). Generated with mypy-boto3-builder 8.12.0, these stubs enhance development with static type checking, improved code completion, and refactoring capabilities for boto3 users across various IDEs like VSCode, PyCharm, Emacs, and Sublime Text, and type checkers such as mypy and pyright. The library is actively maintained, with updates released in sync with boto3 versions.
Warnings
- breaking mypy-boto3-builder (which generates this package) removed support for Python 3.8 in version 8.12.0. If you are using `mypy-boto3-internetmonitor 1.42.3` or newer, Python 3.8 is no longer supported.
- breaking The project migrated to PEP 561 compliant packages with `mypy-boto3-builder 8.12.0`. This might affect how type checkers or build systems locate and use stub files if they relied on older, non-PEP 561 patterns.
- breaking TypeDefs for packed method arguments now use shorter names, and conflicting TypeDef 'Extra' postfixes were moved to the end with `mypy-boto3-builder 8.9.0`. This could break existing type hints if you explicitly imported and used these TypeDefs by their old names.
- gotcha Some IDEs (e.g., VSCode, older PyCharm versions) may require explicit type annotations for `boto3.client()` or `session.client()` calls to provide full autocomplete and type checking, even if `mypy` or `pyright` can infer types implicitly. This is due to limitations in IDE language server support for complex overloads.
- gotcha When using `TYPE_CHECKING` for conditional imports to avoid runtime dependency on stubs, Pylint might report 'undefined variable' errors. This is a known issue with Pylint's handling of conditional typing.
Install
-
pip install mypy-boto3-internetmonitor -
pip install 'boto3-stubs[internetmonitor]'
Imports
- InternetMonitorClient
from mypy_boto3_internetmonitor.client import InternetMonitorClient
- ListMonitorsPaginator
from mypy_boto3_internetmonitor.paginator import ListMonitorsPaginator
- AvailabilityMeasurementTypeDef
from mypy_boto3_internetmonitor.type_defs import AvailabilityMeasurementTypeDef
- HealthEventImpactTypeType
from mypy_boto3_internetmonitor.literals import HealthEventImpactTypeType
Quickstart
import boto3
from mypy_boto3_internetmonitor.client import InternetMonitorClient
def get_internetmonitor_client() -> InternetMonitorClient:
client: InternetMonitorClient = boto3.client("internetmonitor")
return client
# Example usage
internetmonitor_client = get_internetmonitor_client()
response = internetmonitor_client.list_monitors()
print(f"Monitor summaries: {response.get('Monitors')}")