Library for sending pulses to a process monitoring server
Project description
Python Heartbeat Library
The Python Heartbeat Library is a simple utility that allows you to send regular "pulses" to a specific endpoint. These pulses serve as confirmation that your main script is functioning correctly. If the main script stops for any reason, the heartbeat will also cease, indicating that something went wrong.
Installation
You can install the Python Heartbeat Library using pip:
pip install pyheartbeat
Example
======================================================================================================
from pyheartbeat import setUrl, heartbeat, killHeartbeat
# Set the URL for sending pulses
setUrl("https://your_url")
# Start the heartbeat with a pulse every x seconds
heartbeat(interval = 600, name = 'process name', description = 'process description',
additional_info = 'additional info', show_response = True, show_logs = True)
# Your main script logic goes here...
# When your script ends or encounters an error, stop the heartbeat
killHeartbeat()
======================================================================================================
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
pyheartbeat-0.0.5.tar.gz
(3.7 kB
view details)
File details
Details for the file pyheartbeat-0.0.5.tar.gz
.
File metadata
- Download URL: pyheartbeat-0.0.5.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a304a661ede6f80c6b74f2494447fb070757172eed2421ecd0e5391a6c8aceaa |
|
MD5 | f5bf462e02090da003f927f474709a12 |
|
BLAKE2b-256 | 0e0f1a1cc3f768abc69bb728a7c67f8fdc2e17cf94ae2d1c6d7bf53f523ec812 |