{"id":3700,"library":"mypy-boto3-securitylake","title":"Type Annotations for boto3 SecurityLake","description":"mypy-boto3-securitylake provides static type annotations for the AWS SDK for Python (boto3) specifically for the SecurityLake service. It enhances development experience by enabling IDE autocompletion and static type checking with tools like MyPy, addressing the dynamic nature of boto3's client generation. This package is generated by the `mypy-boto3-builder` and is currently at version 1.42.3, typically released in sync with `boto3` updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type-hints","mypy","codegen","securitylake"],"install":[{"cmd":"pip install mypy-boto3-securitylake boto3","lang":"bash","label":"Install library and boto3"}],"dependencies":[{"reason":"This package provides type stubs for the `boto3` library; `boto3` itself must be installed to use the AWS SDK functionality.","package":"boto3","optional":false}],"imports":[{"note":"For type-hinting the SecurityLake service client.","symbol":"SecurityLakeClient","correct":"from mypy_boto3_securitylake.client import SecurityLakeClient"},{"note":"For type-hinting responses from SecurityLake API calls, e.g., `list_data_lakes()`.","symbol":"ListDataLakesResponseTypeDef","correct":"from mypy_boto3_securitylake.type_defs import ListDataLakesResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_securitylake.client import SecurityLakeClient\nfrom mypy_boto3_securitylake.type_defs import ListDataLakesResponseTypeDef\nimport os\n\ndef get_securitylake_data_lakes() -> ListDataLakesResponseTypeDef:\n    # It's recommended to explicitly type the client for best IDE support\n    client: SecurityLakeClient = boto3.client(\n        \"securitylake\", \n        region_name=os.environ.get('AWS_REGION', 'us-east-1'),\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')\n    )\n    response = client.list_data_lakes()\n    return response\n\nif __name__ == \"__main__\":\n    data_lakes = get_securitylake_data_lakes()\n    print(f\"Found {len(data_lakes.get('DataLakes', []))} data lakes:\")\n    for dl in data_lakes.get('DataLakes', []):\n        print(f\"- Region: {dl['Region']}, ARN: {dl['DataLakeArn']}\")","lang":"python","description":"Demonstrates how to import and use the `SecurityLakeClient` for type-hinted interaction with AWS SecurityLake, including fetching data lakes and their details. Explicit type annotations are shown for clarity and improved IDE experience."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 support was removed with `mypy-boto3-builder` version 8.12.0. This `mypy-boto3-securitylake` package (version 1.42.3) requires Python 3.9 or newer.","severity":"breaking","affected_versions":">=1.42.0 (generated by builder 8.12.0+)"},{"fix":"Review and update `TypeDef` names in your codebase according to the new conventions.","message":"Beginning with `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions, including shorter names for packed method arguments and moving the `Extra` postfix. This might require updating existing type annotations in your code.","severity":"breaking","affected_versions":">=1.40.0 (generated by builder 8.9.0+)"},{"fix":"Ensure `boto3` is installed alongside `mypy-boto3-securitylake` (e.g., `pip install mypy-boto3-securitylake boto3`).","message":"This package provides type stubs for `boto3`. You must also install `boto3` itself for your code to run, as `mypy-boto3-securitylake` only provides the type definitions, not the AWS SDK implementation.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update both packages, ideally together, to their latest compatible versions.","message":"To ensure accurate type hints and autocompletion, keep `mypy-boto3-securitylake` and `boto3` versions synchronized. Significant version mismatches can lead to incorrect type information or missing definitions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider using `boto3-stubs-lite` if the full stubs are too demanding, or configure your IDE to use external type checkers like `mypy` or `pyright` instead of its built-in type checker.","message":"Some IDEs (e.g., PyCharm) may experience slow performance or high CPU usage when processing the extensive type information from `boto3-stubs` (the umbrella project for `mypy-boto3-*` packages).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type hints, e.g., `client: SecurityLakeClient = boto3.client('securitylake')`.","message":"For optimal autocompletion and type inference in IDEs like VSCode and PyCharm, it is often beneficial to explicitly annotate the type of `boto3.client` and `boto3.resource` calls with the corresponding `mypy_boto3_securitylake` client or resource type.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}