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

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.3.tar.gz (731.4 kB view details)

Uploaded Source

Built Distribution

ProgressPal-0.0.3-py3-none-any.whl (733.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: progresspal-0.0.3.tar.gz
  • Upload date:
  • Size: 731.4 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.3.tar.gz
Algorithm Hash digest
SHA256 fb7357303563e2bbefe5fa4386ae4987e7ea83a81a0e2753ff40ba80da14abc7
MD5 163923a377479ee09a09af1411b3f542
BLAKE2b-256 ba9975fa5e97130984e89e81e6f0cce93eb9accb07d3bc367adfd4b779c150c7

See more details on using hashes here.

Provenance

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

Publisher: release.yaml on levi2234/Progresspal

Attestations:

File details

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

File metadata

  • Download URL: ProgressPal-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 733.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94d3db61e137700092fc6b585f434a8c6a958fd4f801947c772ee4b4d4f765d2
MD5 524aef5a99fae25edee9ffba04241671
BLAKE2b-256 a7908bdeafaf02422f069744b430c8d1a695667809caf6ac84821331057c9361

See more details on using hashes here.

Provenance

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

Publisher: release.yaml on levi2234/Progresspal

Attestations:

Supported by

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