Getting Started
Installation
pip install capo-greengrass
Usage
from capo_greengrass import AsyncGreengrassClient
async def main():
async with AsyncGreengrassClient() as greengrass:
# Example: call the associate_role_to_group operation
response = await greengrass.associate_role_to_group()
print(response["associated_at"])
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_greengrass import AsyncGreengrassClient
from capo_greengrass.error import BadRequestException
async def main():
async with AsyncGreengrassClient() as greengrass:
try:
await greengrass.associate_role_to_group()
except BadRequestException 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_greengrass import AsyncGreengrassClient
async def main():
async with AsyncGreengrassClient() as greengrass:
# Default: 3 attempts for every operation
response = await greengrass.associate_role_to_group()
# Override per operation
response = await greengrass.associate_role_to_group(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await greengrass.associate_role_to_group(config_overrides={"retry_max_attempts": 1})
Release files for capo-greengrass 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_greengrass-0.1.0.tar.gz | 125.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_greengrass-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 546.8 kB
Release files / capo_greengrass-0.1.0.tar.gz
| Download URL | capo_greengrass-0.1.0.tar.gz |
|---|---|
| Size | 125.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37beccf9a445ba21cea9e69ce39c251ed725f891ad75c341a5c32f81841af5a2
|
|
BLAKE2b-256 checksum How to use checksums |
548cc5a1506f25829f101e01d482c82ce7a190ca34c31eb9809a6bf23b731faa
|
| 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_greengrass-0.1.0-py3-none-any.whl
| Download URL | capo_greengrass-0.1.0-py3-none-any.whl |
|---|---|
| Size | 421.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4271b97e7fc2b2ce9e57d48f158b2b15e061ec7ac712a6e218c5853f385e2acf
|
|
BLAKE2b-256 checksum How to use checksums |
88920c1836f2c059099c43b916eee65f238f2755f714f588495353a8d9c1aa14
|
| 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}
|