A python wrapper for the Uptime Kuma WebSocket API
Project description
uptime-kuma-api-v2
A wrapper for the Uptime Kuma Socket.IO API
uptime-kuma-api-v2 is a Python wrapper for the Uptime Kuma Socket.IO API.
Based on Original Version by https://github.com/lucasheld/uptime-kuma-api
Python version 3.7+ is required.
Supported Uptime Kuma versions:
| Uptime Kuma | uptime-kuma-api-v2 |
|---|---|
| 2.0.0-beta.2 | 1.0.0 - 1.0.1 |
Installation
uptime-kuma-api-v2 is available on the Python Package Index (PyPI).
You can install it using pip:
pip install uptime-kuma-api-v2
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"
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uptime_kuma_api_v2-1.0.1.tar.gz.
File metadata
- Download URL: uptime_kuma_api_v2-1.0.1.tar.gz
- Upload date:
- Size: 52.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
843849a0b552c6bb36ebfb83abd0924878bff310bab04a8e536df5f26b3283ba
|
|
| MD5 |
c6649ddbecac5fe3b39a3366916e1d2a
|
|
| BLAKE2b-256 |
6b59a7ec763e75e33bca9018ec009024300efaaa73801e2f05da51fd5c903768
|
Provenance
The following attestation bundles were made for uptime_kuma_api_v2-1.0.1.tar.gz:
Publisher:
python-publish.yml on exaland/uptime-kuma-api-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uptime_kuma_api_v2-1.0.1.tar.gz -
Subject digest:
843849a0b552c6bb36ebfb83abd0924878bff310bab04a8e536df5f26b3283ba - Sigstore transparency entry: 952276138
- Sigstore integration time:
-
Permalink:
exaland/uptime-kuma-api-v2@fdb8159ab09ff4b00899e8e240020efee39b1d37 -
Branch / Tag:
refs/tags/1.0.1 - Owner: https://github.com/exaland
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fdb8159ab09ff4b00899e8e240020efee39b1d37 -
Trigger Event:
release
-
Statement type:
File details
Details for the file uptime_kuma_api_v2-1.0.1-py3-none-any.whl.
File metadata
- Download URL: uptime_kuma_api_v2-1.0.1-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb5a971b93dee3562df81822b572d1c869c29a6f3765fd058aeb55e04b32bb4
|
|
| MD5 |
bab23fa5ba14e534e68c61c9de582da8
|
|
| BLAKE2b-256 |
651402cced1b44cc03ee3e0eb5023a91c7eab1939be6e32703c4d9d4b627e383
|
Provenance
The following attestation bundles were made for uptime_kuma_api_v2-1.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on exaland/uptime-kuma-api-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uptime_kuma_api_v2-1.0.1-py3-none-any.whl -
Subject digest:
7fb5a971b93dee3562df81822b572d1c869c29a6f3765fd058aeb55e04b32bb4 - Sigstore transparency entry: 952276139
- Sigstore integration time:
-
Permalink:
exaland/uptime-kuma-api-v2@fdb8159ab09ff4b00899e8e240020efee39b1d37 -
Branch / Tag:
refs/tags/1.0.1 - Owner: https://github.com/exaland
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fdb8159ab09ff4b00899e8e240020efee39b1d37 -
Trigger Event:
release
-
Statement type: