uptime-kuma-api
A wrapper for the Uptime Kuma Socket.IO API
uptime-kuma-api is a Python wrapper for the Uptime Kuma Socket.IO API.
This package was developed to configure Uptime Kuma with Ansible. The Ansible collection can be found at https://github.com/lucasheld/ansible-uptime-kuma.
Python version 3.7+ is required.
Supported Uptime Kuma versions:
| Uptime Kuma | uptime-kuma-api |
|---|---|
| 1.21.3 - 1.23.2 | 1.0.0 - 1.2.1 |
| 1.17.0 - 1.21.2 | 0.1.0 - 0.13.0 |
Installation
uptime-kuma-api is available on the Python Package Index (PyPI).
You can install it using pip:
pip install uptime-kuma-api
Documentation
The API Reference is available on Read the Docs.
Example
Once you have installed the python package, you can use it to communicate with an Uptime Kuma instance.
To do so, import UptimeKumaApi from the library and specify the Uptime Kuma server url (e.g. 'http://127.0.0.1:3001'), username and password to initialize the connection.
>>> from uptime_kuma_api import UptimeKumaApi, MonitorType
>>> api = UptimeKumaApi('INSERT_URL')
>>> api.login('INSERT_USERNAME', 'INSERT_PASSWORD')
Now you can call one of the existing methods of the instance. For example create a new monitor:
>>> result = api.add_monitor(type=MonitorType.HTTP, name="Google", url="https://google.com")
>>> print(result)
{'msg': 'Added Successfully.', 'monitorId': 1}
At the end, the connection to the API must be disconnected so that the program does not block.
>>> api.disconnect()
With a context manager, the disconnect method is called automatically:
from uptime_kuma_api import UptimeKumaApi
with UptimeKumaApi('INSERT_URL') as api:
api.login('INSERT_USERNAME', 'INSERT_PASSWORD')
api.add_monitor(
type=MonitorType.HTTP,
name="Google",
url="https://google.com"
)
Metadata
Release files for uptime-kuma-api 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uptime_kuma_api-1.2.1.tar.gz | 43.6 kB | Without provenance | Details for uptime_kuma_api-1.2.1.tar.gz |
Release files / uptime_kuma_api-1.2.1.tar.gz
| Download URL | uptime_kuma_api-1.2.1.tar.gz |
|---|---|
| Size | 43.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b59e659f7b32e96e512dcc23ccb6e1a1b08d2db1d72215c8ceb70e5421be67e1
|
|
BLAKE2b-256 checksum How to use checksums |
4001da3e682364231077b05417ffa32e11ef84deee2b6f4dd6ee740cf097df28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.16
|
Security for uptime-kuma-api 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.