mypy-boto3-kinesisanalytics Type Stubs

1.42.3 · active · verified Sat Apr 11

mypy-boto3-kinesisanalytics provides explicit type annotations for the `boto3` KinesisAnalytics service. It is currently at version 1.42.3 and is part of the `mypy-boto3-builder` project, which frequently releases updates to synchronize with `boto3` releases and improve type-checking capabilities.

Warnings

Install

Imports

Quickstart

Demonstrates how to obtain a typed KinesisAnalytics client and use it to list applications, leveraging the type hints provided by `mypy-boto3-kinesisanalytics`.

import boto3
from mypy_boto3_kinesisanalytics.client import KinesisAnalyticsClient
from typing import TYPE_CHECKING

# The actual boto3 client is untyped by default
client = boto3.client('kinesisanalytics')

# For type checking, assert the client type if not using session.client overloads
# Most modern IDEs and mypy should infer correctly if boto3-stubs is installed,
# but explicit typing ensures maximum compatibility and clarity.
if TYPE_CHECKING:
    kinesisanalytics_client: KinesisAnalyticsClient = client
else:
    kinesisanalytics_client = client

try:
    # Example: List Kinesis Analytics applications
    response = kinesisanalytics_client.list_applications()
    print(f"Found {len(response.get('ApplicationSummaries', []))} Kinesis Analytics applications:")
    for app in response.get('ApplicationSummaries', []):
        print(f"  - Name: {app['ApplicationName']}, Status: {app['ApplicationStatus']}")
except Exception as e:
    print(f"Error listing applications: {e}")

view raw JSON →