Python SDK for the Hot Dev API
Project description
hot-dev
Official Python SDK for the Hot Dev API.
- PyPI distribution:
hot-dev - Import package:
hot - Tested on Python 3.10, 3.11, 3.12, 3.13
Install
pip install hot-dev
Quick Start
import os
from hot import HotClient
hot = HotClient(token=os.environ["HOT_API_KEY"])
# base_url defaults to https://api.hot.dev.
# For local development with `hot dev`, pass base_url="http://localhost:4681".
for event in hot.streams.subscribe_with_event(
{
"event_type": "team-agent:ask",
"event_data": {
"session_id": "web:chat:demo",
"user_id": "web:user:demo",
"user_name": "Demo User",
"question": "what is blocking launch?",
},
}
):
if event["type"] == "stream:data":
print(event["data_type"], event.get("payload"))
if event["type"] == "run:stop":
print(event.get("run", {}).get("result"))
break
The client closes its underlying HTTP connection cleanly when used as a context manager:
with HotClient(token=os.environ["HOT_API_KEY"]) as hot:
event = hot.events.publish(
{
"event_type": "team-agent:ask",
"event_data": {"question": "what changed?"},
}
)
print(event["stream_id"])
Authenticated clients should run server-side. Browser apps and public notebooks should call your own backend route instead of exposing a Hot API key.
Async Usage
import os
from hot import AsyncHotClient
async with AsyncHotClient(token=os.environ["HOT_API_KEY"]) as hot:
event = await hot.events.publish(
{
"event_type": "team-agent:ask",
"event_data": {"question": "what changed?"},
}
)
print(event["stream_id"])
Async streaming is supported the same way:
async with AsyncHotClient(token=os.environ["HOT_API_KEY"]) as hot:
async for event in hot.streams.subscribe_with_event(
{
"event_type": "team-agent:ask",
"event_data": {"question": "what changed?"},
}
):
print(event["type"], event)
Errors
Non-2xx API responses raise HotApiError with structured fields:
from hot import HotApiError
try:
hot.projects.get("missing-project")
except HotApiError as error:
print(error.status_code, error.code, error.request_id)
Resources
HotClient mirrors the Hot API v1 resources:
hot.events— publish, list, get, and inspect event runshot.streams— subscribe to run streams and publish events atomically (reconnects automatically across the 5-minute SSE timeout; passreconnect=Falseto opt out)hot.runs— list, inspect, and view run statshot.files— upload, download, list, and delete files (including multipart uploads)hot.projects— create, list, update, activate, deactivate, and delete projectshot.builds— upload, download, deploy, and look up live/deployed buildshot.context— manage encrypted project context variableshot.domains— register, verify, list, and delete custom domainshot.sessions— create and revoke scoped sessionshot.service_keys— create and revoke scoped service keyshot.org— view usage and limitshot.env— read environment info and subscribe to environment events
Use hot.request(...) or hot.request_raw(...) as an escape hatch for API
endpoints that do not yet have a resource helper.
Customizing the HTTP Client
HotClient and AsyncHotClient accept an httpx.Client (or
httpx.AsyncClient) via the client= argument. Use this to configure retries,
proxies, or custom transports:
import httpx
from hot import HotClient
http_client = httpx.Client(
timeout=httpx.Timeout(connect=5.0, read=60.0, write=30.0, pool=5.0),
transport=httpx.HTTPTransport(retries=3),
)
hot = HotClient(token=os.environ["HOT_API_KEY"], client=http_client)
When you pass your own client, the SDK does not close it on exit.
Casing Policy
Core API request and response payloads use the Hot API wire format:
event_type, event_data, stream_id, and so on. SDK-only options use Python
style names such as base_url and timeout.
The SDK never transforms user-owned payloads such as event_data.
Type Hints
The package ships with py.typed, so editors and type checkers will pick up
the public API. Request and response payloads are currently typed as plain
dict[str, Any] — keys follow the Hot API wire format documented above. Strict
TypedDict shapes generated from the Hot API OpenAPI spec are planned for a
future release.
Local Development
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
ruff check .
pytest
python -m build
Related
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hot_dev-1.1.1.tar.gz.
File metadata
- Download URL: hot_dev-1.1.1.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
291bab768f27a50ea3c37c42b37e02dc3e5bcce7d35cd7632549bff2b6db27d1
|
|
| MD5 |
5f6fcfcd9658d4bb79ad13f171033eda
|
|
| BLAKE2b-256 |
63ebfb9c331353d28fefa7b6a2c1600e972bc1038011239795b7426f2ae9d652
|
Provenance
The following attestation bundles were made for hot_dev-1.1.1.tar.gz:
Publisher:
release.yml on hot-dev/hot-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hot_dev-1.1.1.tar.gz -
Subject digest:
291bab768f27a50ea3c37c42b37e02dc3e5bcce7d35cd7632549bff2b6db27d1 - Sigstore transparency entry: 1575231366
- Sigstore integration time:
-
Permalink:
hot-dev/hot-python@5529e67b59f654c2adf262d8ba4046d29084f24d -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/hot-dev
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5529e67b59f654c2adf262d8ba4046d29084f24d -
Trigger Event:
push
-
Statement type:
File details
Details for the file hot_dev-1.1.1-py3-none-any.whl.
File metadata
- Download URL: hot_dev-1.1.1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37dfa0acdbe3d73e2dc8f0b62d99f34d53171fc7eefec1c17e7ec81948487620
|
|
| MD5 |
de2e6a73fc5cf113476ea37fa760d769
|
|
| BLAKE2b-256 |
c2477be7592f3c75580847b10394abb32f3cca36434cd97a0839fbf83b977f88
|
Provenance
The following attestation bundles were made for hot_dev-1.1.1-py3-none-any.whl:
Publisher:
release.yml on hot-dev/hot-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hot_dev-1.1.1-py3-none-any.whl -
Subject digest:
37dfa0acdbe3d73e2dc8f0b62d99f34d53171fc7eefec1c17e7ec81948487620 - Sigstore transparency entry: 1575231387
- Sigstore integration time:
-
Permalink:
hot-dev/hot-python@5529e67b59f654c2adf262d8ba4046d29084f24d -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/hot-dev
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5529e67b59f654c2adf262d8ba4046d29084f24d -
Trigger Event:
push
-
Statement type: