{"id":901,"library":"mypy-boto3-iam","title":"mypy-boto3-iam Type Stubs","description":"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.","status":"active","version":"1.42.64","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","mypy","type-hints","aws","iam","stubs","type-checking"],"install":[{"cmd":"pip install mypy-boto3-iam","lang":"bash","label":"Standalone package"},{"cmd":"pip install 'boto3-stubs[iam]'","lang":"bash","label":"As an extra with boto3-stubs"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK, these are type stubs for it.","package":"boto3","optional":false},{"reason":"Required for static type checking; this package provides the type hints.","package":"mypy","optional":true},{"reason":"May be a dependency for older Python versions to backport typing features, automatically set by builder.","package":"typing-extensions","optional":true}],"imports":[{"wrong":"from mypy_boto3_iam import IAMClient","symbol":"IAMClient","correct":"from mypy_boto3_iam import IAMClient"},{"symbol":"IAMServiceResource","correct":"from mypy_boto3_iam import IAMServiceResource"},{"symbol":"ServiceResource","correct":"from mypy_boto3_iam import ServiceResource"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\n\nif TYPE_CHECKING:\n    from mypy_boto3_iam.client import IAMClient\n    from mypy_boto3_iam.type_defs import GetAccountSummaryResponseTypeDef\n\ndef get_iam_account_summary() -> 'GetAccountSummaryResponseTypeDef':\n    # The 'iam' client is type-hinted by mypy-boto3-iam after installation.\n    client: IAMClient = boto3.client(\"iam\")\n    summary = client.get_account_summary()\n    print(f\"IAM Account Summary: {summary['SummaryMap']}\")\n    return summary\n\nif __name__ == \"__main__\":\n    # Ensure AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN env vars or ~/.aws/credentials)\n    try:\n        get_iam_account_summary()\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 and subsequent generated packages, including `mypy-boto3-iam`. The minimum required Python version is now 3.9.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Update your custom type aliases or explicit type annotations to match the new naming conventions, or regenerate stubs if using `mypy-boto3-builder` locally.","message":"In `mypy-boto3-builder` version 8.9.0, type definition names for packed method arguments (`RequestRequestTypeDef` became `RequestTypeDef`) and conflicting `Extra` postfixes (`ExtraRequestTypeDef` became `RequestExtraTypeDef`) were changed. This may break existing type annotations.","severity":"breaking","affected_versions":">=8.9.0"},{"fix":"Migrate any usage of `sms-voice` related stubs to `pinpoint-sms-voice` stubs.","message":"The `sms-voice` service stubs were removed in `mypy-boto3-builder` version 8.11.0 because the service is no longer supported by AWS. Use `pinpoint-sms-voice` stubs instead. While not directly IAM, this indicates a broader trend in the `mypy-boto3` ecosystem.","severity":"deprecated","affected_versions":">=8.11.0"},{"fix":"Consider installing `boto3-stubs-lite[iam]` for improved performance in PyCharm, or configure PyCharm to use external type checkers like MyPy or Pyright.","message":"PyCharm users might experience slow performance or high CPU usage due to how PyCharm handles `Literal` overloads. It is recommended to use `boto3-stubs-lite` (e.g., `pip install 'boto3-stubs-lite[iam]'`) or disable PyCharm's type checker and rely on `mypy` or `pyright`.","severity":"gotcha","affected_versions":"all"},{"fix":"Explicitly add type annotations, e.g., `client: IAMClient = session.client(\"iam\")`.","message":"When using standalone packages like `mypy-boto3-iam` or `boto3-stubs-lite`, you might need to explicitly annotate the client, resource, waiter, or paginator variables for full type checking and IDE auto-completion, as automatic type inference for `session.client()` overloads is not always available.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_iam.client import IAMClient` and define a fallback `IAMClient = object` for runtime.","message":"When using `mypy-boto3-iam` or other `mypy-boto3` stubs in a production environment where you want to avoid installing the stubs at runtime, wrap your type imports in a `if TYPE_CHECKING:` block. This prevents unnecessary runtime dependencies but requires setting types to `object` outside of type checking for tools like Pylint.","severity":"gotcha","affected_versions":"all"},{"fix":"Install the core boto3 library: 'pip install boto3'.","message":"`mypy-boto3-iam` provides type stubs for `boto3`, but it does not install `boto3` itself. You must install `boto3` separately (e.g., `pip install boto3`) to use the library at runtime.","severity":"breaking","affected_versions":"all"},{"fix":"Install `boto3` explicitly (e.g., `pip install boto3`).","message":"`mypy-boto3-iam` provides type stubs for `boto3`, but it does not install `boto3` itself. You must install `boto3` separately (e.g., `pip install boto3`) for your application to run.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.42.64':47 'annot':14 'auto':38 'auto-complet':37 'aw':73 'boto3':3,9,17,57,66,68 'boto3.client':41 'builder':58 'call':43 'check':28,78 'client':20 'complet':39 'current':44 'ecosystem':59 'enabl':26 'enhanc':35 'frequent':53 'hint':72 'iam':4,10,18,42,74 'ide':36 'like':31 'mypi':2,8,32,56,69 'mypy-boto3-builder':55 'mypy-boto3-iam':1,7 'new':65 'often':62 'part':50 'provid':11 'pyright':33 'relat':23 'releas':61 'resourc':21 'servic':19 'static':12 'stub':6,75 'tie':63 'tool':30 'type':5,13,24,27,71,77 'type-check':76 'type-hint':70 'updat':54 'version':46,67","created_at":"2026-03-29T06:06:54.805491+00:00","updated_at":"2026-04-16T16:58:31.477740+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpai6i494_/venv/lib/python3.12/site-packages/mypy_boto3_iam/__init__.py\", line 104, in <module>\n    from .client import IAMClient\n  File \"/tmp/tmpai6i494_/venv/lib/python3.12/site-packages/mypy_boto3_iam/client.p"},"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/mypy_boto3_iam/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-iam/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":"stale"}}