{"id":5666,"library":"mypy-boto3-securityhub","title":"Type Annotations for boto3 SecurityHub","description":"mypy-boto3-securityhub provides comprehensive type annotations for the AWS SecurityHub service client in `boto3`. It enhances development with static type checking, auto-completion, and improved error detection for AWS interactions. The library's version typically aligns with the `boto3` version it types, and it is actively developed with a regular release cadence driven by `mypy-boto3-builder` updates.","status":"active","version":"1.42.58","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-hints","securityhub","typing"],"install":[{"cmd":"pip install mypy-boto3-securityhub","lang":"bash","label":"Install standalone package"},{"cmd":"pip install 'boto3-stubs[securityhub]'","lang":"bash","label":"Install via boto3-stubs meta-package"}],"dependencies":[{"reason":"This package provides type stubs for boto3; the boto3 library itself must be installed to make actual AWS calls.","package":"boto3","optional":false}],"imports":[{"symbol":"SecurityHubClient","correct":"from mypy_boto3_securityhub.client import SecurityHubClient"},{"note":"For interacting with SecurityHub as a ServiceResource if available.","symbol":"SecurityHubServiceResource","correct":"from mypy_boto3_securityhub.service_resource import SecurityHubServiceResource"},{"note":"Example for a specific paginator.","symbol":"DescribeStandardsPaginator","correct":"from mypy_boto3_securityhub.paginator import DescribeStandardsPaginator"},{"note":"Example for a generated TypeDef (TypedDict).","symbol":"AcceptAdministratorInvitationRequestRequestTypeDef","correct":"from mypy_boto3_securityhub.type_defs import AcceptAdministratorInvitationRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_securityhub.client import SecurityHubClient\n\ndef get_securityhub_client() -> SecurityHubClient:\n    \"\"\"Initializes and returns a typed AWS SecurityHub client.\"\"\"\n    session = boto3.Session()\n    client: SecurityHubClient = session.client(\"securityhub\")\n    return client\n\nif __name__ == \"__main__\":\n    # Example usage (requires AWS credentials configured)\n    try:\n        securityhub_client = get_securityhub_client()\n        response = securityhub_client.describe_standards()\n        print(f\"Successfully retrieved {len(response.get('Standards', []))} Security Hub standards.\")\n    except Exception as e:\n        print(f\"Error interacting with SecurityHub: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `SecurityHubClient` using `boto3` and perform a basic API call. Ensure `boto3` is installed and AWS credentials are configured in your environment."},"warnings":[{"fix":"Upgrade your Python environment to 3.9+ or use an older version of `mypy-boto3-builder` (and derived packages) compatible with Python 3.8.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. If you are using Python 3.8, you must upgrade to Python 3.9 or newer, or pin to an older `mypy-boto3-builder` release (and corresponding `mypy-boto3-*` packages).","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Update imports and references to TypeDefs to reflect the new naming conventions. Consult the `mypy-boto3` documentation for the specific service for updated names.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. Some TypeDef names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`), and conflicting postfixes were reordered. Code explicitly referencing these generated type definitions may break.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"This package provides only type annotations for `boto3`'s SecurityHub service. It does *not* include the `boto3` library itself. You must install `boto3` separately for your code to function at runtime.","severity":"gotcha","affected_versions":"All"},{"fix":"Check the `mypy-boto3` documentation or PyPI `requires_dist` for specific version compatibility. Ideally, update `mypy-boto3-securityhub` and `boto3` to closely matching or compatible versions.","message":"While `mypy-boto3-securityhub` versions generally aim to match corresponding `boto3` versions, minor discrepancies or specific `requires_dist` in PyPI metadata can lead to `boto3` version incompatibility. Always ensure your `mypy-boto3-securityhub` package is compatible with your installed `boto3` version to avoid type checking errors or runtime issues.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}