Skip to main content

Official Python SDK for WardenPoint incident alerting

Project description

WardenPoint Python SDK

CI PyPI License: MIT

Official Python SDK for WardenPoint — incident alerting and on-call escalation. Fire and manage alerts from your apps, jobs and pipelines; page on-call automatically when code fails.

Install

pip install wardenpoint

Quickstart

from wardenpoint import WardenPoint

wp = WardenPoint(api_key="wp_live_xxx")        # or set WARDENPOINT_API_KEY

# send to a recipient (UUID or exact name) at a priority
wp.alerts.send(recipient="ops-oncall", message="DB primary down", priority="high")

# send to a whole group
wp.alerts.send_to_group(group="<group-uuid>", message="API SLO burn", priority="critical")

# fire a pre-configured template
wp.templates.fire("disk-full", vars={"host": "web-3", "pct": 95}, override={"priority": "high"})

# inspect / acknowledge / cancel
wp.alerts.list()
wp.alerts.status("<id>")
wp.alerts.acknowledge("<uuid>")
wp.alerts.cancel("<uuid>")
wp.recipients.list()

Priorities: low, normal, high, critical.

templates.fire(...) requires alert templates to be enabled for your company (a per-tenant setting in the dashboard); otherwise the call returns an APIError.

Page automatically when code fails

The context manager and decorator alert on-call with the exception and traceback if the wrapped code raises — then re-raise, so behaviour is unchanged otherwise. A delivery failure never masks your original error.

# context manager
with wp.guard(group="sre", title="nightly ETL"):
    run_etl()

# decorator for jobs
@wp.on_failure(to="ops-oncall", priority="high")
def reconcile_invoices():
    ...

Configuration

Setting Argument Environment
API key api_key= WARDENPOINT_API_KEY
Base URL base_url= WARDENPOINT_BASE_URL (default https://wardenpoint.com/api/v1)
TLS verify verify= — (set False only for self-hosted/staging with self-signed certs)

WardenPoint is also a context manager (closes the HTTP client on exit):

with WardenPoint(api_key="...") as wp:
    wp.alerts.send(recipient="...", message="...")

Errors

  • wardenpoint.APIError — non-2xx response (.status, .message, .body).
  • wardenpoint.WardenPointError — config / validation / resolution errors.

Development

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wardenpoint-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wardenpoint-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file wardenpoint-0.1.0.tar.gz.

File metadata

  • Download URL: wardenpoint-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wardenpoint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ff772264c5fd59a05d2adf921ef9d16686bbe1ec03a466c3f13c2348ad9dd95
MD5 929efb00fdd94b25b1b39bec11a0a5db
BLAKE2b-256 585257da9c5f14d060235696e30e8466e5467922c2aeab52fff9099b46eeb3d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for wardenpoint-0.1.0.tar.gz:

Publisher: release.yml on WardenPoint/wardenpoint-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wardenpoint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wardenpoint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wardenpoint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0a654126fa5abe0c07cf0c0b94cfe83aea3ad792e41ed61ab40f12d82b5dd73
MD5 5c6069acfc561f37dbf9e4b29680577a
BLAKE2b-256 aae258dad4a9d8e4aedaf82c784353ff64bd08652220fdd861e25c0082b94bbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for wardenpoint-0.1.0-py3-none-any.whl:

Publisher: release.yml on WardenPoint/wardenpoint-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page