mypy-boto3-evs Type Stubs for Boto3 Elastic Volume Service (EVS)

1.42.29 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

Demonstrates how to use `mypy-boto3-evs` to add type hints to your `boto3` EVS client and its operations. This example creates an EVS client, calls `describe_volumes`, and prints information about the found volumes. The `EVSClient` and `DescribeVolumesResultTypeDef` are imported directly from the `mypy-boto3-evs` package, enabling static analysis by `mypy`.

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

view raw JSON →