Skip to main content

A client library for heartbeat.sh

Project description

Heartbeat.sh Python Client

This is a Python client library for heartbeat.sh.

Quick start

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)
)

Use a custom requests library (Dependency Injection)

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)
)

Links

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

heartbeat-sh-0.3.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

heartbeat_sh-0.3.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

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