Getting Started
Installation
pip install capo-iam
Usage
from capo_iam import AsyncIAMClient
async def main():
async with AsyncIAMClient() as iam:
# Example: call the accept_delegation_request operation
response = await iam.accept_delegation_request()
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 capo_iam import AsyncIAMClient
async def main():
async with AsyncIAMClient() as iam:
# Example: paginate over get_account_authorization_details
async for item in iam.iter_get_account_authorization_details():
print(item)
Waiters
Waiters poll an operation until a resource reaches a desired state. If the operation supports waiters it will have a wait_until_ prefixed method.
from capo_iam import AsyncIAMClient
async def main():
async with AsyncIAMClient() as iam:
# Example: wait for instance_profile_exists
await iam.wait_until_instance_profile_exists(max_wait_time=300)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_iam import AsyncIAMClient
from capo_iam.error import ConcurrentModificationException
async def main():
async with AsyncIAMClient() as iam:
try:
await iam.accept_delegation_request()
except ConcurrentModificationException 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 import AsyncIAMClient
async def main():
async with AsyncIAMClient() as iam:
# Default: 3 attempts for every operation
response = await iam.accept_delegation_request()
# Override per operation
response = await iam.accept_delegation_request(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await iam.accept_delegation_request(config_overrides={"retry_max_attempts": 1})
Metadata
Release files for capo-iam 0.18.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-0.18.0.tar.gz | 408.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_iam-0.18.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.5 MB
Release files / capo_iam-0.18.0.tar.gz
| Download URL | capo_iam-0.18.0.tar.gz |
|---|---|
| Size | 408.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5edbb1f88f7465464ef9f99b614bd056d2fe18fca7aae43923ec5fd5b397255
|
|
BLAKE2b-256 checksum How to use checksums |
7408794f398f86422ff4dd8ec9769ef7174c5ccf2379e37eb2d1d21d2e680a2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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-0.18.0-py3-none-any.whl
| Download URL | capo_iam-0.18.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86a1308493f8a5fd1bc72f79fbbcd4a07a8c1877e98e19f3eda2d7a93fc31c7c
|
|
BLAKE2b-256 checksum How to use checksums |
3db448a9d506620f16b791a08d8e3aecfd649e0a4f868ef248913203b2caf2bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}
|