Skip to main content

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

MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

delayviewer-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

delayviewer-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file delayviewer-0.1.1.tar.gz.

File metadata

  • Download URL: delayviewer-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for delayviewer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 686327cca97077d79d8db2e678995d854e3c1e8d9ae23eeab2de9d36e9d01634
MD5 6d7de50e5cb72832e734d9febd10ab1b
BLAKE2b-256 d50ff9d445720c3b5479832930c8ee5875079cd5f83da3193aa619b430c08913

See more details on using hashes here.

File details

Details for the file delayviewer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: delayviewer-0.1.1-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.12

File hashes

Hashes for delayviewer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b49d3612a2f794dafc7d41a0c5ee20710759f0d331a39f14cf18f44bddeb3dd6
MD5 93757bafab670fbbf2f68bf5b95d74da
BLAKE2b-256 2a7dc2a1e35e2ce85ada7470dfe35e0ff4489c2f79e57fe52c4d892474f1140e

See more details on using hashes here.

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