Install & Compatibility
Where this runs
tested against v1.43.75 · 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.915 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.5MB
glibcpy 3.10–3.915 runs
installs and imports cleanly · install 3.7s · import 0.000s · 21MB
53MB installed
● package 53MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RedshiftClient
✓ from mypy_boto3_redshift import RedshiftClient
✗ from mypy_boto3_redshift import RedshiftClient
RedshiftServiceResource
✓ from mypy_boto3_redshift import RedshiftServiceResource
ServiceResource
✓ from mypy_boto3_redshift import ServiceResource
This example demonstrates how to initialize a `boto3` Redshift client and call `describe_clusters` with full type annotations provided by `mypy-boto3-redshift`. It explicitly imports `RedshiftClient` for the client object and `DescribeClustersResponseTypeDef` for the response, enabling static analysis and IDE auto-completion.
import boto3
from mypy_boto3_redshift.client import RedshiftClient
from mypy_boto3_redshift.type_defs import DescribeClustersResponseTypeDef
def get_redshift_client() -> RedshiftClient:
"""Initializes and returns a type-hinted Redshift client."""
# boto3.client returns a Client, which mypy_boto3_redshift annotates
client: RedshiftClient = boto3.client("redshift")
return client
def describe_redshift_clusters(client: RedshiftClient) -> DescribeClustersResponseTypeDef:
"""Describes Redshift clusters with type hinting."""
response: DescribeClustersResponseTypeDef = client.describe_clusters(
ClusterIdentifier='my-redshift-cluster' # Replace with actual cluster ID
)
return response
if __name__ == "__main__":
redshift_client = get_redshift_client()
try:
clusters_info = describe_redshift_clusters(redshift_client)
print(f"Found {len(clusters_info['Clusters'])} Redshift clusters.")
for cluster in clusters_info['Clusters']:
print(f" - Cluster: {cluster['ClusterIdentifier']} Status: {cluster['ClusterStatus']}")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingSupport for Python 3.8 was removed starting with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 should either upgrade their Python version or pin `mypy-boto3-redshift` (and `boto3-stubs` if used) to an older version (e.g., <8.12.0 of the builder generation, which corresponds to `mypy-boto3-redshift` version prior to 1.42.42).fixUpgrade to Python 3.9+ or use an older version of the library compatible with Python 3.8.
affects: <8.12.0 of mypy-boto3-builder, and consequently mypy-boto3-redshift versions prior to 1.42.42 (released with builder 8.12.0).
breakingThe `mypy-boto3` family of packages (including `mypy-boto3-redshift`) migrated to PEP 561 compliant packages with `mypy-boto3-builder` 8.12.0. This change affects how type checkers discover stubs and generally improves compatibility, but older type checker configurations or environments might need adjustments.fixEnsure your type checker (e.g., `mypy`) is up-to-date and installed in the same environment as `mypy-boto3-redshift` to ensure correct stub discovery. No user-level code change is typically required for standard `boto3` usage.
affects: All packages generated by `mypy-boto3-builder` 8.12.0 and later.
gotcha`mypy-boto3-redshift` provides only type *stubs*. For your Python code to actually interact with AWS Redshift, you must have the `boto3` library itself installed in your environment. These stubs enhance `boto3` with type checking, but do not replace it.fixEnsure `boto3` is installed: `pip install boto3`.
affects: All versions
gotchaWhen using `mypy-boto3` stubs with PyCharm, there can be performance issues and high CPU usage due to PyCharm's handling of `Literal` overloads (issue PY-40997). This can lead to a slow IDE experience.fixConsider using `boto3-stubs-lite` (e.g., `pip install 'boto3-stubs-lite[redshift]'`) which is more RAM-friendly but might require more explicit type annotations. Alternatively, disable PyCharm's built-in type checker and rely on external tools like `mypy` or `pyright`.
affects: All versions, specifically impacting PyCharm users.
breakingWith `mypy-boto3-builder` version 8.9.0, some generated `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`). Code explicitly importing or referencing these generated type definition names may break.fixUpdate imports and type annotation references in your code to match the new, shortened `TypeDef` names. Consult the specific service's documentation for the exact new names if encountered.
affects: All packages generated by `mypy-boto3-builder` 8.9.0 and later.
Upgrade
Version history
1.43.75latest on PyPI · released Aug 19, 2026
Audit
Dependencies
boto3requiredProvides the runtime AWS SDK that these type stubs annotate.
mypyoptionalThe primary static type checker this library aims to support.
typing-extensionsoptionalRequired for some type features on Python versions < 3.9, automatically handled by install_requires.