Python SDK for Batch.
Project description
Getting Started
Installation
pip install aws-sdk-batch
Usage
from aws_sdk_batch import AsyncBatchClient
async def main():
async with AsyncBatchClient() as s3:
# Example: call the cancel_job operation
response = await s3.cancel_job()
print(response)
Pagination
Some operations in this SDK support pagination. If the operation supports pagination it will have an iter_ prefixed method that returns an async iterator.
from aws_sdk_batch import AsyncBatchClient
async def main():
async with AsyncBatchClient() as s3:
# Example: paginate over describe_compute_environments
async for item in s3.iter_describe_compute_environments():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from aws_sdk_batch import AsyncBatchClient
from aws_sdk_batch.error import ClientException
async def main():
async with AsyncBatchClient() as s3:
try:
await s3.cancel_job()
except ClientException 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 aws_sdk_batch import AsyncBatchClient
async def main():
async with AsyncBatchClient() as s3:
# Default: 3 attempts for every operation
response = await s3.cancel_job()
# Override per operation
response = await s3.cancel_job(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await s3.cancel_job(config_overrides={"retry_max_attempts": 1})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_sdk_batch-0.1.0.tar.gz.
File metadata
- Download URL: aws_sdk_batch-0.1.0.tar.gz
- Upload date:
- Size: 211.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70ebccecaacffe82d68255c2eb72f762c956d6979b09e13a61971a71a1eeb0cf
|
|
| MD5 |
007b36b660e924d0c65e975c681883d0
|
|
| BLAKE2b-256 |
aefa9d2bcb3ccbd97df2c1e722c45c2589f194612744e533ad818b6e951a3232
|
File details
Details for the file aws_sdk_batch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aws_sdk_batch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 477.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f17e892e9abe3b15441ce1595b105604445aa64effffb8594d7d582628c8e6f1
|
|
| MD5 |
8d3a9cb71683a252cd2019c8b6183fcf
|
|
| BLAKE2b-256 |
3664e39e6d487dd4c56ecebabb02f6bdc41d2b9ef853b385e4d3dfdb3ffce202
|