mypy-boto3-keyspacesstreams Type Annotations

1.42.59 · active · verified Sat Apr 11

mypy-boto3-keyspacesstreams provides type annotations for the `boto3` library's KeyspacesStreams service, enabling static type checking with tools like MyPy. It is part of the `mypy-boto3` project, which generates stubs for all AWS services supported by `boto3`. The current version is 1.42.59, generated by `mypy-boto3-builder 8.12.0`, with frequent updates to align with `boto3` releases.

Warnings

Install

Imports

Quickstart

This example demonstrates how to use `mypy-boto3-keyspacesstreams` for type-hinting a `boto3` KeyspacesStreams client. MyPy can then verify the types of client methods and responses.

import boto3
from mypy_boto3_keyspacesstreams.client import KeyspacesStreamsClient
from typing import TYPE_CHECKING

# The actual boto3 client is not affected by the stub package at runtime.
# Type checking tools like MyPy will use the imported KeyspacesStreamsClient for analysis.

# It's good practice to guard stub imports if they might not be available at runtime
# in some environments, though mypy-boto3 stubs are typically installed alongside boto3.
if TYPE_CHECKING:
    client: KeyspacesStreamsClient = boto3.client("keyspaces-streams")
else:
    client = boto3.client("keyspaces-streams")

# Example operation: list streams (ensure your AWS credentials are configured)
try:
    response = client.list_streams(MaxResults=1)
    print("Successfully listed Keyspaces Streams (first entry if any):")
    if response.get("streams"):
        print(response["streams"][0])
    else:
        print("No streams found.")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →