mypy-boto3-lookoutequipment

1.42.3 · active · verified Sat Apr 11

mypy-boto3-lookoutequipment provides type annotations for the `boto3` AWS SDK's LookoutEquipment service, ensuring static type checking with tools like `mypy`. This enhances code quality, improves developer experience with IDE autocompletion, and helps catch potential bugs before runtime. The package is generated by `mypy-boto3-builder 8.12.0` and follows the `boto3` versioning for its type stubs, with frequent updates to align with new `boto3` releases.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-lookoutequipment` to get type hints for the `boto3` LookoutEquipment client and its responses. It explicitly imports `LookoutEquipmentClient` for client annotation and `ListDatasetsResponseTypeDef` for response typing, ensuring static analysis can fully leverage the provided stubs. The `TYPE_CHECKING` block prevents runtime dependency on the stub package.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_lookoutequipment.client import LookoutEquipmentClient
    from mypy_boto3_lookoutequipment.type_defs import ListDatasetsResponseTypeDef


def list_lookout_equipment_datasets() -> 'ListDatasetsResponseTypeDef':
    """Lists LookoutEquipment datasets and returns a typed response."""
    # boto3 client is dynamically typed, mypy-boto3 provides static types
    client: LookoutEquipmentClient = boto3.client("lookoutequipment")

    # The response is automatically typed by mypy-boto3
    response = client.list_datasets()
    print(f"Found {len(response['DatasetSummaries'])} datasets.")
    return response

if __name__ == "__main__":
    # Example usage (requires AWS credentials configured)
    try:
        datasets = list_lookout_equipment_datasets()
        for dataset in datasets.get('DatasetSummaries', []):
            print(f"- Dataset ARN: {dataset['DatasetArn']}, Name: {dataset['DatasetName']}")
    except Exception as e:
        print(f"Error listing datasets: {e}")
        print("Please ensure AWS credentials are configured (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME environment variables).")

view raw JSON →