{"id":3358,"library":"mypy-boto3-ebs","title":"mypy-boto3-ebs type stubs","description":"mypy-boto3-ebs provides comprehensive type annotations for the AWS EBS service client, paginators, and waiters for `boto3`. It enhances development with static type checking, preventing common runtime errors related to incorrect API usage. The current version is 1.42.3, generated by `mypy-boto3-builder`, which frequently updates its stubs to match new `boto3` releases.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","typing","type-stubs","ebs","type-hints"],"install":[{"cmd":"pip install mypy-boto3-ebs boto3 mypy","lang":"bash","label":"Install with boto3 and mypy"}],"dependencies":[{"reason":"Provides the actual runtime implementation for interacting with AWS. mypy-boto3-ebs only provides type stubs.","package":"boto3"},{"reason":"The static type checker required to leverage the type annotations provided by this library.","package":"mypy"}],"imports":[{"symbol":"EBSClient","correct":"from mypy_boto3_ebs.client import EBSClient"},{"symbol":"EBSWaiter","correct":"from mypy_boto3_ebs.waiter import EBSWaiter"},{"symbol":"EBSPaginator","correct":"from mypy_boto3_ebs.paginator import EBSPaginator"},{"symbol":"ListSnapshotsResultTypeDef","correct":"from mypy_boto3_ebs.type_defs import ListSnapshotsResultTypeDef"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\nimport os\n\n# These imports are only for type checking, they don't affect runtime behavior.\nif TYPE_CHECKING:\n    from mypy_boto3_ebs.client import EBSClient\n    from mypy_boto3_ebs.type_defs import ListSnapshotsResultTypeDef\n\n\n# Runtime Boto3 client\n# For real applications, configure credentials securely (e.g., AWS CLI, environment variables)\nclient = boto3.client(\n    \"ebs\",\n    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n    region_name=os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')\n)\n\n# Type hint the client for static analysis (optional but recommended)\nebs_client: EBSClient = client\n\n# Use the client as usual. Type stubs provide autocompletion and error checking.\ntry:\n    response: ListSnapshotsResultTypeDef = ebs_client.list_snapshots()\n    print(\"EBS Snapshots found:\", len(response.get('Snapshots', [])))\n    for snapshot in response.get('Snapshots', []):\n        print(f\"  - {snapshot.get('SnapshotId')}: {snapshot.get('Description')}\")\nexcept Exception as e:\n    print(f\"Error listing snapshots: {e}\")\n\n# To verify type checking, save this code as example.py and run:\n# mypy example.py","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-ebs` with `boto3` to get type-hinted AWS EBS client interactions. The `TYPE_CHECKING` block ensures that type-only imports don't cause runtime overhead. Run `mypy <filename>.py` to verify type correctness."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later. If locked to Python 3.8, use an older `mypy-boto3-ebs` version (e.g., <1.42.0) at your own risk for potential inconsistencies with newer `boto3` releases.","message":"Python 3.8 is no longer supported across all `mypy-boto3-*` packages. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (impacts mypy-boto3-ebs >=1.42.0)"},{"fix":"Review and update `TypeDef` import paths and names in your codebase if you are directly importing and using these types. Refer to the specific service's `type_defs.pyi` for correct names.","message":"Internal `TypeDef` naming conventions changed, potentially shortening names for packed method arguments (e.g., `*RequestRequestTypeDef` to `*RequestTypeDef`). This impacts direct imports and usage of these `TypeDef` objects.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder (impacts mypy-boto3-ebs >=1.38.0)"},{"fix":"Always include `boto3` in your project's dependencies alongside `mypy-boto3-ebs` (e.g., `pip install boto3 mypy-boto3-ebs`).","message":"`mypy-boto3-ebs` provides only type stubs. You must still install `boto3` to use the AWS SDK at runtime. Without `boto3`, your code will fail to execute.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Integrate `mypy` into your development workflow. Install it (`pip install mypy`) and run it regularly on your codebase (e.g., `mypy your_script.py` or `mypy .`).","message":"Type stubs are only useful if you are running a static type checker like `mypy`. Without `mypy` (or equivalent), these packages provide no runtime benefit and do not enforce type safety.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Pin both `boto3` and `mypy-boto3-ebs` to compatible versions in your `requirements.txt` or `pyproject.toml` (e.g., `boto3==1.x.x` and `mypy-boto3-ebs==1.x.x`).","message":"The `mypy-boto3-*` ecosystem relies on `boto3` to match versions. While `mypy-boto3-ebs` tracks the `boto3` version, explicit version pinning of `boto3` and `mypy-boto3-ebs` is recommended to avoid type mismatches after `boto3` updates.","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"}