Skip to main content

Pyprobar

image image image image

A beautiful , fast, easy-to-use progress bar for python.

Installation

pip install pyprobar

nightly build:

python setup.py install

Synopsis

28.71% |████████>>>>>>>>>>>>>>>>>  | 0:00:22|0:00:31 ETC: 05-20 18:08:15

Performance

For 10000000 loops:

probar: # this repo
100.00%|█████████████████████████████| 0:00:00|0:00:02  ETC: 06-07 12:08:03

bar: # this repo
100.00%|█████████████████████████████| 0:00:00|0:00:03  ETC: 06-07 12:11:15

tqdm:
100%|██████████| 10000000/10000000 [00:03<00:00, 2634907.84it/s]

progressbar:
100% (10000000 of 10000000) |############| Elapsed Time: 0:00:46 Time:  0:00:46

Usage

Use probar or bar for different situations:

probar:

from pyprobar import bar, probar
import time

for idx, x in probar(range(1234), enum=True): 
    time.sleep(0.02)
>>> 18.31%|█████>>>>>                  | 0:00:20|0:00:25  ETC: 05-20 19:00:39

Or used in List comprehension:

res = [i for i in probar(range(10))]
print(res)
>>> 100.00%|███████████████████████████| 0:00:00|0:00:00 ETC: 05-20 12:14:33
>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

bar:

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 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') # `color` options: '1','2','3','4','5','0','update_random'
    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)
multi_text

Specify the time zone:

for i in enumerate(a):
    bar(idx, N, time_zone="Asia/Shanghai")

print RGB color string:

from pyprobar.styleString import rgb_str
    text = rgb_str("I'm green!", RGB_fore=[0,255,0])
    print(text)

TODO

  • Thread problem with probar() in jupyter notebook
  • Thread problem with bar() in jupyter notebook
  • Speed of information
  • Multithreading

Metadata

Release files for pyprobar 0.1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyprobar 0.1.2.0
File Size Uploaded Provenance Actions
pyprobar-0.1.2.0.tar.gz 11.0 kB Without provenance Details for pyprobar-0.1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyprobar 0.1.2.0
File Interpreter ABI Platform Actions
pyprobar-0.1.2.0-py3-none-any.whl Python 3 none any Details for pyprobar-0.1.2.0-py3-none-any.whl

Total release size: 27.6 kB

Release files / pyprobar-0.1.2.0.tar.gz

Download URL pyprobar-0.1.2.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
77b6cc143050821fbeb23ad7952887affa924a872f19af9525312720526d9d67
BLAKE2b-256 checksum
How to use checksums
8575092a27b0a54f038849fb8ddfb9791ff8d150f03090b432a3d3db7c240848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

Release files / pyprobar-0.1.2.0-py3-none-any.whl

Download URL pyprobar-0.1.2.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43962b1f95ca5a3ed3e0ae5ddbe854e964040824e5e65df3e27319d2c790d961
BLAKE2b-256 checksum
How to use checksums
a3d247914f64dd81533b81ce7e530b8dea17d1e52ffeacf4180a61939adf0917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

Security for pyprobar 0.1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page