Getting Started
Installation
pip install capo-waf
Usage
from capo_waf import AsyncWAFClient
async def main():
async with AsyncWAFClient() as waf:
# Example: call the create_byte_match_set operation
response = await waf.create_byte_match_set()
print(response["byte_match_set"])
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_waf import AsyncWAFClient
from capo_waf.error import WAFDisallowedNameException
async def main():
async with AsyncWAFClient() as waf:
try:
await waf.create_byte_match_set()
except WAFDisallowedNameException 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_waf import AsyncWAFClient
async def main():
async with AsyncWAFClient() as waf:
# Default: 3 attempts for every operation
response = await waf.create_byte_match_set()
# Override per operation
response = await waf.create_byte_match_set(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await waf.create_byte_match_set(config_overrides={"retry_max_attempts": 1})
Metadata
Release files for capo-waf 0.5.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_waf-0.5.0.tar.gz | 185.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_waf-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 679.9 kB
Release files / capo_waf-0.5.0.tar.gz
| Download URL | capo_waf-0.5.0.tar.gz |
|---|---|
| Size | 185.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1887e27360eb60465a1c882b5f4a8a0d8470973e6979fbd2e32f9a90884dd4c
|
|
BLAKE2b-256 checksum How to use checksums |
a61da5caceb9da50da98ce5d88dd6fbefacee70d8ec9b28414d3ff7e1d7f8d18
|
| 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_waf-0.5.0-py3-none-any.whl
| Download URL | capo_waf-0.5.0-py3-none-any.whl |
|---|---|
| Size | 494.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd9d73ae7035bcc5e5b65a5aeac1ea6ebce40944e12f241ae216ae9e33943479
|
|
BLAKE2b-256 checksum How to use checksums |
4dc6efbc4890a4ddda933241ac5afc94cc59c6f0cf51d918ce26941ee71a064e
|
| 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}
|