Getting Started
Installation
pip install capo-mediapackagev2
Usage
from capo_mediapackagev2 import AsyncMediaPackageV2Client
async def main():
async with AsyncMediaPackageV2Client() as media_package_v2:
# Example: call the list_tags_for_resource operation
response = await media_package_v2.list_tags_for_resource()
print(response["tags"])
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_mediapackagev2 import AsyncMediaPackageV2Client
from capo_mediapackagev2.error import ValidationException
async def main():
async with AsyncMediaPackageV2Client() as media_package_v2:
try:
await media_package_v2.list_tags_for_resource()
except ValidationException as e:
print(f"Error: {e}")
print(e.data) # additional error data
Retrying
The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their is_retryable and is_throttling_error attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the @retryable trait, are raised immediately without further attempts.
The number of attempts defaults to 3 and can be changed at the client level via retry_max_attempts, or per call via config_overrides.
from capo_mediapackagev2 import AsyncMediaPackageV2Client
async def main():
async with AsyncMediaPackageV2Client() as media_package_v2:
# Default: 3 attempts for every operation
response = await media_package_v2.list_tags_for_resource()
# Override per operation
response = await media_package_v2.list_tags_for_resource(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await media_package_v2.list_tags_for_resource(config_overrides={"retry_max_attempts": 1})
Release files for capo-mediapackagev2 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| capo_mediapackagev2-0.1.0.tar.gz | 109.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_mediapackagev2-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 376.8 kB
Release files / capo_mediapackagev2-0.1.0.tar.gz
| Download URL | capo_mediapackagev2-0.1.0.tar.gz |
|---|---|
| Size | 109.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c556340e5f6d6b4d63fd3bd8a5e145d7de1e55f47443ace1cf97cc8388b0205
|
|
BLAKE2b-256 checksum How to use checksums |
311aeeda217682a4801b2c3c57bcca1d5cc2f6dce048eef210d3bf859afbeaa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capo_mediapackagev2-0.1.0-py3-none-any.whl
| Download URL | capo_mediapackagev2-0.1.0-py3-none-any.whl |
|---|---|
| Size | 267.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58a7fe308e36c70ccfc5dc97ce83fdf4ee2bf385677013fa530e5bbc49385013
|
|
BLAKE2b-256 checksum How to use checksums |
70e48035ba20637e25a74c52035f13670c671d8a055b47083461b190165645f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|