Metadata-Version: 2.1
Name: opsduty-python
Version: 0.1.0
Summary: Command-line utility for interfacing with OpsDuty.
License: MIT
Author: Eirik Martiniussen Sylliaas
Author-email: eirik@opsduty.io
Requires-Python: >=3.11,<3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: click (>=8.1.7,<9)
Requires-Dist: opsduty-client (>=0.0.3a2,<0.0.4)
Requires-Dist: pydantic (>=2.9.2,<3)
Requires-Dist: pydantic-yaml (>=1.3.0,<2)
Requires-Dist: requests (>=2.32,<3)
Requires-Dist: structlog (>=24.4.0,<25)
Requires-Dist: urllib3 (>=2.2.2,<3)
Description-Content-Type: text/markdown

# opsduty-python

> Command-line utility for interfacing with OpsDuty.

## Heartbeats

Send periodic heartbeats to OpsDuty using `opsduty-python`. The
heartbeat needs to be configured in OpsDuty before check-ins can
be observed. Head over to [https://opsduty.io](https://opsduty.io)
to configure your heartbeats.

### Alternative 1: Decorator

```python
from opsduty_python.heartbeats.heartbeats import (
    heartbeat_checkin,
)

@heartbeat_checkin(heartbeat="HBXXXX", environment="prod", enabled=True)
def periodic_job():
    pass
```

### Alternative 2: Send heartbeat manually.

```python
from opsduty_python.heartbeats.heartbeats import (
    send_heartbeat_checkin,
)

def periodic_job():
    try:
        pass
    except Exception:
        print("Job failed.")
    else:
        send_heartbeat_checkin(heartbeat="HBXXXX", environment="prod")
```

