Type annotations for boto3 DynamoDBStreams

1.42.3 · active · verified Sat Apr 11

mypy-boto3-dynamodbstreams provides comprehensive type annotations for the AWS boto3 DynamoDBStreams client, enhancing static analysis and developer experience for DynamoDB Streams operations. It is currently at version 1.42.3, generated by mypy-boto3-builder 8.12.0, with frequent releases aligning with boto3 updates and builder improvements.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a type-hinted DynamoDBStreams client using `boto3` and leverage the provided `mypy-boto3-dynamodbstreams` type annotations for static analysis. It shows listing and describing streams.

import boto3
from mypy_boto3_dynamodbstreams.client import DynamoDBStreamsClient
from mypy_boto3_dynamodbstreams.type_defs import DescribeStreamOutputTypeDef, ListStreamsOutputTypeDef


def get_dynamodb_streams_client() -> DynamoDBStreamsClient:
    """Get a typed DynamoDBStreams client."""
    client: DynamoDBStreamsClient = boto3.client("dynamodbstreams")
    return client


if __name__ == "__main__":
    # Example usage with type checking
    ddb_streams_client = get_dynamodb_streams_client()

    # List streams
    list_response: ListStreamsOutputTypeDef = ddb_streams_client.list_streams(Limit=1)
    print("DynamoDB Streams found:", list_response.get("Streams"))

    # Describe a specific stream (replace with a real ARN if you have one)
    if list_response.get("Streams"):
        stream_arn = list_response["Streams"][0]["StreamArn"]
        describe_response: DescribeStreamOutputTypeDef = ddb_streams_client.describe_stream(StreamArn=stream_arn)
        print(f"Description for {stream_arn}:", describe_response.get("StreamDescription"))

view raw JSON →