mypy-boto3-entityresolution Type Stubs for AWS Entity Resolution

1.42.10 · active · verified Sat Apr 11

mypy-boto3-entityresolution provides type annotations for the `boto3` AWS Entity Resolution service, enabling static type checking with tools like MyPy. It is part of the `mypy-boto3-builder` project, which generates stubs for all `boto3` services. The library receives frequent updates, often daily or weekly, to keep pace with `boto3` and underlying AWS service changes.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize an AWS Entity Resolution client with explicit type annotations and list matching workflows. It highlights how type stubs enhance code completion and static analysis for `boto3` interactions. Ensure you have `boto3` installed and AWS credentials configured for actual execution.

import boto3
from mypy_boto3_entityresolution.client import EntityResolutionClient
from mypy_boto3_entityresolution.type_defs import ListMatchingWorkflowsOutputTypeDef
import os

def get_entity_resolution_workflows() -> list[ListMatchingWorkflowsOutputTypeDef]:
    # Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)
    # For local testing, you might need to mock or ensure a default region/profile
    client: EntityResolutionClient = boto3.client("entityresolution", region_name=os.environ.get('AWS_REGION', 'us-east-1'))

    # Example: List matching workflows
    response = client.list_matching_workflows(maxResults=10)
    print(f"Found {len(response['workflowSummaries'])} workflows.")
    # A mypy check would ensure 'workflowSummaries' exists and is correctly typed
    return response['workflowSummaries']

if __name__ == "__main__":
    # This code requires AWS credentials and a configured default region to run successfully.
    # Set AWS_REGION and AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or use a configured profile.
    # Example: export AWS_REGION=us-east-1
    # Example: mypy your_script_name.py
    try:
        workflows = get_entity_resolution_workflows()
        for workflow in workflows:
            print(f"- Workflow ARN: {workflow['workflowArn']}")
    except Exception as e:
        print(f"Error: {e}. Please ensure AWS credentials and region are configured.")

view raw JSON →