{"id":3371,"library":"mypy-boto3-macie2","title":"mypy-boto3-macie2 Type Annotations for AWS Macie2","description":"mypy-boto3-macie2 provides type annotations for the AWS Macie2 service client in boto3. It helps improve code quality and catch type-related errors during development by offering static type checking for Macie2 service calls. The current version is 1.42.3, and it follows a release cadence tied to the upstream boto3 library and its own builder updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hints","macie2","typing"],"install":[{"cmd":"pip install mypy-boto3-macie2 boto3","lang":"bash","label":"Install package and runtime dependency"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python, required to use the type-annotated client. Not an explicit install_requires of the stub package itself.","package":"boto3","optional":false},{"reason":"Static type checker required to utilize the type annotations provided by this library.","package":"mypy","optional":true}],"imports":[{"note":"Main client class for the Macie2 service.","symbol":"Macie2Client","correct":"from mypy_boto3_macie2 import Macie2Client"},{"note":"Import TypeDef objects for request/response structures.","symbol":"ListFindingsRequestRequestTypeDef","correct":"from mypy_boto3_macie2.type_defs import ListFindingsRequestRequestTypeDef"},{"note":"Import literal types for specific enum-like values.","symbol":"FindingStatusType","correct":"from mypy_boto3_macie2.literals import FindingStatusType"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_macie2 import Macie2Client\nfrom mypy_boto3_macie2.type_defs import ListFindingsRequestRequestTypeDef\n\ndef analyze_macie_findings() -> None:\n    # mypy will now correctly type-check the client\n    client: Macie2Client = boto3.client(\"macie2\")\n\n    # Example of a type-checked request parameter\n    request_params: ListFindingsRequestRequestTypeDef = {\n        \"maxResults\": 10\n    }\n    \n    try:\n        response = client.list_findings(**request_params)\n        print(f\"Found {len(response.get('findingIds', []))} Macie findings.\")\n    except Exception as e:\n        print(f\"Error listing Macie findings: {e}\")\n\nif __name__ == \"__main__\":\n    analyze_macie_findings()","lang":"python","description":"Demonstrates how to initialize a type-hinted Macie2 client and use a type-checked request parameter, allowing MyPy to validate method calls and data structures."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed in version 8.12.0 of the mypy-boto3-builder. Users on Python 3.8 will need to upgrade to Python 3.9 or newer to use current versions of mypy-boto3-macie2.","severity":"breaking","affected_versions":">=8.12.0 (builder)"},{"fix":"Ensure your `mypy` configuration is up-to-date and correctly pointing to your virtual environment or site-packages. Reinstalling the package may resolve discovery issues.","message":"All packages migrated to PEP 561 compliant distribution. This change (introduced in builder version 8.12.0) might affect how type checkers discover the packages if you had specific configurations relying on older distribution methods.","severity":"breaking","affected_versions":">=8.12.0 (builder)"},{"fix":"Review the `type_defs` module for the affected service and update the TypeDef class names in your code accordingly.","message":"Some TypeDef naming conventions were changed (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`). This impacts direct references to these generated type definition classes in your code.","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Ensure `boto3` is installed in your environment alongside `mypy-boto3-macie2` using `pip install boto3`.","message":"This library only provides type stubs; `boto3` must be installed separately as a runtime dependency. Without `boto3` installed, your application will fail at runtime despite passing type checks.","severity":"gotcha","affected_versions":"All"},{"fix":"Install the exact stub package for each AWS service you are using type checking for (e.g., `pip install mypy-boto3-macie2`).","message":"For type checking a specific AWS service, you must install the corresponding `mypy-boto3-*` package (e.g., `mypy-boto3-macie2`). Installing only `boto3-stubs` (the meta-package) or `boto3` will not provide specific service client type annotations.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}