mypy-boto3-timestream-query stubs

1.42.3 · active · verified Sat Apr 11

mypy-boto3-timestream-query provides type annotations (stubs) for the `boto3` Timestream Query service, enhancing static analysis with tools like MyPy. It is actively maintained by the `youtype/mypy_boto3_builder` project, with versions updated frequently to align with new `boto3` releases and improvements to the builder itself. The current version is 1.42.3.

Warnings

Install

Imports

Quickstart

Demonstrates how to initialize a `boto3` Timestream Query client and use the `mypy-boto3-timestream-query` stubs for type-hinted API calls. This code requires valid AWS credentials with access to Timestream Query to run successfully.

import boto3
from mypy_boto3_timestream_query.client import TimestreamQueryClient
from mypy_boto3_timestream_query.type_defs import ListDatabasesResponseTypeDef

# Initialize a boto3 client. Mypy will use the stubs for type checking.
# Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)
client: TimestreamQueryClient = boto3.client("timestream-query")

# Example API call with type hinting
try:
    print("Attempting to list Timestream databases...")
    response: ListDatabasesResponseTypeDef = client.list_databases()
    databases = response.get("Databases", [])
    if databases:
        print("Timestream Databases:")
        for db in databases:
            print(f"- {db.get('DatabaseName')}")
    else:
        print("No Timestream databases found.")
except Exception as e:
    print(f"Error listing databases: {e}")
    print("Ensure you have configured AWS credentials with permissions for Timestream Query.")

view raw JSON →