Registry / type-stubs / mypy-boto3-mediaconvert

mypy-boto3-mediaconvert

JSON →
library1.43.63pypypi✓ verified 23d ago

mypy-boto3-mediaconvert provides type annotations for the boto3 MediaConvert service, enhancing static analysis and IDE support for Python developers working with AWS. It ensures early error detection and improved code readability. This package is part of the larger `mypy-boto3-builder` ecosystem, which frequently releases updates in sync with `boto3` versions.

pip install mypy-boto3-mediaconvert boto3 mypy
INSTALL
IMPORT
SIG · MYPY-BOTO3-MEDIACO
M
mypy-boto3-mediaconvert
type-stubspythonv1.43.63
Install
7.7s avg
Import
756ms
Disk
116MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.63 · 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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.780s · 118.5MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.7s · import 0.732s · 116MB
116MB installed
● package 116MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MediaConvertClient
from mypy_boto3_mediaconvert.client import MediaConvertClient
CreateJobRequestTypeDef
from mypy_boto3_mediaconvert.type_defs import CreateJobRequestTypeDef
CreateJobResponseTypeDef
from mypy_boto3_mediaconvert.type_defs import CreateJobResponseTypeDef
AacAudioDescriptionBroadcasterMixType
from mypy_boto3_mediaconvert.literals import AacAudioDescriptionBroadcasterMixType
TYPE_CHECKING
from typing import TYPE_CHECKING
Commonly used with an 'if TYPE_CHECKING:' block to avoid runtime dependency.
client
from boto3 import client
from mypy_boto3_mediaconvert.client import client
The client object itself is from boto3, mypy-boto3 provides the type definition for it.

This quickstart demonstrates how to use `mypy-boto3-mediaconvert` for type-hinting a boto3 MediaConvert client. It shows how to import the client type and associated TypedDicts for request and response structures, enabling static analysis and IDE autocompletion. Ensure `boto3` is installed and AWS credentials are configured.

