An easy-to-use progress bar tool for python.
Project description
Pyprobar
An easy-to-use progress bar tool for python.
Installation
pip install pyprobar
Synopsis
28.71% |████████>>>>>>>>>>>>>>>>> | 0:00:22|0:00:31 ETC: 05-20 18:08:15
Usage
Use probar
or bar
for different situations:
from pyprobar import bar, probar
import time
for idx, x in probar(range(1234)):
time.sleep(0.02)
>>> 18.31%|█████>>>>> | 0:00:20|0:00:25 ETC: 05-20 19:00:39
import numpy as np
N = 1024
a = np.linspace(2, 5, N)
for idx, i in enumerate(a):
time.sleep(0.01)
bar(idx, N)
>>> 100.00% |███████████████████████████| 0:00:00|0:00:10 ETC: 05-20 20:33:34
You can set your own progress bar by using the parameters symbol_1
and symbol_2
:
for idx, i in probar(range(1234), symbol_2="o"):
time.sleep(0.01)
>>> 23.10%|██████ooooooooooooooooooo | 0:00:10|0:00:14 ETC: 05-20 17:29:57
Tip: Searchcharmap
in win10 start menu, you can find a lot of interesting characters.
Supports progress bars in different colors:
for idx, i in enumerate(a):
bar(idx, N, color='1')
time.sleep(0.01)
Of course, you can also add text or variables to the progress bar:
for idx, i in enumerate(a):
text = f"what you want see is {x}"
bar(idx, N, text=text)
print RGB color string:
from pyprobar.styleString import rgb_str
text = rgb_str("I'm green!", RGB_fore=[0,255,0])
print(text)
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 Distribution
pyprobar-0.1.1.4.tar.gz
(7.7 kB
view hashes)
Built Distribution
pyprobar-0.1.1.4-py3-none-any.whl
(14.4 kB
view hashes)
Close
Hashes for pyprobar-0.1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f7683eba1acaa5613fb1459c623508981d42051e092b1db664f1b82f922471c |
|
MD5 | ff87669ad913545c37811a3bcefd8a14 |
|
BLAKE2b-256 | a48d98f98ad31857f8d6f32542809d969536aa6ea842a0cad6fe46c53d5d16ad |