This is a Python client library for heartbeat.sh.
Install with pip install heartbeat-sh requests
from datetime import timedelta
from heartbeat_sh import HeartbeatClient
HeartbeatClient("example").send_beat(
"example:python",
timedelta(days=1, hours=2),
timedelta(days=2)
)
By default, this module uses the requests
library to make HTTP
requests. This is not a requirement. You may inject any request library:
from datetime import timedelta
from heartbeat_sh import HeartbeatClient
def request(url: str, method: str):
return {
"fake": "json result"
}
HeartbeatClient(
subdomain="example",
request=request,
).send_beat(
"example:python",
timedelta(days=1, hours=2),
timedelta(days=2)
)