mypy-boto3-es: AWS Elasticsearch Service Type Stubs

1.42.81 · active · verified Sat Apr 11

mypy-boto3-es provides type annotations for the AWS ElasticsearchService (now OpenSearch Service) Boto3 client, ensuring type safety and improved IDE experience for Python developers. It is part of the `mypy-boto3` ecosystem, currently at version 1.42.81, which aligns with the `boto3` version it provides stubs for. The library is actively maintained with frequent releases, driven by the `mypy-boto3-builder` project.

Warnings

Install

Imports

Quickstart

This example demonstrates how to instantiate a `boto3` Elasticsearch client and apply `mypy-boto3-es` type hints for improved static analysis. Ensure `boto3` is installed alongside `mypy-boto3-es`.

import boto3
from mypy_boto3_es.client import ElasticsearchClient

# Instantiate the boto3 client with type hinting
es_client: ElasticsearchClient = boto3.client("es")

try:
    # Example usage: list domain names
    response = es_client.list_domain_names()
    for domain in response.get('DomainNames', []):
        print(f"Found domain: {domain['DomainName']}")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →