{"id":3036,"library":"mypy-boto3-braket","title":"mypy-boto3-braket type stubs","description":"mypy-boto3-braket provides static type checking and autocompletion for the AWS Braket service within the `boto3` library. It enhances developer experience by offering precise type hints for clients, paginators, waiters, and data transfer objects (TypeDefs). The current version, 1.42.85, is synchronized with its corresponding `boto3` version and is part of the actively maintained `mypy-boto3-builder` ecosystem, which follows a frequent release cadence.","status":"active","version":"1.42.85","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-stubs","boto3","aws","braket","mypy","type-hinting","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-braket boto3","lang":"bash","label":"Install standalone Braket stubs and boto3"},{"cmd":"pip install 'boto3-stubs[braket]' boto3","lang":"bash","label":"Install Braket stubs via boto3-stubs extras and boto3"}],"dependencies":[{"reason":"This library provides type annotations for `boto3`'s Braket service; `boto3` itself must be installed separately as a runtime dependency.","package":"boto3","optional":false},{"reason":"May be required for full compatibility with older Python versions (pre 3.9) or specific type features, though current versions officially require Python 3.9+.","package":"typing-extensions","optional":true}],"imports":[{"note":"Type stubs provide specific client types from their own namespace, not directly from `boto3`'s runtime module.","wrong":"from boto3.client import BraketClient","symbol":"BraketClient","correct":"from mypy_boto3_braket.client import BraketClient"},{"note":"Type definitions are provided by the stub library, not directly from `boto3`.","wrong":"from boto3.braket.type_defs import CreateQuantumTaskRequestRequestTypeDef","symbol":"CreateQuantumTaskRequestRequestTypeDef","correct":"from mypy_boto3_braket.type_defs import CreateQuantumTaskRequestRequestTypeDef"},{"note":"The `boto3` Session object is used at runtime and automatically gets type-hinted by the stubs.","symbol":"Session","correct":"from boto3.session import Session"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_braket.client import BraketClient\n\ndef get_braket_client() -> BraketClient:\n    # boto3.client('braket') returns a botocore.client.Braket object at runtime.\n    # mypy-boto3-braket provides the type hint to make it a BraketClient for static analysis.\n    client: BraketClient = boto3.client('braket')\n    return client\n\nif __name__ == '__main__':\n    # Example usage: list quantum tasks (replace with actual region/credentials if running)\n    braket_client = get_braket_client()\n    try:\n        response = braket_client.list_quantum_tasks(\n            maxResults=5,\n            # Additional filtering parameters can be added here\n        )\n        print(f\"Successfully retrieved {len(response['quantumTasks'])} quantum tasks.\")\n        for task in response.get('quantumTasks', []):\n            print(f\"  Task ARN: {task['quantumTaskArn']}, Status: {task['status']}\")\n    except Exception as e:\n        print(f\"Error listing quantum tasks: {e}\")","lang":"python","description":"Initialize a `boto3` Braket client and leverage the type annotations provided by `mypy-boto3-braket` for autocompletion and static type checking. This example demonstrates how to retrieve and print a list of quantum tasks."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. The PyPI metadata for this library explicitly requires Python >=3.9.","message":"Support for Python 3.8 was officially removed starting with `mypy-boto3-builder` version 8.12.0. If you are using an older Python version, you will encounter compatibility issues.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (which generates this stub library)"},{"fix":"Review your codebase for type hint imports and usage, and update TypeDef names according to the new naming conventions.","message":"Generated TypeDef names were changed in `mypy-boto3-builder` version 8.9.0. Specifically, argument TypeDefs like `CreateDistributionRequestRequestTypeDef` were shortened to `CreateDistributionRequestTypeDef`, and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder"},{"fix":"Ensure `boto3` is installed in your environment (e.g., `pip install boto3 mypy-boto3-braket`).","message":"This library provides *only* type annotations for the `boto3` AWS SDK. `boto3` itself is a separate runtime dependency and must be installed alongside `mypy-boto3-braket` for your code to function at runtime. Without `boto3` installed, type checking will still work, but runtime execution will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Prefer `boto3-stubs` with extras for multiple services or `mypy-boto3-service` for individual services. Avoid the old `mypy-boto3` package unless specifically maintaining legacy code.","message":"The `mypy-boto3-*` packages are standalone service stubs. For a more integrated experience or to install stubs for multiple services, consider using `boto3-stubs` with service extras (e.g., `pip install 'boto3-stubs[braket]'`). The `mypy-boto3` package is considered legacy and users are encouraged to use `types-boto3` or specific service stubs.","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"}