Metadata-Version: 2.4
Name: stormwateriq-api-client
Version: 0.1.1
Summary: Official Python client for the StormwaterIQ external API (typed client, webhook signature verifier, retry helpers).
Project-URL: Homepage, https://github.com/stewartmoreland/stormwater-iq/tree/main/packages/sdk-py#readme
Project-URL: Repository, https://github.com/stewartmoreland/stormwater-iq
Project-URL: Issues, https://github.com/stewartmoreland/stormwater-iq/issues
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# stormwateriq-api-client

Official Python client for the StormwaterIQ external API: a typed-ish client, the
reference webhook-signature verifier, and automatic retries.

```bash
pip install stormwateriq-api-client
```

```python
from stormwateriq_api_client import StormwaterIQClient, verify

with StormwaterIQClient("https://api.stormwateriq.com", access_token) as client:
    site = client.get_site("site_123")

# Verify an inbound webhook (constant-time, replay-protected):
ok = verify(raw_body, request.headers["X-StormwaterIQ-Signature"], signing_secret)
```

- **Retries** — requests retry 429 (honoring `Retry-After`) and 5xx with exponential
  backoff (`max_retries`, default 3); other 4xx raise `ApiError`.
- **Webhook verifier** — `verify(payload, signature, secret)` is stdlib-only
  (`hmac`/`hashlib`) and byte-identical to the server and the TypeScript SDK, pinned to
  `fixtures/webhook-signature-vectors.json`. Importing the verifier never requires
  `httpx` (the client is lazily imported).

## Generation

Models track the gateway's OpenAPI document
(`https://api.stormwateriq.com/v1/openapi.json`); regenerate with
`openapi-python-client` when the spec changes. Published independently of the API
(semver).
