Skip to main content

progress_bar

a module to display progress bars in terminals

A simple way of providing an informative and clean progress bar on the terminal that respects the terminal’s width, has a header, and the current %age for Python 2.6+ and 3.0+

Synopsis

                   reading names.dmp
[========================79.3%===============>          ]

Installation

pip install progress_bar

Usage

Generally, to create any kind of progress bar with a default “size” of 100 arbitrary units:

from progress_bar import initBar

pbar = initBar("title")
pbar(10)  # update % to 10%
pbar(20)  # update % to 20%
pbar(15)  # simulate Microsoft progress effects

del pbar  # move bar to final 100% and write the newline

To easily create a progress bar for reporting (reading) progress in a filehandle that can tell() its offset:

from progress_bar import initBarForInfile

pbar = initBarForInfile("path")
instream = open("path")

for line in iter(instream.readline, ''):
  pbar(instream.tell())

del pbar

With those default arguments, the bar will be as wide as the terminal window. Terminal window width is defined by termios using fcntl, both from the standard library.

Version History

  • 2: updated the readme/usage section to reflect tell() issues with Python3

  • 1: initial release

Metadata

Release files for progress_bar 2

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

Source distribution (sdist)

Source distribution for progress_bar 2
File Size Uploaded Provenance
progress_bar-2.tar.gz 4.3 kB Without provenance Details

Release files / progress_bar-2.tar.gz

Download URL progress_bar-2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0cad38c988fe8ab8398b60631d62b6e47a1757621f1acba4507efbd917c331b5
BLAKE2b-256 checksum
How to use checksums
eaf9a693b67fdcd128a4e16d9f86413dafeaee576b740a0056c1a12f414a3822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for progress_bar 2

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