Sync and async Python bindings for Opsgenie API.
Opsgenie API documentation: https://docs.opsgenie.com/docs/
Python >= 3.12.
uv add opsgenie-python-apiRuntime dependency: httpx only.
uv sync --extra dev
uv run pytest
uv run ruff check .You need an API token for communicating with Opsgenie REST APIs.
from opsgenie import Schedules_v2
with Schedules_v2(token="<your_api_auth_token>") as client:
users = client.get_users()
schedules_list = client.get_schedules()
rotations = client.get_schedule_rotations("<schedule-id>")
overrides = client.get_schedule_overrides("<schedule-id>")
timeline = client.get_schedule_timeline("<schedule-id>")Async equivalent: from opsgenie import AsyncSchedules_v2 with async with / await.
Custom EU/US endpoint (HTTPS only):
with Schedules_v2(token="...", url="https://api.eu.opsgenie.com/v2/") as client:
...| Before | After |
|---|---|
from opsgenie.api.v2 import Schedules |
from opsgenie import Schedules_v2 or AsyncSchedules_v2 |
schedules.get_users() |
client.get_users() or await client.get_users() |
atlassian-python-api |
httpx |
Contribution is welcome. See CONTRIBUTING.md for more details.