import os from typing import TYPE_CHECKING, Dict, Any import boto3 # These imports are only for type checking, not for runtime execution if TYPE_CHECKING: from mypy_boto3_mediaconvert.client import MediaConvertClient from mypy_boto3_mediaconvert.type_defs import CreateJobRequestTypeDef, CreateJobResponseTypeDef def create_sample_job(role_arn: str, s3_input_url: str, s3_output_bucket: str) -> Dict[str, Any]: # In a real application, consider using AWS credentials from environment variables # or ~/.aws/credentials. For quickstart, we assume they are configured. # The client variable is explicitly typed for static analysis client: 'MediaConvertClient' = boto3.client("mediaconvert", region_name=os.environ.get('AWS_REGION', 'us-east-1')) job_settings: Dict[str, Any] = { "Inputs": [ { "AudioSelectors": {"Audio Selector 1": {"DefaultSelection": "DEFAULT"}}, "FileInput": s3_input_url, } ], "OutputGroups": [ { "Name": "File Group", "OutputGroupSettings": { "Type": "FILE_GROUP_SETTINGS", "FileGroupSettings": {"Destination": f"s3://{s3_output_bucket}/"}, }, "Outputs": [ { "ContainerSettings": {"Container":"MP4","Mp4Settings":{}}, "VideoDescription": {"CodecSettings": {"Codec": "H_264"}}, "AudioDescriptions": [ {"CodecSettings": {"Codec": "AAC"}} ], } ], } ], } request_params: 'CreateJobRequestTypeDef' = { "Role": role_arn, "Settings": job_settings, "Queue": os.environ.get('MEDIACONVERT_QUEUE_ARN', 'arn:aws:mediaconvert:us-east-1:123456789012:queues/Default') } try: response: 'CreateJobResponseTypeDef' = client.create_job(**request_params) print("Successfully created MediaConvert job.") print(f"Job ID: {response['Job']['Id']}") return response except client.exceptions.BadRequestException as e: print(f"Bad request: {e}") raise except Exception as e: print(f"An unexpected error occurred: {e}") raise if __name__ == "__main__": # Example usage: Replace with actual values and ensure AWS credentials/config are set. # For a runnable example, you need a valid AWS account, MediaConvert permissions, # an S3 input file, an S3 output bucket, and a MediaConvert queue. # Using placeholder environment variables for demonstration. ROLE_ARN = os.environ.get('MEDIACONVERT_ROLE_ARN', 'arn:aws:iam::123456789012:role/MediaConvertRole') S3_INPUT_URL = os.environ.get('S3_INPUT_VIDEO_URL', 's3://your-input-bucket/input.mp4') S3_OUTPUT_BUCKET = os.environ.get('S3_OUTPUT_BUCKET', 'your-output-bucket') if not all([ROLE_ARN, S3_INPUT_URL, S3_OUTPUT_BUCKET, os.environ.get('AWS_REGION'), os.environ.get('MEDIACONVERT_QUEUE_ARN')]): print("Warning: Please set MEDIACONVERT_ROLE_ARN, S3_INPUT_VIDEO_URL, S3_OUTPUT_BUCKET, AWS_REGION, and MEDIACONVERT_QUEUE_ARN environment variables for a real test.") print("Using dummy values for demonstration.") # Proceed with dummy values for type checking demonstration even if not runnable _ = create_sample_job(ROLE_ARN, S3_INPUT_URL, S3_OUTPUT_BUCKET) else: create_sample_job(ROLE_ARN, S3_INPUT_URL, S3_OUTPUT_BUCKET)
Debug
Known issues
breakingPython 3.8 support was removed with mypy-boto3-builder 8.12.0. Projects requiring type annotations must use Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or later.
affects: >=8.12.0 of mypy-boto3-builder (which generates mypy-boto3-* packages)
breakingTypeDef names for packed method arguments and conflicting TypeDef `Extra` postfixes were changed in mypy-boto3-builder 8.9.0. This might break existing type annotations that used the old naming conventions.
fix
Review and update `TypeDef` import paths and names to match the new conventions (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).
affects: >=8.9.0 of mypy-boto3-builder
gotcha`mypy-boto3-mediaconvert` (and other `mypy-boto3` packages) are solely for type-checking and are not runtime dependencies. To avoid unnecessary runtime overhead, always guard type-only imports with `if TYPE_CHECKING:` or ensure `mypy-boto3` packages are only installed in development environments.
fix
Wrap type-only imports within `if TYPE_CHECKING:` blocks: `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_mediaconvert.client import MediaConvertClient`.
affects: All
gotcha`mypy-boto3-mediaconvert` does not install `boto3`. You must install `boto3` separately for your application to function at runtime.
fix
Ensure `boto3` is installed alongside `mypy-boto3-mediaconvert` (e.g., `pip install boto3 mypy-boto3-mediaconvert`).
affects: All
gotchaPyCharm users might experience slow performance with `Literal` overloads. Consider using `boto3-stubs-lite` if performance issues occur.
fix
Install `boto3-stubs-lite` instead of the full `boto3-stubs` or `mypy-boto3-*` packages, or disable PyCharm's internal type checker and use `mypy`/`pyright` externally.
affects: All
gotchaHistorically, `boto3-stubs` and `mypy-boto3` were somewhat distinct. `mypy-boto3` (and its per-service packages like `mypy-boto3-mediaconvert`) is the actively maintained and recommended solution. For broad coverage and easier management of `session.client`/`resource` overloads, using `boto3-stubs[service_name]` is often preferred.
fix
Prefer `pip install 'boto3-stubs[mediaconvert]'` for consistency and comprehensive type coverage, especially if using `boto3.session.Session().client()`.
affects: All
Upgrade
Version history
1.43.63latest on PyPI · released Aug 3, 2026
Audit
Dependencies
boto3requiredRuntime dependency for AWS SDK functionality.
mypyrequiredStatic type checker for leveraging type annotations.
Agent activity
23 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
mypy-boto3-mediaconvert — pip install mypy-boto3-mediaconvert · libregistry