A visually appealing progress bar for long lasting computations.
Project description
# progress_bar
A visually appealing progress bar for long lasting computations.
It also computes the remaining estimated time for the task by ad-hoc learning
of the completion so far. For this reason `scikit-learn` and `numpy` are
required.
You can install *progress_bar* via
```bash
pip install --user git+https://github.com/JosuaKrause/progress_bar.git
```
and import it in python using:
```python
import progress_bar
```
Compute a task as follows:
```python
from __future__ import print_function
import time
res = [ 0 ]
def task(elem):
time.sleep(0.01)
res[0] += elem
progress_bar.progress_list(range(1000), task, prefix="sleep list")
print(res[0])
```
or in a range:
```python
def task_range(cur_ix, length):
task(cur_ix)
progress_bar.progress(0, 1000, task_range, prefix="sleep range")
print(res[0])
```
The output looks roughly like this:
```
sleep list: |████████████▌ | 62.30% (T 7.492s ETA 6.791s)
```
If no estimate of the progress towards completion can be made use:
```python
def repeat(num):
while True:
yield num
progress_bar.progress_indef(repeat(1), task, prefix="sleep indefinitely")
```
which produces output like this:
```
sleep indefinitely: /
```
A visually appealing progress bar for long lasting computations.
It also computes the remaining estimated time for the task by ad-hoc learning
of the completion so far. For this reason `scikit-learn` and `numpy` are
required.
You can install *progress_bar* via
```bash
pip install --user git+https://github.com/JosuaKrause/progress_bar.git
```
and import it in python using:
```python
import progress_bar
```
Compute a task as follows:
```python
from __future__ import print_function
import time
res = [ 0 ]
def task(elem):
time.sleep(0.01)
res[0] += elem
progress_bar.progress_list(range(1000), task, prefix="sleep list")
print(res[0])
```
or in a range:
```python
def task_range(cur_ix, length):
task(cur_ix)
progress_bar.progress(0, 1000, task_range, prefix="sleep range")
print(res[0])
```
The output looks roughly like this:
```
sleep list: |████████████▌ | 62.30% (T 7.492s ETA 6.791s)
```
If no estimate of the progress towards completion can be made use:
```python
def repeat(num):
while True:
yield num
progress_bar.progress_indef(repeat(1), task, prefix="sleep indefinitely")
```
which produces output like this:
```
sleep indefinitely: /
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for progressor-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87f6be5a5ac67c2769f7c962e2836beeaa14a083b5953905b3cd0186dad17e54 |
|
MD5 | 8baf9df0cfadf19eea7c078173d2ea1e |
|
BLAKE2b-256 | 31e8dbf79a3cab300edd25b8bd78bead8c21a50c8cf673cb20169a9d4b033034 |