Several mechanisms to time and view progress of execution/runtime delays in Python
Project description
DelayViewer
DelayViewer is a Python assistant for showing progress info visually within the shell running a python command with long exposure. This library provides a simple spinner graphic and a stopwatch. The predominant use case is to display progress for sections within a decorated function.
Installation
Use the package manager pip to install delayviewer.
pip install delayviewer
Spinner Usage
from delayviewer.spinner import handle_spinner
import time
@handle_spinner
def test_spinner(spinner=None):
spinner.start('delaying 5 sec')
time.sleep(5)
spinner.stop()
test_spinner()
Stopwatch Usage
from delayviewer.stopwatch import handle_stopwatch
import time
@handle_stopwatch
def test_stopwatch(stopwatch=None):
stopwatch.start('clocking 5 sec')
time.sleep(5)
stopwatch.stop('Finished timing!')
test_stopwatch()
CLI Utility
The following CLI is included with this package for testing the various progress and timing indicators.
# dlyview -h
usage: dlyview [-h] {spinner,stopwatch,time.show,sleep.ticks} ...
-.-.-. Delay viewer elements for python scripts
positional arguments:
{spinner,stopwatch,time.show,sleep.ticks}
spinner test Spinner graphic for viewing thru execution delays
stopwatch test StopWatch for viewing thru execution delays
time.show test time show wrapper
sleep.ticks test sleeping ticks progress viewer
options:
-h, --help show this help message and exit
.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
License
Acknowledgements
Thanks to several posts on StackOverflow regarding basic Spinner class implementation. Took that concept and generated the Stopwatch class to mimic behavior.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file delayviewer-0.1.0.tar.gz
.
File metadata
- Download URL: delayviewer-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5fec69db009985d550f14dee2515597970cd9911011e7be7a8b8c6a1c927344 |
|
MD5 | 3b54c629f6e52c49b8ad6ff5a422403a |
|
BLAKE2b-256 | 6a048eaa9b8af7aecefcd9d96296b71728ae9fe1b76e734599c2fefa3fb4e504 |
File details
Details for the file delayviewer-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: delayviewer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d662a70da806b77d71adcc92c4669d806c35a06f244fd8af95d8386d6b7fa5d4 |
|
MD5 | 1f9b597085c0662d79329264a2c0548c |
|
BLAKE2b-256 | c60048a572f42ca33d45dec75157fe54e30a151ebcbbbf31730a9af27678f6c8 |