lightweight library to print progress bar in cli
MIT License
It’s a lightweight and easy to use progress-bar for command-line/terminal applications.
pip install cli-progressbar
for
loops.. code:: python
from cli_progressbar import Progress
progressbar = Progress(85)
progressbar.start('start status')
users = find_users() # return a list of users
progressbar.goal = len(users)
for i, user in enumerate(users): # this function will update progressbar with new data and status progressbar.update(i, 'processing status')
# Do your stuff
progressbar.stop('stop status')
But it’s boaring… so use iterate
function:
.. code:: python
from cli_progressbar import Progress
progressbar = Progress() progressbar.start('start status')
users = find_users() for user in progressbar.iterate(users, 'processing status'): # Do your stuff
progressbar.stop('stop status')
iterate function also support dynamic status, by passing a function and each element of list as it input.
.. code:: python
for user in progressbar.iterate(users, lambda user: 'processing ' + user): # Do your stuff
goal
to change goal in between of process, it’s useful forbar_len
length of progressbar (default: 60)fill
bar fill symbol (default: █)zfill
bar zero fill symbol (default: -)decimals
positive number of decimals in percent completePlease open a new issue on
GitHub <https://github.com/mrunderline/cli-progressbar/issues>
__
CLI-Progress is OpenSource and licensed under the terms of The MIT License (X11) <http://opensource.org/licenses/MIT>
. You’re welcome to
contribute <https://github.com/mrunderline/cli-progressbar/blob/master/CONTRIBUTE.md>
!