Metadata-Version: 2.4
Name: runstate-sdk
Version: 0.2.0
Summary: runstate SDK: resource handles and safe lifecycle helpers for the coordination kernel
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Requires-Dist: anyio; extra == "test"

# runstate (Python SDK)

Resource handles and safe lifecycle helpers for the runstate coordination kernel.

```python
from runstate import Runstate

bus = Runstate()  # reads RUNSTATE_API_KEY / RUNSTATE_SPACE_ID / RUNSTATE_BASE_URL
run = bus.scopes.create(name="research")
run.mailbox("research").send({"topic": "fusion energy"})
```

- `AsyncRunstate` — primary async client (httpx).
- `Runstate` — blocking facade running the async client on one dedicated
  event-loop thread; sync handlers are offloaded so renewal is never blocked.
- Safe helpers: single-flight lease renewal, fail-closed lease loss, bounded
  retries, reconnectable `events.watch`, and run diagnostics.

## Install

```sh
pip install runstate-sdk
```
