Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrunderline/cli-progressbar
lightweight library to print progress bar in cli
https://github.com/mrunderline/cli-progressbar
Last synced: 23 days ago
JSON representation
lightweight library to print progress bar in cli
- Host: GitHub
- URL: https://github.com/mrunderline/cli-progressbar
- Owner: mrunderline
- License: mit
- Created: 2021-01-04T12:20:44.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-25T14:02:17.000Z (over 1 year ago)
- Last Synced: 2024-08-04T09:04:27.882Z (3 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
Cli Progressbar
===============It’s a lightweight and easy to use progress-bar for
command-line/terminal applications.Install
-------``pip install cli-progressbar``
Features
--------- **Simple**, **Lightweight** and **Easy** to use.
- Single progressbar mode
- Custom Bar Characters
- **iterate** function to auto handle progressbar in ``for`` loopsUsage
-----.. 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 stuffprogressbar.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 stuffParameters
----------- ``goal`` to change goal in between of process, it’s useful for
dynamic tasks
- ``bar_len`` length of progressbar (default: 60)
- ``fill`` bar fill symbol (default: █)
- ``zfill`` bar zero fill symbol (default: -)
- ``decimals`` positive number of decimals in percent complete
(default: 1)Any Questions? Report a Bug? Enhancements?
------------------------------------------Please open a new issue on
`GitHub `__License
-------CLI-Progress is OpenSource and licensed under the terms of `The MIT
License (X11) `__. You’re welcome to
`contribute `__!