Skip to main content

A decentralized iterable, function and log tracker

Project description

img

Static Badge Static Badge Static Badge Codacy Badge Static Badge

This project provides an easy-to-use tool for tracking the progress of Python iterables, functions, and log messages to an independent log server. It allows users to monitor multiple Python scripts from any device with an internet connection. With this decentralized approach, users can collaborate and monitor the real-time progress of various scripts running on different devices and processes. This tool enables seamless tracking across distributed systems, making it ideal for collaborative projects and remote monitoring.

Key Features

  • Progress Tracking: Track the progress of Python iterables, functions, and log messages in real-time (0.5 - 2 ms overhead).
  • Decentralized Monitoring: Monitor multiple Python scripts from any device with an internet connection.
  • Collaborative Projects: Collaborate and monitor the real-time progress of various scripts running on different devices and processes.
  • Distributed Systems: Track progress across distributed systems for seamless monitoring and remote collaboration.
  • Function Tracking: Track the call-count, execution time distribution, execution history, time between calls, error count, function file origin, and function name.
  • Iterable Tracking: Track the progress of iterables and generators with a progress bar. Additionally, track the total number of iterations, current iteration, and percentage completion, time remaining, iteration execution time, and iteration rate.
  • Log Server: Start a log server to receive progress updates from Python scripts. The log server can be accessed from any device with an internet connection.
  • Threading support: Track the progress of multiple threads and processes simultaneously.
  • Search Functionality: Search for specific functions and iterables in the log server.

gif

Installation

Clone

Navigate to your desired installation directory and clone the repository using the following command:

git clone https://github.com/levi2234/Progresspal

Navigate to the installation directory and use either a pip install or python setup.py install to install the package.

Pip Install

pip install .

Python Setup

python setup.py install

Pip Install

pip install ProgressPal

Usage

Log server

The progresspal package reports the progress of iterables, functions, and log messages to a log server. The log server can be started by running the following command in the terminal (by default can be found on http://127.0.0.1:5000).

ProgressPal start

If this command does not work it is possible to start the log server by running the following code in a Python script.

from ProgressPal.webapp.webapp import start_web_server

start_web_server()

Iterables and generators

Using ProgressPal is simple and might even feel familiar to those who have used tqdm and the logging module in Python. The following is a simple example of how to use ProgressPal to track the progress of a for loop.

from ProgressPal import ltrack
import time

for i in ltrack(np.arange(100)):
    time.sleep(0.1)  

Which will report the progress of the for loop to the ProgressPal server. This can be done with any iterable or generator.

from ProgressPal import ltrack
import time

for i in ltrack(range(100), total=100): # providing a total is required for generators
    time.sleep(0.1)  

The result of the above code can be seen in the ProgressPal server as such:

gif

Functions

ProgressPal can also be used to track the execution functions . The following is an example of how to use ProgressPal to track the progress of a function

from ProgressPal import ftrack

@ftrack()             # Decorator to track the progress of the function     
def test_function():
    time.sleep(1)

for i in range(10):
    test_function()  

The result of the above code can be seen in the ProgressPal server as such: gif

Collaborate using ProgressPal

ProgressPal is designed to be a collaborative tool that allows users to monitor the progress of various scripts running on different devices and processes. Through this approach it is possible to monitor the progress of multiple scripts in real-time, making it ideal for collaborative projects and remote monitoring. To do this the logserver needs to be publically hosted in order to be accessed by people outside of the local network. This can be done by port forwarding the logserver or by hosting the logserver on a cloud service.

A free and easy way to host the logserver is through the built in vscode port forwarding which can be accessed as such: gif

After the logserver is publically hosted other users can access the logserver by redirecting their progresspal to the publically hosted logserver. This can be done by including the following arguments in ftrack ltrack and Plog functions:

from ProgressPal import ftrack, ltrack, Plog

# FTRACK
@ftrack(host = 'yourhost', port = 'yourport')             # Decorator to track the progress of the function
def test_function():
    time.sleep(1)

# LTRACK
for i in ltrack([1,2,3,4], host ='yourhost', port ='yourport'): 
    time.sleep(0.1)

# PLOG
logger = Plog(host = 'yourhost', port = 'yourport')
logger.info('This is a test message')

License

MIT

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

progresspal-0.0.6.tar.gz (736.8 kB view details)

Uploaded Source

Built Distribution

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

ProgressPal-0.0.6-py3-none-any.whl (737.5 kB view details)

Uploaded Python 3

File details

Details for the file progresspal-0.0.6.tar.gz.

File metadata

  • Download URL: progresspal-0.0.6.tar.gz
  • Upload date:
  • Size: 736.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for progresspal-0.0.6.tar.gz
Algorithm Hash digest
SHA256 10b6f796411e90bbf1f3b271d6f9ca8039232438c34ed08138e48ef40ab896ed
MD5 0ff07fb818ede96334fc5fd08c1b5ea9
BLAKE2b-256 331a5b539bdb994d03276e0447c8c821fe1ed6c3b320d336d5243591a2673e7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for progresspal-0.0.6.tar.gz:

Publisher: release.yaml on levi2234/Progresspal

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

File details

Details for the file ProgressPal-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: ProgressPal-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 737.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ProgressPal-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 28a286a94f047e24a0f3d550a8b2ded31090076b9e5664e8c57a94a84dc97a57
MD5 c7138afd0e64ff168b76a8a08fd18248
BLAKE2b-256 987f7a07f7e92234a2a81f3ae4a251ab570db874083ef2857b8c4f778fd9128e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ProgressPal-0.0.6-py3-none-any.whl:

Publisher: release.yaml on levi2234/Progresspal

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