Install & Compatibility
Where this runs
tested against v1.43.50 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 198.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.8s · import 0.000s · 267MB
232MB installed
● package 232MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
EMRClient
✓ from mypy_boto3_emr.client import EMRClient
✗ from mypy_boto3_emr.client import EMRClient
EMRServiceResource
✓ from mypy_boto3_emr import EMRServiceResource
✗ from mypy_boto3_emr.client import EMRClient
Client
✓ from mypy_boto3_emr import Client
✗ from mypy_boto3_emr.client import EMRClient
This quickstart demonstrates how to use `mypy-boto3-emr` to add type hints to your boto3 EMR client and API responses. The `TYPE_CHECKING` block ensures that stub imports are only processed by the type checker, avoiding runtime import errors if the stubs are not installed. Explicitly typing the client and response objects allows MyPy to provide comprehensive checks.
import boto3
from typing import TYPE_CHECKING, List, Dict, Any
import os
# Conditional import for type checking only
if TYPE_CHECKING:
from mypy_boto3_emr.client import EMRClient
from mypy_boto3_emr.type_defs import ListClustersOutputTypeDef, ClusterSummaryTypeDef
# Example function using type hints
def get_running_emr_clusters() -> List[ClusterSummaryTypeDef]:
# The client variable is explicitly typed for MyPy
client: EMRClient = boto3.client(
"emr",
region_name=os.environ.get('AWS_REGION', 'us-east-1'),
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET')
)
# The response variable is explicitly typed
response: ListClustersOutputTypeDef = client.list_clusters(ClusterStates=['RUNNING'])
clusters: List[ClusterSummaryTypeDef] = response.get('Clusters', [])
print(f"Found {len(clusters)} running EMR clusters.")
for cluster in clusters:
print(f" - Cluster ID: {cluster['Id']}, Name: {cluster['Name']}")
return clusters
if __name__ == "__main__":
# This code will run, but type hints are only checked by MyPy
get_running_emr_clusters()
Debug
Known issues
breakingSupport for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9 or newer to use the latest stub packages.fixUpgrade your Python environment to 3.9 or newer. If you must use Python 3.8, you will be limited to older versions of `mypy-boto3-emr`.
affects: >=8.12.0 of mypy-boto3-builder (and generated stubs)
breakingTypeDef naming conventions changed significantly in `mypy-boto3-builder` version 8.9.0. Specifically, redundant 'Request' suffixes were removed (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and 'Extra' postfixes moved to the end of the name. This may break explicit imports of TypeDefs.fixReview your code for explicit imports of `_type_defs` and adjust the `TypeDef` names according to the new conventions.
affects: >=8.9.0 of mypy-boto3-builder (and generated stubs)
gotcha`mypy-boto3-emr` provides *only* type stubs for the EMR service. It does not include the runtime `boto3` library itself. For your code to run, `boto3` must be installed separately.fixEnsure `boto3` is installed alongside `mypy-boto3-emr` (e.g., `pip install boto3 mypy-boto3-emr`).
affects: All versions
gotchaAWS service names can change or be deprecated over time (e.g., `sms-voice` was replaced by `pinpoint-sms-voice` in builder 8.11.0). This means the corresponding `mypy-boto3` stub package names might also change or be removed. Always consult the latest `boto3` and `mypy-boto3` documentation for current service names.fixStay updated with `boto3` and `mypy-boto3` releases. If a service name changes, update your `boto3.client()` calls and install the correct `mypy-boto3-servicename` package.
affects: All versions (ecosystem-wide)
Upgrade
Version history
1.43.50latest on PyPI · released Jul 16, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself is required for runtime functionality.
mypyrequiredRequired for static type checking. The stubs are only useful if MyPy or a similar type checker is used.