Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flying-sheep/smart-progress
Smart progressbar with multiple backends supporting both explicit updating and tqdm-style iterable-wrapping
https://github.com/flying-sheep/smart-progress
Last synced: 3 months ago
JSON representation
Smart progressbar with multiple backends supporting both explicit updating and tqdm-style iterable-wrapping
- Host: GitHub
- URL: https://github.com/flying-sheep/smart-progress
- Owner: flying-sheep
- License: gpl-3.0
- Created: 2015-08-19T12:48:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-07T10:25:59.000Z (about 8 years ago)
- Last Synced: 2024-10-04T17:19:04.766Z (3 months ago)
- Language: Python
- Size: 17.6 KB
- Stars: 10
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
smart-progress
==============Smart progressbar with multiple backends supporting both explicit updating and tqdm_-style iterable-wrapping
.. _tqdm: https://github.com/tqdm/tqdm
Usage
-----.. code:: python
progressbar(iterable=None, length=None, label=None,
show_eta=True, show_percent=None, show_pos=False,
item_show_func=None, ..., info_sep=' ', ...)Check `click.progressbar`_ for the parameters and details. As of now, the IPython backend ignores all bar drawing and terminal-related parameters. (The ones not listed above)
.. _click.progressbar: http://click.pocoo.org/5/api/#click.progressbar
Example
-------.. code:: python
from smart_progress import progressbar
with progressbar([1,2,3]) as bar:
for item in bar:
do_work(item)or
.. code:: python
con = connection(...)
with con, progressbar(length=con.tot_size()) as bar:
while not con.is_eof():
block = con.retrieve_block()
do_work(block)
bar.update(len(block))Dependencies
------------* click_ 5.x
* IPython_ 4.x + ipywidgets_
(alternatively falls back to IPython 3.x).. _click: http://click.pocoo.org
.. _IPython: http://ipython.org
.. _ipywidgets: https://github.com/ipython/ipywidgets