
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
It’s a lightweight and easy to use progress-bar for command-line/terminal applications.
pip install cli-progressbar
for
loops.Single mode
.. code:: python
from cli_progressbar import Progress
# define progressbar instance
progressbar = Progress(85)
# start function pass 0 to update function and print progressbar
# you can pass an string to show as status
progressbar.start('start status')
users = find_users() # return a list of users
# you can fill goal like this
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
# stop function pass goal itself to update function
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
Multiple mode
.. code:: python
from cli_progressbar import Progress, MultiProgressManager
manager = MultiProgressManager()
progress_1 = Progress() progress_2 = Progress()
manager.append(progress_1) manager.append(progress_2)
progress_1.start('start progress 1') progress_2.start('start progress 2') for i in progress_1.iterate(range(8), 'state progress 1'): for j in progress_2.iterate(range(5), 'state progress 2'): # Do your stuff
progress_1.stop('stop progress 1') progress_2.stop('stop progress 2')
But maybe you want it more simple, so I have an easier solution!
.. code:: python
from cli_progressbar import MultiProgressManager
manager = MultiProgressManager( progress_count=2, # default: 0 progress_prefix='progress_' # default: progress_ )
manager.progress_1.start('start progress 1') manager.progress_2.start('start progress 2') for i in manager.progress_1.iterate(range(8), 'state progress 1'): for j in manager.progress_2.iterate(range(5), 'state progress 2'): # Do your stuff
manager.progress_1.stop('stop progress 1') manager.progress_2.stop('stop progress 2')
goal
to change goal in between of process, it’s useful for
dynamic tasksbar_len
length of progress bar (default: 60)fill
bar fill symbol (default: █)zfill
bar zero fill symbol (default: -)decimals
positive number of decimals in percent complete
(default: 1)Please open a new issue on
GitHub <https://github.com/mrunderline/cli-progressbar/issues>
__
CLI-ProgressBar 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>
!
MultiProgressManager
classFAQs
lightweight library to print progress bar in cli
We found that cli-progressbar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.