Install & Compatibility
Where this runs
tested against v1.43.37 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ElastiCacheClient
✓ from mypy_boto3_elasticache import ElastiCacheClient
✗ from mypy_boto3_elasticache import ElastiCacheClient
This quickstart demonstrates how to use `mypy-boto3-elasticache` with `boto3`. The type stubs are automatically picked up by MyPy, allowing you to annotate your `boto3` client and response objects for better static analysis. Ensure your AWS credentials are configured for the `boto3` client to function.
import boto3
import os
from mypy_boto3_elasticache.client import ElastiCacheClient
from mypy_boto3_elasticache.type_defs import DescribeCacheClustersResultTypeDef
# mypy-boto3-elasticache provides type annotations for boto3.
# The actual boto3 library handles runtime interactions.
aws_region = os.environ.get("AWS_REGION", "us-east-1")
try:
# Initialize ElastiCache client with type annotation for improved type checking
client: ElastiCacheClient = boto3.client("elasticache", region_name=aws_region)
# Example: Describe cache clusters
# The return type is automatically inferred by MyPy if stubs are installed,
# but can be explicitly annotated for clarity.
response: DescribeCacheClustersResultTypeDef = client.describe_cache_clusters()
print(f"Successfully described {len(response.get('CacheClusters', []))} ElastiCache clusters.")
for cluster in response.get('CacheClusters', []):
print(f" - {cluster['CacheClusterId']} ({cluster['Engine']})")
except Exception as e:
print(f"An error occurred: {e}")
print("Ensure AWS credentials and region are configured (e.g., via environment variables or ~/.aws/credentials).")
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0, support for Python 3.8 has been removed for all generated packages, including `mypy-boto3-elasticache`. Minimum required Python version is now 3.9.fixUpgrade your Python environment to 3.9 or newer.
affects: >=8.12.0 (builder), >=1.42.0 (stubs, approx)
breakingBeginning with `mypy-boto3-builder` version 8.9.0, there were breaking changes to `TypeDef` naming conventions (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). If you explicitly import and use these generated types, your code may require updates.fixReview your explicit `TypeDef` imports and update them according to the new naming conventions if type checking errors occur.
affects: >=8.9.0 (builder)
gotchaThese packages provide only type stubs. Do not attempt to instantiate clients or resources directly from `mypy_boto3_elasticache` modules at runtime. Always use `boto3.client('elasticache')` or `boto3.resource('elasticache')` for runtime operations.fixUse `boto3.client()` or `boto3.resource()` for runtime operations. The `mypy_boto3_elasticache` imports are solely for static type annotations.
affects: all
gotchaAWS service names can change or be deprecated (e.g., `sms-voice` was replaced by `pinpoint-sms-voice`). While this specific change doesn't affect ElastiCache, be aware that service module names in `mypy-boto3` packages may evolve with AWS service updates.fixRefer to AWS documentation and `mypy-boto3` release notes for changes in service names or available modules, especially after `boto3` or `mypy-boto3` upgrades.
affects: all
Upgrade
Version history
1.43.37latest on PyPI · released Jun 29, 2026
Audit
Dependencies
boto3requiredProvides the runtime AWS SDK for which these type stubs are generated. This library only provides types, not implementation.