An API for Python Scripts to integrate with Uptime Kuma.
Interested in donating? A donate link will be here soon :)
The easiest way to install PyKuma is using PyPI. Simply type:
pip install pykuma
or, if python isn't in your PATH:
py -m pip install pykuma
- The second way to install PyKuma is using the script directly.
- You can do this by downloading the latest version of the script here
- Place it in the same directory as your script. Once you've done so, rename it to 'pykuma.py'.
First, import PyKuma into your project:
import pykuma
# -- or, use an alias --
import pykuma as pyk
Secondly, we need to configure it with Uptime Kuma. To do this, open your Uptime Kuma dashboard and create a new Push monitor. Copy the Push URL given.
Now, back at the script, type:
pykuma.configure(url="uptime-kuma-push-url", heartbeat=60, ShowMessage=True, printPush=False)
the arguements mean the following:
url
- the push URL from Uptime Kuma. Required.heartbeat
- the heartbeat interval to push to kuma in. Optional - if not specified, 60ShowMessage
- whether to show PyKuma credit message. Optional - if not specified, trueprintPush
- print when pushed. Optional - if not specified, false
Finally, type:
pykuma.start()
PyKuma will begin periodically pushing every heartbeat interval. If you check your monitor, you should see one push already come through as PyKuma runs one for testing.
You can view the demo output and code usage in this Workflow run.
- Click on the demo you'd like to view. For example, 'printing on push'.
- You should see the demo output.
- Click on the demo you'd like to view. For example, 'printing on push'.
- Click the following arrow.
- You should see the demonstration code.