{"id":3357,"library":"mypy-boto3-devops-guru","title":"mypy-boto3-devops-guru Type Stubs","description":"mypy-boto3-devops-guru provides type annotations for the AWS boto3 DevOps Guru service, generated with mypy-boto3-builder. It enhances type checking for boto3 clients, resources, and various service-specific data structures. The current version is 1.42.3, and it follows a frequent release cadence, often aligning with new boto3 releases and updates to the mypy-boto3-builder.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-hints","devops-guru","type-stubs"],"install":[{"cmd":"pip install mypy-boto3-devops-guru","lang":"bash","label":"Install service stubs"},{"cmd":"pip install boto3","lang":"bash","label":"Install runtime dependency (if not already present)"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself is required at runtime.","package":"boto3","optional":false},{"reason":"May be required for older Python versions or specific type features.","package":"typing-extensions","optional":true}],"imports":[{"symbol":"DevOpsGuruClient","correct":"from mypy_boto3_devops_guru import DevOpsGuruClient"},{"symbol":"DescribeAccountHealthResponseTypeDef","correct":"from mypy_boto3_devops_guru.type_defs import DescribeAccountHealthResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_devops_guru import DevOpsGuruClient\nfrom mypy_boto3_devops_guru.type_defs import DescribeAccountHealthResponseTypeDef\n\n# Instantiate the boto3 client, typed with mypy-boto3 stubs\nclient: DevOpsGuruClient = boto3.client(\n    \"devops-guru\", \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    region_name=os.environ.get('AWS_REGION', 'us-east-1')\n)\n\ntry:\n    # Call a service method\n    response: DescribeAccountHealthResponseTypeDef = client.describe_account_health()\n    print(f\"Account health details: {response}\")\nexcept Exception as e:\n    print(f\"Error describing account health: {e}\")","lang":"python","description":"Demonstrates how to import and use the `DevOpsGuruClient` type stub with a boto3 client, and how to use a specific TypedDict for a response. This allows static type checkers like MyPy to validate client calls and response structures."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later. If you must use Python 3.8, pin to an older `mypy-boto3-devops-guru` version (e.g., `<1.42.0`) and its corresponding `mypy-boto3-builder` version.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generated current stubs), Python 3.8 support was removed for all generated `mypy-boto3-*` packages. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0, mypy-boto3-devops-guru >=1.42.x"},{"fix":"Ensure `pip install boto3` is part of your project's dependency setup.","message":"These packages provide only type stubs. You must install `boto3` (and optionally `botocore`) separately for the runtime functionality. Not installing `boto3` will lead to `ModuleNotFoundError` at runtime, even if type checks pass.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When updating `boto3`, also update all `mypy-boto3-*` stub packages to their latest compatible versions. Generally, `pip install --upgrade boto3 mypy-boto3-devops-guru` is recommended.","message":"Mismatched versions between `boto3` and `mypy-boto3-*` stubs can lead to `mypy` errors or incorrect type hints. The stubs are generated based on specific `boto3` service definitions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always verify the correct service name in the `boto3` documentation. If a service name changes, update the stub package import path and the client instantiation accordingly.","message":"AWS service names can change over time, or have variations (e.g., `sms-voice` vs. `pinpoint-sms-voice`). This can lead to `ModuleNotFoundError` for the stub package or `botocore.exceptions.ClientError` at runtime if the service name in `boto3.client()` is incorrect.","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"}