Getting Started
Installation
pip install capo-iam-toolbox
Usage
from capo_iam_toolbox import AsyncIAMToolboxClient
async def main():
async with AsyncIAMToolboxClient() as iam_toolbox:
# Example: call the get_request_authorization_details operation
response = await iam_toolbox.get_request_authorization_details()
print(response["request_context"])
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 capo_iam_toolbox import AsyncIAMToolboxClient
async def main():
async with AsyncIAMToolboxClient() as iam_toolbox:
# Example: paginate over get_request_authorization_details
async for item in iam_toolbox.iter_get_request_authorization_details():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_iam_toolbox import AsyncIAMToolboxClient
from capo_iam_toolbox.error import AccessDeniedException
async def main():
async with AsyncIAMToolboxClient() as iam_toolbox:
try:
await iam_toolbox.get_request_authorization_details()
except AccessDeniedException 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_iam_toolbox import AsyncIAMToolboxClient
async def main():
async with AsyncIAMToolboxClient() as iam_toolbox:
# Default: 3 attempts for every operation
response = await iam_toolbox.get_request_authorization_details()
# Override per operation
response = await iam_toolbox.get_request_authorization_details(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await iam_toolbox.get_request_authorization_details(config_overrides={"retry_max_attempts": 1})
Metadata
Release files for capo-iam-toolbox 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_iam_toolbox-0.1.0.tar.gz | 55.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_iam_toolbox-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 123.1 kB
Release files / capo_iam_toolbox-0.1.0.tar.gz
| Download URL | capo_iam_toolbox-0.1.0.tar.gz |
|---|---|
| Size | 55.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99599239801d1abb34817d5b8b2c5a59f784c6f18104431a1da08300f5a91403
|
|
BLAKE2b-256 checksum How to use checksums |
71fb41c7ebc7dfda4b7be17ff461d53e961c0f3f1c89da6c04af57d9b1b0dd4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.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}
|
Release files / capo_iam_toolbox-0.1.0-py3-none-any.whl
| Download URL | capo_iam_toolbox-0.1.0-py3-none-any.whl |
|---|---|
| Size | 67.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96b48f57b40312f661feb4478aaec7ddbfb50a9e54af3fa856c0bcc198ba8b50
|
|
BLAKE2b-256 checksum How to use checksums |
ac3cd90db65d8f3f7a7ed814b1a0ed54a6ceda016a714694ddbd557049dbac53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.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}
|