Registry /
type-stubs / mypy-boto3-mediapackage
Install & Compatibility
Where this runs
tested against v1.43.0 · 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.600s · 84.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 5.5s · import 0.578s · 82MB
81MB installed
● package 81MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MediaPackageClient
✓ from mypy_boto3_mediapackage.client import MediaPackageClient
The typed client for the MediaPackage service.
MediaPackageServiceName
✓ from mypy_boto3_mediapackage.literals import MediaPackageServiceName
Literal type for the service name 'mediapackage', useful for type-safe client creation.
Session
✓ from boto3.session import Session
The standard boto3 session import, used to create clients.
This quickstart demonstrates how to initialize a `boto3` MediaPackage client and apply type annotations from `mypy-boto3-mediapackage`. Explicitly typing the client (`mediapackage_client: MediaPackageClient`) is crucial for enabling comprehensive type checking and autocompletion in IDEs.
import os
from boto3.session import Session
from mypy_boto3_mediapackage.client import MediaPackageClient
# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# For example: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME
# Using os.environ.get for example purposes, in real apps boto3 handles credentials automatically.
if not os.environ.get('AWS_ACCESS_KEY_ID'):
print("Warning: AWS_ACCESS_KEY_ID not set. Quickstart might fail if credentials are not configured.")
session = Session()
# Explicitly type the client for full type-hinting and autocompletion
mediapackage_client: MediaPackageClient = session.client("mediapackage")
# Example: List origin endpoints (replace with an actual method if needed)
try:
response = mediapackage_client.list_origin_endpoints()
print("Successfully listed MediaPackage origin endpoints.")
for endpoint in response.get('OriginEndpoints', []):
print(f" - Endpoint ID: {endpoint.get('Id')}, ARN: {endpoint.get('Arn')}")
except Exception as e:
print(f"Error listing origin endpoints: {e}")
Debug
Known issues
breakingPython 3.8 support has been officially removed. Users on Python 3.8 or older must upgrade to Python 3.9 or newer to use versions 8.12.0+ of `mypy-boto3-builder` generated stubs.fixUpgrade your Python environment to 3.9 or a later version.
affects: mypy-boto3-builder 8.12.0+, mypy-boto3-mediapackage 1.42.0+
breakingThe `mypy-boto3` ecosystem migrated to PEP 561 compliant packages. While generally an improvement, this might affect how `mypy` discovers stubs in certain environments or custom build setups.fixEnsure `mypy` is run in the same Python environment where `mypy-boto3-mediapackage` is installed. Review `mypy`'s documentation on PEP 561 for advanced scenarios if issues arise with stub discovery. Using `boto3-stubs` with service extras (`pip install 'boto3-stubs[mediapackage]'`) is generally recommended for seamless integration.
affects: mypy-boto3-builder 8.12.0+, mypy-boto3-mediapackage 1.42.0+
breakingBreaking changes were introduced to TypeDef naming conventions. Specifically, `CreateDistributionRequestRequestTypeDef` was shortened to `CreateDistributionRequestTypeDef`, and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).fixReview and update any explicit references to `TypeDef` objects in your code to match the new naming conventions. Consult the `mypy-boto3` documentation for the specific service for the correct `TypeDef` names.
affects: mypy-boto3-builder 8.9.0+, mypy-boto3-mediapackage versions generated by these builders.
gotchaFor optimal type checking and IDE autocompletion, it is highly recommended to explicitly type annotate `boto3.client()` and `boto3.resource()` calls with the specific `mypy-boto3` client or resource type (e.g., `client: MediaPackageClient = session.client('mediapackage')`). While `mypy` can often infer types, explicit annotation provides the most robust experience.fixAlways add explicit type annotations when creating `boto3` clients or resources, leveraging the `Client` and `ServiceResource` types from the respective `mypy-boto3` service package.
affects: All versions
gotchaThe `Session.client` and global `boto3.client` methods gained an `aws_account_id` argument. This new feature allows specifying the AWS account ID when creating a client, which can be useful for certain cross-account operations or internal tooling.fixBe aware of the new `aws_account_id` parameter if your workflows could benefit from it, and update your client creation calls if necessary to utilize it.
affects: mypy-boto3-builder 8.10.1+, mypy-boto3-mediapackage versions generated by these builders.
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
pythonrequiredRequired for runtime.
boto3requiredRuntime dependency for which type stubs are provided. This package provides no runtime functionality itself.
mypyoptionalThe static type checker for which these stubs are primarily intended.