Skip to main content

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.2

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

uptime_kuma_api_v2-1.0.3.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uptime_kuma_api_v2-1.0.3-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file uptime_kuma_api_v2-1.0.3.tar.gz.

File metadata

  • Download URL: uptime_kuma_api_v2-1.0.3.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uptime_kuma_api_v2-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a790fd355dc5728dd313427bc859dfc518b67bf8f7d65b64823d32a2bc8f0fee
MD5 27d6e4aad805edf24f7b17d06cf2693c
BLAKE2b-256 b4c4841088ebfdbeb24b2f9fcd1a08a13f0afab503c7872b44999e8248b28ece

See more details on using hashes here.

Provenance

The following attestation bundles were made for uptime_kuma_api_v2-1.0.3.tar.gz:

Publisher: python-publish.yml on exaland/uptime-kuma-api-v2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uptime_kuma_api_v2-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for uptime_kuma_api_v2-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f9b4c6def52e1562e3999b91b085e138306d8f7b141e63aa12a371c6effc3357
MD5 aa3a88ce8f5f532fcd2c0dce5578031e
BLAKE2b-256 a3142b6fe7993c36a78506c3d9b4870273295770dfed4142ad1a222bfb578573

See more details on using hashes here.

Provenance

The following attestation bundles were made for uptime_kuma_api_v2-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on exaland/uptime-kuma-api-v2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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