Python ASCII Progress Bar
Go to file
2023-12-15 22:29:14 +00:00
ZProgressbar Delete ZProgressbar/ZProgressbar.pyc 2023-12-15 22:29:14 +00:00
.gitignore Added gitignore 2016-05-10 20:38:43 -04:00
LICENSE Initial commit 2016-02-09 15:12:13 -05:00
progressbar.py Renamed script 2016-05-10 20:44:57 -04:00
README.md Updated library files & readme 2023-12-15 17:26:51 -05:00


Logo

py-bar

Python ASCII Progress Bar

Version Pull Requests Issues



Table of Contents

About

Python CLI Progress bar. This module is an iterator that can not only, iterate, but display its self as a progressbar along with some other usefull iformation such as iterations a second, estimated time, elapsed time, etc.

00:25 100% [====================] [100/100] 3.99/s 00:00

Built With

Python

Setup

Production

Prerequisites

Instructions

  1. Download and add script to project: curl https://git.zakscode.com/ztimson/py-bar/raw/branch/develop/progressbar.py
  2. Use in python script:
from progressbar import Progressbar

for i in Progressbar(100):
    ...

# OR

progress = Progressbar(100, display=False) # Output manually
for i in progress:
    print(str(progress)) # Print progress bar
    ...

Documentation

Progressbar

Constructor Arguments

Name Description
start Iterator starting position
end Iterator ending position
current Current iteration position
step Added to current index after each iteration
length ASCII progress bar string length
units Unit to append to progress rate
color ANSI escape code to color progress bar
display Automatically output to sdtout
bar_format Custom progress bar format string

Properties

Name Description
elapsed Time ellapsed since first iteration: mm:ss
percentage Percentage of completion: 50%
bar ASCII progress bar: |==========|
fraction Position as a fraction: [index/total]
rate Iterations per second: 2.00/s
eta Estimated time until complete: mm:ss

Methods

Name Description
elapsed(self) Elapsed time in seconds
estimated_time(self) Estimated time until completion in seconds
fraction(self) Create fraction string
generate_bar Progress bar ASCII string
per_second Calculate iteration rate per second as float
percentage Percentage as a floating point

License

Copyright © 2023 Zakary Timson | Available under the GNU General Public License

See the license for more information.