mypy-boto3-cloudwatch provides type annotations for the `boto3` CloudWatch service, generated by `mypy-boto3-builder`. It enhances development with static type checking, autocompletion, and bug detection for `boto3` CloudWatch clients. The library is actively maintained with frequent updates to align with new `boto3` versions.
pip install mypy-boto3-cloudwatch boto3Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate a `boto3` CloudWatch client with explicit type hints from `mypy-boto3-cloudwatch` and how to use a generated TypeDef for a method's input parameters.
Upgrade your Python environment to 3.9+.
Ensure you `pip install mypy-boto3-cloudwatch` directly. If you were using `boto3-stubs[cloudwatch]`, switch to the direct package.
Review your TypeDef imports and usages, adjusting names according to the new conventions.
Ensure `boto3` is installed in your environment: `pip install boto3`.
Consider simplifying your type hinting where auto-discovery works, but explicit imports provide the most robust type checking.
Wrap type-specific imports with `from typing import TYPE_CHECKING` and define runtime fallbacks: `if TYPE_CHECKING: from mypy_boto3_cloudwatch.client import CloudWatchClient else: CloudWatchClient = object`.