DevHelm SDK for Python — typed client for monitors, incidents, alerting, and more
Project description
DevHelm Python SDK
Typed Python client for the DevHelm monitoring API — monitors, incidents, alerting, and more.
Installation
pip install devhelm
Quick Start
from devhelm import Devhelm
client = Devhelm(
token="your-api-token",
org_id="your-org-id",
workspace_id="your-workspace-id",
)
# List all monitors
monitors = client.monitors.list()
for m in monitors:
print(f"{m.name} — {m.type}")
# Create a monitor
monitor = client.monitors.create({
"name": "My API Health",
"type": "HTTP",
"config": {"url": "https://api.example.com/health", "method": "GET"},
"frequencySeconds": 60,
"regions": ["us-east"],
})
# Get a single monitor
monitor = client.monitors.get(monitor.id)
# Pause / resume
client.monitors.pause(monitor.id)
client.monitors.resume(monitor.id)
# Delete
client.monitors.delete(monitor.id)
Configuration
from devhelm import Devhelm
client = Devhelm(
token="your-api-token", # required (or DEVHELM_API_TOKEN env var)
org_id="1", # required (or DEVHELM_ORG_ID env var)
workspace_id="1", # required (or DEVHELM_WORKSPACE_ID env var)
base_url="https://api.devhelm.io", # optional, defaults to production
)
Environment variables are used as fallbacks when constructor arguments are not provided:
| Parameter | Env Variable |
|---|---|
token |
DEVHELM_API_TOKEN |
org_id |
DEVHELM_ORG_ID |
workspace_id |
DEVHELM_WORKSPACE_ID |
Resources
The client exposes the following resource modules:
| Resource | Description |
|---|---|
client.monitors |
HTTP, DNS, TCP, ICMP, MCP, and Heartbeat monitors |
client.incidents |
Manual and auto-detected incidents |
client.alert_channels |
Slack, email, webhook, and other alert channels |
client.notification_policies |
Routing rules for alerts |
client.environments |
Environment grouping (prod, staging, etc.) |
client.secrets |
Encrypted secrets for monitor auth |
client.tags |
Organize monitors with tags |
client.resource_groups |
Logical resource groups |
client.webhooks |
Outgoing webhook endpoints |
client.api_keys |
API key management |
client.dependencies |
Service dependency tracking |
client.deploy_lock |
Deploy lock for safe deployments |
client.status |
Dashboard overview |
Pagination
List methods auto-paginate by default. For manual page control:
# Auto-paginate (fetches all pages)
all_monitors = client.monitors.list()
# Manual page control
page = client.monitors.list_page(page=0, size=20)
print(page.data) # list of monitors
print(page.has_next) # True if more pages
print(page.has_prev) # True if previous page exists
# Cursor pagination (for check results)
results = client.monitors.results(monitor_id, limit=50)
print(results.data)
print(results.next_cursor)
print(results.has_more)
Error Handling
from devhelm import Devhelm, DevhelmError, AuthError
client = Devhelm(token="bad-token", org_id="1", workspace_id="1")
try:
client.monitors.list()
except AuthError as e:
print(f"Auth failed: {e.message} (HTTP {e.status})")
except DevhelmError as e:
print(f"API error [{e.code}]: {e.message}")
Error codes: AUTH, NOT_FOUND, CONFLICT, VALIDATION, API.
Development
# Install dependencies
uv sync
# Run tests
make test
# Lint + format check
make lint
# Type check
make typecheck
# Regenerate types from OpenAPI spec
make typegen
License
MIT
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 devhelm-0.1.2.tar.gz.
File metadata
- Download URL: devhelm-0.1.2.tar.gz
- Upload date:
- Size: 174.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c01a8f903421116f39176177861796b482e616fb13721c47a31fae559de0cc7
|
|
| MD5 |
7b1ccefc121cb573b499832b9c62ac14
|
|
| BLAKE2b-256 |
1b9505b624d78ec61115b45e143376a0b7d5e64353927b3e8a2e0a145e84eed7
|
File details
Details for the file devhelm-0.1.2-py3-none-any.whl.
File metadata
- Download URL: devhelm-0.1.2-py3-none-any.whl
- Upload date:
- Size: 51.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78945186fca9dbec627fed6febd3705fcfc3c84f495db7b6c4c5ef0123f9bfb0
|
|
| MD5 |
d1af12baecb1a801d7d6ab994b344c91
|
|
| BLAKE2b-256 |
8fe12736e58c35053aed629fea0bd9d86ea0e3671e38eb03cad5f39b60917c2f
|