Type Annotations for Boto3 Kinesis Analytics V2

1.42.80 · active · verified Sat Apr 11

This library provides PEP 561 compliant type annotations for the `boto3` AWS SDK, specifically for the Kinesis Analytics V2 service. Generated by `mypy-boto3-builder`, it ensures `mypy`, `pyright`, and popular IDEs like VSCode and PyCharm offer accurate type checking and autocomplete for `boto3` clients. It's actively maintained, with new releases frequently, often mirroring `boto3` updates, and is currently at version 1.42.80.

Warnings

Install

Imports

Quickstart

Demonstrates initializing a `boto3` Kinesis Analytics V2 client with explicit type annotation using `mypy_boto3_kinesisanalyticsv2` for robust type checking and IDE support. Includes a basic example of calling an API operation.

import boto3
from mypy_boto3_kinesisanalyticsv2 import KinesisAnalyticsV2Client
from typing import TYPE_CHECKING
import os

# Best practice: use explicit type annotation for the client
# The TYPE_CHECKING block ensures mypy_boto3 is only a dev dependency.
if TYPE_CHECKING:
    client: KinesisAnalyticsV2Client
else:
    client = boto3.client(
        "kinesisanalyticsv2",
        region_name=os.environ.get("AWS_REGION", "us-east-1"),
        aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID", ""),
        aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY", ""),
    )

print(f"KinesisAnalyticsV2 Client: {client}")

# Example operation: List applications
# The type stubs provide auto-completion and type checking for methods and response shapes.
try:
    response = client.list_applications()
    # Accessing response elements will now be type-checked
    print("Applications found:", [app["ApplicationName"] for app in response.get("ApplicationSummaries", [])])
except Exception as e:
    print(f"Error listing Kinesis Analytics V2 applications: {e}")

view raw JSON →