Getting Started
Installation
pip install capo-iot-events
Usage
from capo_iot_events import AsyncIoTEventsClient
async def main():
async with AsyncIoTEventsClient() as io_t_events:
# Example: call the create_alarm_model operation
response = await io_t_events.create_alarm_model()
print(response["creation_time"])
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_iot_events import AsyncIoTEventsClient
from capo_iot_events.error import InternalFailureException
async def main():
async with AsyncIoTEventsClient() as io_t_events:
try:
await io_t_events.create_alarm_model()
except InternalFailureException 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_iot_events import AsyncIoTEventsClient
async def main():
async with AsyncIoTEventsClient() as io_t_events:
# Default: 3 attempts for every operation
response = await io_t_events.create_alarm_model()
# Override per operation
response = await io_t_events.create_alarm_model(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await io_t_events.create_alarm_model(config_overrides={"retry_max_attempts": 1})
Metadata
Release files for capo-iot-events 0.2.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_iot_events-0.2.0.tar.gz | 109.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_iot_events-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 358.7 kB
Release files / capo_iot_events-0.2.0.tar.gz
| Download URL | capo_iot_events-0.2.0.tar.gz |
|---|---|
| Size | 109.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db02c2300d3aab22b6fdb0b62adb8bf891dff471a43c0b2a2230739451c6c4bb
|
|
BLAKE2b-256 checksum How to use checksums |
7a7363d252e2aa13abfb405c5a1dccfb7d77f47e758f802fcdbbd457ae7cd522
|
| 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_iot_events-0.2.0-py3-none-any.whl
| Download URL | capo_iot_events-0.2.0-py3-none-any.whl |
|---|---|
| Size | 249.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7701a548b7b0ce85bc99bf1ea3bedcbd8d0f689dfb120a59032ca346b2a127a
|
|
BLAKE2b-256 checksum How to use checksums |
2be7cd5398cc94d99ba682f79f024210536a59f4eb0e3df37a8a82e9681a954d
|
| 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}
|