Progbarr is a Python library for creating highly performant and customizable progress bars in the console.
Project description
Progbarr
Progbarr is a Python library for creating highly performant and customizable progress bars in the console.
Features
- Supports filling with any UNICODE character
- Supports setting foreground & background colors
- by name (e.g.,
green), - by HEX (e.g.,
#ff00ff), or - by RGB (e.g.,
128,0,128)
- by name (e.g.,
- Minimal performance overhead
Installation
pip install progbarr
Usage
Syntax
from progbarr import ProgressBar
with ProgressBar(message, tasks, length, chars, color, bgcolor) as pb:
for _ in range(tasks):
# Perform some task
pb.advance()
The table below explains the constructor parameters:
| Parameter | Type | Description | Tip |
|---|---|---|---|
message |
str |
What is being done? | Use present participle form |
tasks |
int |
Number of tasks | Must equal loop iterations |
length |
int |
Bar length | Must be a factor of tasks |
chars |
str |
Bar characters | border + fill + head + empty + border |
color |
str / None |
Foreground color | Use None for terminal default |
bgcolor |
str / None |
Background color | Use None for terminal default |
Example (Classic)
from time import sleep
from progbarr import ProgressBar
with ProgressBar("Sleeping", 20, 20, "[## ]", None, None) as pb:
for _ in range(20):
sleep(0.35)
pb.advance()
More Examples
NB: The following example progress bars simulate the same tasks as the classic example above.
1. Block
with ProgressBar("Sleeping", 20, 20, "│ │", None, "orange") as pb: ...
2. Circles
with ProgressBar("Sleeping", 20, 20, " ●●○ ", "crimson", None) as pb: ...
3. Squares
with ProgressBar("Sleeping", 20, 20, " ◼◼◻ ", "teal", None) as pb: ...
4. Track
with ProgressBar("Sleeping", 20, 20, " ―⚈― ", "darkgrey", None) as pb: ...
License
This project is licensed under the MIT License – see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file progbarr-2.0.0.tar.gz.
File metadata
- Download URL: progbarr-2.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55dd5cc33edbc30311be0aa2820ff242b0c5d81a1aa644072c83969776ebdcb5
|
|
| MD5 |
a36df5d98e8c4d1bfbbd55faf149fc66
|
|
| BLAKE2b-256 |
f92737272dae0473463f055c090821df6203c0370842d49394f2c546e8de9456
|
File details
Details for the file progbarr-2.0.0-py3-none-any.whl.
File metadata
- Download URL: progbarr-2.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eafd8067c9f0423c71f592ec58b0e712051c3d578cb1729f4955a3ee3764f19
|
|
| MD5 |
569cc5fbfd99418d34c303fb341ac29e
|
|
| BLAKE2b-256 |
611f691ef1bd9ca476120dfc960befcff993e009bfcac27f9c3ac23f047c1d26
|