mypy-boto3-medialive Type Annotations
This library provides type annotations (stubs) for the `boto3` MediaLive client, allowing static type checkers like MyPy to validate usage of `boto3`. It is currently at version 1.42.86 and receives frequent updates, often aligning with `boto3`/`botocore` releases and `mypy-boto3-builder` updates, which is the underlying generation tool.
Warnings
- deprecated The `mypy-boto3-*` package naming scheme is considered legacy and deprecated by the maintainers. It is highly recommended to migrate to the `boto3-stubs-*` equivalent packages (e.g., `boto3-stubs-medialive`) for future updates and better feature support.
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Packages generated with this builder, including `mypy-boto3-medialive` 1.42.86 and newer, will no longer support Python 3.8.
- gotcha This library provides type *stubs* only; it does not replace or include the actual `boto3` runtime library. You must install `boto3` separately for your code to function at runtime.
- breaking Type definition naming conventions changed in `mypy-boto3-builder` version 8.9.0. This caused potential breaking changes in TypeDef names for all generated services. For instance, `CreateDistributionRequestRequestTypeDef` might have been shortened to `CreateDistributionRequestTypeDef`, or `Extra` postfixes moved.
Install
-
pip install mypy-boto3-medialive
Imports
- MediaLiveClient
from mypy_boto3_medialive import MediaLiveClient
- BatchUpdateScheduleRequestRequestTypeDef
from mypy_boto3_medialive.type_defs import BatchUpdateScheduleRequestRequestTypeDef
Quickstart
import boto3
from mypy_boto3_medialive import MediaLiveClient
def get_medialive_client() -> MediaLiveClient:
"""Returns a typed MediaLive client."""
# Boto3 client creation remains the same, but now with type hints
client: MediaLiveClient = boto3.client("medialive")
return client
# Example usage with type checking
medialive_client = get_medialive_client()
response = medialive_client.list_channels()
print(f"MediaLive channels: {len(response.get('Channels', []))}")