{"id":3566,"library":"mypy-boto3-codeguru-security","title":"mypy-boto3-codeguru-security","description":"mypy-boto3-codeguru-security provides type annotations for the `boto3` AWS SDK for Python, specifically for the CodeGuruSecurity service. These stubs enable static type checkers like Mypy to validate `boto3` calls, improving code quality and catching errors early. It is part of the `mypy-boto3-builder` ecosystem, which maintains a regular release cadence to stay in sync with `boto3` updates. The current version is 1.42.3.","status":"active","version":"1.42.3","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","codeguru-security","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-codeguru-security boto3","lang":"bash","label":"Install library and boto3"},{"cmd":"pip install mypy","lang":"bash","label":"Install Mypy (if not already)"}],"dependencies":[{"reason":"This package provides type stubs for boto3's CodeGuruSecurity service. boto3 itself is a runtime dependency for using the AWS SDK.","package":"boto3","optional":false},{"reason":"This package is designed to be consumed by static type checkers like Mypy to provide type safety for boto3 operations.","package":"mypy","optional":true}],"imports":[{"note":"Import the specific client type for explicit type hinting of the boto3 client object.","symbol":"CodeGuruSecurityClient","correct":"from mypy_boto3_codeguru_security.client import CodeGuruSecurityClient"},{"note":"Import specific TypedDicts for precise type hinting of API responses or request parameters. These are nested under `type_defs`.","symbol":"ListFindingsResponseTypeDef","correct":"from mypy_boto3_codeguru_security.type_defs import ListFindingsResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_codeguru_security.client import CodeGuruSecurityClient\nfrom mypy_boto3_codeguru_security.type_defs import ListFindingsResponseTypeDef\n\ndef get_codeguru_security_client() -> CodeGuruSecurityClient:\n    \"\"\"Initializes and returns a CodeGuruSecurity client with type hints.\"\"\"\n    # boto3 automatically picks up credentials from environment variables or IAM roles\n    # For local testing, ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN (optional) are set.\n    return boto3.client(\"codeguru-security\")\n\ndef list_all_findings(client: CodeGuruSecurityClient) -> None:\n    \"\"\"Lists CodeGuruSecurity findings and prints their IDs.\"\"\"\n    print(\"Listing CodeGuruSecurity findings...\")\n    paginator = client.get_paginator(\"list_findings\")\n    page_iterator = paginator.paginate()\n\n    found_findings = 0\n    for page in page_iterator:\n        page_data: ListFindingsResponseTypeDef = page\n        for finding in page_data.get(\"findings\", []):\n            print(f\"  Finding ID: {finding.get('id')}\")\n            found_findings += 1\n    if found_findings == 0:\n        print(\"  No findings found.\")\n    else:\n        print(f\"Found {found_findings} findings.\")\n\nif __name__ == \"__main__\":\n    # Example usage\n    codeguru_client = get_codeguru_security_client()\n    list_all_findings(codeguru_client)\n","lang":"python","description":"This example demonstrates how to create a `boto3` client for CodeGuruSecurity with explicit type hints and then use it to list findings, leveraging paginators. To run this, ensure `boto3` and `mypy-boto3-codeguru-security` are installed, and your AWS credentials are configured (e.g., via environment variables or AWS CLI configuration)."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"The `mypy-boto3-builder` (which generates this stub package) dropped support for Python 3.8 in version 8.12.0. All generated stub packages now require Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-codeguru-security >= 1.42.0)"},{"fix":"Ensure `boto3` is included in your project's dependencies and installed (e.g., `pip install boto3 mypy-boto3-codeguru-security`).","message":"This package provides only type stubs and does not install `boto3` itself. You must explicitly install `boto3` alongside this stub package for your application to function at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review your imports of specific `TypeDef` classes and update their names according to the new conventions (e.g., look for removed `Request` suffixes or shifted `Extra` postfixes).","message":"For advanced users who directly import `TypeDef` objects, `mypy-boto3-builder` version 8.9.0 introduced breaking changes to TypeDef naming conventions (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-codeguru-security >= 1.39.0)"},{"fix":"Always refer to the official `mypy-boto3` documentation or `boto3` documentation for the latest service names and corresponding stub package names if you encounter import errors for specific services.","message":"AWS service names can occasionally change or be deprecated (e.g., 'sms-voice' to 'pinpoint-sms-voice' in older builder versions). While 'codeguru-security' is stable, be aware that the specific stub package you need might change if the underlying AWS service name evolves.","severity":"gotcha","affected_versions":"All versions (potential for future changes)"}],"env_vars":null,"search_vec":"'1.42.3':72 'analysi':85 'annot':13 'aw':17,73 'boto3':3,8,16,36,52,66,74 'builder':53 'cadenc':60 'call':37 'catch':42 'checker':31 'code':39 'codeguru':4,9,81 'codeguru-secur':80 'codegurusecur':24 'current':69 'earli':44 'ecosystem':54 'enabl':28 'error':43 'hint':78 'improv':38 'like':32 'maintain':56 'mypi':2,7,33,51,75 'mypy-boto3-builder':50 'mypy-boto3-codeguru-security':1,6 'part':47 'provid':11 'python':20 'qualiti':40 'regular':58 'releas':59 'sdk':18 'secur':5,10,82 'servic':25 'specif':21 'static':29,84 'static-analysi':83 'stay':62 'stub':27,79 'sync':64 'type':12,30,77 'type-hint':76 'updat':67 'valid':35 'version':70","created_at":"2026-04-11T17:35:04.603247+00:00","updated_at":"2026-04-16T16:51:07.508106+00:00","problems":{"verify_error":"error: Failed to parse: `mypy-boto3-codeguru-security boto3`\n  Caused by: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `b`\nmypy-boto3-codeguru-security boto3\n                             ^"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.0","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_codeguru_security/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-codeguru-security/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-29","next_check":"2026-07-05","install_tag":null}}