mypy-boto3-iam provides static type annotations for the boto3 IAM service client, resources, and related types. It enables type checking with tools like MyPy, Pyright, and enhances IDE auto-completion for `boto3.client('iam')` calls. Currently at version 1.42.64, it is part of the frequently updated `mypy-boto3-builder` ecosystem, with releases often tied to new boto3 versions.
pip install mypy-boto3-iamVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to obtain a type-hinted IAM client using `mypy-boto3-iam` and call a method like `get_account_summary`. The `TYPE_CHECKING` block ensures type imports are only active during type checking, avoiding runtime dependencies if desired. For full type coverage, ensure `boto3` is also installed in your environment.
Upgrade your Python environment to 3.9 or newer.
Update your custom type aliases or explicit type annotations to match the new naming conventions, or regenerate stubs if using `mypy-boto3-builder` locally.
Migrate any usage of `sms-voice` related stubs to `pinpoint-sms-voice` stubs.
Consider installing `boto3-stubs-lite[iam]` for improved performance in PyCharm, or configure PyCharm to use external type checkers like MyPy or Pyright.
Explicitly add type annotations, e.g., `client: IAMClient = session.client("iam")`.Use `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_iam.client import IAMClient` and define a fallback `IAMClient = object` for runtime.
Install the core boto3 library: 'pip install boto3'.
Install `boto3` explicitly (e.g., `pip install boto3`).