mypy-boto3-entityresolution Type Stubs for AWS Entity Resolution
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
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 (and consequently in `mypy-boto3` packages). Users on Python 3.8 or older must upgrade to Python 3.9+.
- breaking The `mypy-boto3` ecosystem migrated to PEP 561 packages in `mypy-boto3-builder` version 8.12.0. This standardizes how type checkers like MyPy discover stubs, but may require updates to `mypy` configurations or ensure correct `py.typed` file discovery.
- breaking TypeDef names for method arguments and conflicting names were refactored in `mypy-boto3-builder` version 8.9.0. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `Extra` postfixes moved to the end. This is a breaking change for code explicitly referencing these TypeDefs.
- gotcha This package provides only type annotations. You must install `boto3` separately (e.g., `pip install boto3`) for your application to function at runtime. `mypy-boto3-entityresolution` is solely for static analysis.
- gotcha For full type-checking benefits and reliable IDE auto-completion, explicitly annotate your `boto3.client` calls with the specific client type (e.g., `client: EntityResolutionClient = boto3.client(...)`). While some IDEs might infer types, explicit annotations are often more robust.
Install
-
pip install mypy-boto3-entityresolution boto3
Imports
- EntityResolutionClient
from mypy_boto3_entityresolution.client import EntityResolutionClient
- ListMatchingWorkflowsOutputTypeDef
from mypy_boto3_entityresolution.type_defs import ListMatchingWorkflowsOutputTypeDef
Quickstart
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.")