Getting Started
Installation
pip install capo-rolesanywhere
Usage
from capo_rolesanywhere import AsyncRolesAnywhereClient
async def main():
async with AsyncRolesAnywhereClient() as roles_anywhere:
# Example: call the list_tags_for_resource operation
response = await roles_anywhere.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_rolesanywhere import AsyncRolesAnywhereClient
from capo_rolesanywhere.error import AccessDeniedException
async def main():
async with AsyncRolesAnywhereClient() as roles_anywhere:
try:
await roles_anywhere.list_tags_for_resource()
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_rolesanywhere import AsyncRolesAnywhereClient
async def main():
async with AsyncRolesAnywhereClient() as roles_anywhere:
# Default: 3 attempts for every operation
response = await roles_anywhere.list_tags_for_resource()
# Override per operation
response = await roles_anywhere.list_tags_for_resource(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await roles_anywhere.list_tags_for_resource(config_overrides={"retry_max_attempts": 1})
Metadata
Release files for capo-rolesanywhere 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_rolesanywhere-0.1.0.tar.gz | 72.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_rolesanywhere-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 238.9 kB
Release files / capo_rolesanywhere-0.1.0.tar.gz
| Download URL | capo_rolesanywhere-0.1.0.tar.gz |
|---|---|
| Size | 72.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb36ddb522879dca9d34a95cce8f5f3cd453cae65cee777f425d80fee8af1bfc
|
|
BLAKE2b-256 checksum How to use checksums |
17d362383123cf30aa91fa05514f2cd0d54c628fd28f0f78eb70261877b44bca
|
| 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_rolesanywhere-0.1.0-py3-none-any.whl
| Download URL | capo_rolesanywhere-0.1.0-py3-none-any.whl |
|---|---|
| Size | 166.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ff0e671a85ce9e865b2417a64ca582ff363f865576c5faeee6b09bb7a57b3b5
|
|
BLAKE2b-256 checksum How to use checksums |
bee590062233711c0d7e13f9b0b04a79dfa93c574d5bda754d1b8460587b12ea
|
| 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}
|