mypy-boto3-evs Type Stubs for Boto3 Elastic Volume Service (EVS)
This package provides type annotations for the `boto3` AWS SDK, specifically for the Elastic Volume Service (EVS). It allows `mypy` to perform static type checking on your `boto3` code, catching potential errors before runtime. Part of the `mypy-boto3` ecosystem, it's frequently updated to align with `boto3` releases. The current version is 1.42.29, generated with `mypy-boto3-builder 8.12.0`.
Warnings
- breaking The `mypy-boto3` builder (version 8.12.0) used to generate `mypy-boto3-evs` (version 1.42.29) has removed support for Python 3.8. Projects relying on these stubs must use Python 3.9 or newer.
- breaking Builder version 8.9.0 introduced breaking changes to `TypeDef` naming conventions (e.g., shorter names for packed method arguments, `Extra` postfix moved). If you have custom types or code relying on specific `TypeDef` names generated by older `mypy-boto3` versions, these names might have changed.
- gotcha This package provides only type stubs for `boto3` EVS. It does not install the `boto3` runtime itself. You must explicitly install `boto3` (e.g., `pip install boto3`) in your environment for your code to run.
- gotcha For optimal type inference, especially when using `boto3.Session().client()` or `boto3.Session().resource()`, it is recommended to add the `mypy-boto3` plugin to your `mypy` configuration.
Install
-
pip install mypy-boto3-evs boto3
Imports
- EVSClient
from mypy_boto3_evs.client import EVSClient
- DescribeVolumesResultTypeDef
from mypy_boto3_evs.type_defs import DescribeVolumesResultTypeDef
Quickstart
import boto3
from mypy_boto3_evs.client import EVSClient
from mypy_boto3_evs.type_defs import DescribeVolumesResultTypeDef
# Instantiate the EVS client with type hints
# Ensure you have 'boto3' and 'mypy-boto3-evs' installed:
# pip install boto3 mypy-boto3-evs
# The actual boto3 client is created, but its type is now known to mypy
evs_client: EVSClient = boto3.client("evs", region_name="us-east-1")
try:
# Call an EVS operation, result will be type-checked
response: DescribeVolumesResultTypeDef = evs_client.describe_volumes()
print(f"Found {len(response.get('Volumes', []))} EVS volumes.")
# Example of accessing typed data
for volume in response.get('Volumes', []):
print(f" - Volume ID: {volume.get('VolumeId')}, State: {volume.get('State')}")
except Exception as e:
print(f"Error describing EVS volumes: {e}")
# To type-check this file, run: mypy your_script_name.py