Skip to main content

Command Line Progress Bars

Project description

cmdprogress

PyPI version shields.io PyPI pyversions PyPI license

Cross Platform Python Command Line Progress Bars

MacOS

Multi Bar

Windows

Linux

Contents

Installation

Use pip via PyPi

pip install cmdprogress

Or use git

git clone git://github.com/luciancooper/cmdprogress.git cmdprogress
cd cmdprogress
python setup.py install

Usage

this project consists of two instantiatable classes: ProgBar and MultiBar

ProgBar

There are two ways to use a ProgBar

Either give it a length when you instantiate the object, and then directly loop through it

from cmdprogress.bar import ProgBar

bar = ProgBar(max=5)
for x in bar:
    # x = (0 .. 5)
    # do some work

Or do not provide it a length when you instantiate it, instead provide it an iterable to wrap

from cmdprogress.bar import ProgBar

bar = ProgBar()
for x in bar.iter(range(5)):
    # x = (0 .. 5)
    # do some work

MultiBar

There are 3 ways to use a MultiBar.

from cmdprogress.multi import MultiBar

bar = MultiBar(lvl=2)
for i in bar.iter(range(5)):
    for j in bar.iter(range(10)):
        # do some work
from cmdprogress.multi import MultiBar

bar = MultiBar(5,lvl=2)
for x in range(5):
    for i in bar.iter(range(10)):
        # do some work
from cmdprogress.multi import MultiBar

bar = MultiBar(5,10)
for x in bar:
    # x will be the tuple (i,j)
    # do some work

Acknowledgements

Project details


Download files

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

Files for cmdprogress, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size cmdprogress-1.2-py3-none-any.whl (7.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cmdprogress-1.2.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page