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)
multi-line text :
for idx, i in enumerate(a):
text = f"{v1}, frame:{idx}\n"
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.5.tar.gz
(7.8 kB
view hashes)
Built Distribution
pyprobar-0.1.1.5-py3-none-any.whl
(14.5 kB
view hashes)
Close
Hashes for pyprobar-0.1.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71c9b2bce7bca574549afa746ea28eca3fa49f8bf4bf54ce6a13ed1b868928ed |
|
MD5 | 5d0725e0e7d9696fc3e48182ae6b3eaf |
|
BLAKE2b-256 | 04400e7e12ed2a9e465d4998413a2a1f1148f26e551931a7fc1f9cc3ed197112 |