ProgressBars
A python package to display progress of loops to the user.
Installation
This package can be installed using pip.
pip install progressbars
Usage
The class you'll be using is called the ProgressBar class, here is an example of how to use it.
from progressbars import ProgressBar, widgets
def isPrime(n: int) -> bool:
"A very slow algorithm to calculate if a given number is prime."
for i in range(2, n):
if n % i == 0:
return False
return n > 1
# Create an empty list to store the primes we find
primes = []
# Create a colorless progress bar that uses all the default widgets
bar = ProgressBar([
widgets.Percentage,
widgets.IterationSpeed,
widgets.Counter,
widgets.ElapsedTime,
widgets.RemainingTime
], color=None)
# Loop through all numbers from 0-30_000
for i in bar(range(30_000)):
if isPrime(i): # If the current number is prime, append it to the primes list
primes.append(i)
# Print how many primes we found
print("\nFound", len(primes), "primes!")
Metadata
Release files for progressbars 1.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| progressbars-1.1.10.tar.gz | 3.8 kB | Without provenance | Details for progressbars-1.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| progressbars-1.1.10-py3-none-any.whl | Python 3 | none | any | Details for progressbars-1.1.10-py3-none-any.whl |
Total release size: 8.5 kB
Release files / progressbars-1.1.10.tar.gz
| Download URL | progressbars-1.1.10.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3290e881f35e0c6972e9f5dd725aa78e740ffa62328035c9cb4fe164c665274
|
|
BLAKE2b-256 checksum How to use checksums |
76848d90932c9266eb9723cab707e51ccb2a120c1023ad4c6f3583bd36ea060f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / progressbars-1.1.10-py3-none-any.whl
| Download URL | progressbars-1.1.10-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
494625e243213fc4d7487e5b003833d78ae04cadf1067bdec074bc9dfc5643ca
|
|
BLAKE2b-256 checksum How to use checksums |
50b0a1e081da74afa7be4c7d385d03ba53a2d543c0cb36d5a96967507e881c0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for progressbars 1.1.10
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.