Install & Compatibility
Where this runs
tested against v1.43.20 · 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 · 18.4MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.8s · import 0.000s · 19MB
71MB installed
● package 71MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TranscribeClient
✓ from mypy_boto3_transcribe import TranscribeClient
✗ from mypy_boto3_transcribe import TranscribeClient
This quickstart demonstrates how to obtain a type-hinted `TranscribeClient` using `boto3` and `typing.cast`. It then shows a simple usage example to list transcription jobs, highlighting how `mypy` can provide static analysis for `boto3` calls.
import boto3
from mypy_boto3_transcribe.client import TranscribeClient
from typing import TYPE_CHECKING, cast
import os
# Boto3 client requires AWS credentials, which can be configured via
# environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
# or other boto3 configuration methods.
if TYPE_CHECKING:
# This block is only for type checking tools like mypy or pyright.
# It helps prevent runtime import issues and ensures correct type resolution.
pass
def get_typed_transcribe_client() -> TranscribeClient:
"""Returns a type-hinted boto3 Transcribe client."""
# boto3.client returns a DynamicClient which is untyped.
# We cast it to the specific mypy-boto3-transcribe client type.
client = boto3.client("transcribe", region_name=os.environ.get('AWS_REGION', 'us-east-1'))
return cast(TranscribeClient, client)
# --- Example Usage ---
transcribe_client = get_typed_transcribe_client()
print("Listing first 3 transcription jobs:")
response = transcribe_client.list_transcription_jobs(
MaxResults=3,
Status='COMPLETED' # Example filter
)
job_summaries = response.get("TranscriptionJobSummaries", [])
if job_summaries:
for job in job_summaries:
print(f" - Name: {job['TranscriptionJobName']}, Status: {job['TranscriptionJobStatus']}")
else:
print(" No completed transcription jobs found.")
# mypy will now correctly check arguments and return types for methods of transcribe_client
# e.g., transcribe_client.start_transcription_job(TranscriptionJobName=123) will be flagged
# as TranscriptionJobName expects a string.
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generates these stub packages), Python 3.8 is no longer supported. Additionally, all generated packages migrated to PEP 561, which might affect environments relying on older packaging patterns.fixUpgrade your Python environment to 3.9 or newer. Ensure your `pip` and `setuptools` are up-to-date for proper PEP 561 package handling.
affects: mypy-boto3-transcribe >= 1.42.25 (corresponding to builder 8.12.0+)
gotchaWhen using `mypy-boto3` for a specific service like Transcribe, you generally need to install the service-specific stub package (e.g., `mypy-boto3-transcribe`). Installing just `mypy-boto3` provides stubs for all services but can be a significantly larger dependency.fixFor specific service stubs, use `pip install mypy-boto3-<service-name>`. If you need stubs for all services, `pip install mypy-boto3` is sufficient.
affects: All versions
gotchaTo leverage type hints, you must cast the `boto3.client()` return value to the specific `mypy-boto3` client type (e.g., `TranscribeClient`). Without the `cast`, `mypy` will only see the untyped `botocore.client.Client`.fixAlways use `typing.cast` (preferably within a `TYPE_CHECKING` block) to explicitly type your `boto3` client instance, like `client = cast(TranscribeClient, boto3.client('transcribe'))`. affects: All versions
gotchaThe `mypy-boto3-*` packages are generated based on specific `boto3` and underlying `botocore` versions. Using an older stub package with a newer `boto3` version (or vice-versa) can lead to incorrect or missing type hints, as the API might have changed.fixKeep your `mypy-boto3-<service>` package version as close as possible to your `boto3` runtime version. Regularly update both to ensure consistency.
affects: All versions
breakingFrom `mypy-boto3-builder` version 8.9.0, there were breaking changes in `TypeDef` naming conventions. For instance, `CreateDistributionRequestRequestTypeDef` was shortened to `CreateDistributionRequestTypeDef`, and `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`).fixReview and update your custom `TypeDef` annotations to match the new naming conventions if you are upgrading from an older `mypy-boto3` version.
affects: mypy-boto3-transcribe generated by builder 8.9.0+
Upgrade
Version history
1.43.20latest on PyPI · released Jun 2, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for the `boto3` library; `boto3` itself is required for runtime functionality.