Lightweight, dependency-free terminal progress bar with unique, customizable styles
Project description
progz
Lightweight, dependency-free terminal progress bar with unique, customizable styles.
⠹ ━━━━━━━━━━━━━━────────── processing item 42
Zero runtime dependencies. Pure Python 3.10+ stdlib.
Features
- 24-bit ANSI RGB rendering, no dependencies
- Braille spinner tied to elapsed time
- ASCII fallback for dumb terminals
- Context manager and manual API
- Fully customizable via
Styledataclass - Minimal writes: redraws only on
update() - Python 3.10+, fully typed
Installation
pip install progz
Quick Start
from progz import ProgressBar
items = load_items()
with ProgressBar(total=len(items)) as bar:
for item in items:
process(item)
bar.update()
Examples
With description
with ProgressBar(total=100, description="loading") as bar:
for i, item in enumerate(items):
process(item)
bar.update(description=f"item {i}")
Update description without advancing
with ProgressBar(total=100) as bar:
bar.set_description("warming up")
time.sleep(1)
for item in items:
process(item)
bar.update()
Manual (no context manager)
bar = ProgressBar(total=100)
for item in items:
process(item)
bar.update()
bar.finish()
ASCII fallback
from progz import ProgressBar, ASCII
with ProgressBar(total=100, style=ASCII) as bar:
...
Custom style
from progz import ProgressBar, Style
style = Style(
bar_width=40,
speed=1.5,
filled_char="█",
empty_char="░",
)
with ProgressBar(total=100, style=style) as bar:
...
API Reference
ProgressBar(total, description="", style=None, file=None)
| Parameter | Type | Default | Description |
|---|---|---|---|
total |
int |
required | Number of steps to completion |
description |
str |
"" |
Text shown to the right of bar |
style |
Style | None |
SHIMMER |
Visual style configuration |
file |
TextIO | None |
sys.stderr |
Output stream (pass sys.stdout to print inline) |
Methods
| Method | Description |
|---|---|
update(n=1, description=None) |
Advance by n steps, optionally update description |
set_description(description) |
Update description without advancing |
finish() |
Complete bar and move to next line |
completed (property) |
Current completed count |
total (property) |
Total steps |
Style
@dataclass
class Style:
bar_width: int = 24 # characters wide
speed: float = 0.6 # shimmer sweep cycles/sec
filled_char: str = "━" # character for filled portion
empty_char: str = "─" # character for empty portion
min_brightness: int = 80 # grey floor (0–255)
brightness_range: int = 175 # grey range above floor
empty_rgb: tuple[int, int, int] = (60, 60, 60) # empty zone color
show_spinner: bool = True # braille spinner before bar
spinner_color_rgb: tuple[int, int, int] = (0, 200, 200)
spinner_frames: tuple[str, ...] = ("⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏")
Pre-defined styles
| Name | Description |
|---|---|
SHIMMER |
Unique sine-wave brightness gradient, Unicode chars (default) |
ASCII |
#/- chars, no spinner |
Performance Notes
- No allocations outside of
update()calls render_frame()is pure — no I/O, no side effects- No background threads — redraws only on
update() - Uses
\r\033[2Kto overwrite in color mode; space-padding in ASCII mode - 24-bit RGB via raw ANSI sequences — no terminal library needed
Contributing
- Fork the repo
pip install -e ".[dev]"pytest && mypy src/progz- Submit a PR
License
MIT
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 progz-0.1.2.tar.gz.
File metadata
- Download URL: progz-0.1.2.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fc6e522efe7fa4a5fff66ea8a8ae4c2b1e2314ace21dc264fd2ecb85fb32d49
|
|
| MD5 |
7da743d02870e202bf3973dc46fc1ad1
|
|
| BLAKE2b-256 |
793232e71a1ad40cf899f4901f91ddb3aa6943f6a1c07d9072ac02615ea45ade
|
Provenance
The following attestation bundles were made for progz-0.1.2.tar.gz:
Publisher:
publish.yml on geojoseph19/progz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
progz-0.1.2.tar.gz -
Subject digest:
4fc6e522efe7fa4a5fff66ea8a8ae4c2b1e2314ace21dc264fd2ecb85fb32d49 - Sigstore transparency entry: 2104792012
- Sigstore integration time:
-
Permalink:
geojoseph19/progz@568863a607086e8150ba049988596c0f4e6eec95 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/geojoseph19
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@568863a607086e8150ba049988596c0f4e6eec95 -
Trigger Event:
push
-
Statement type:
File details
Details for the file progz-0.1.2-py3-none-any.whl.
File metadata
- Download URL: progz-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57dfc1ace70187a8826968af913b7ad5cc516c578794cc00e81f9adeac0d8dee
|
|
| MD5 |
79f46f5dec76beb98776f06964d65e2c
|
|
| BLAKE2b-256 |
9d0b1a414d5524374253f1adbff295f865eaa5ef12fbe0353e1d6a209ce1a127
|
Provenance
The following attestation bundles were made for progz-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on geojoseph19/progz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
progz-0.1.2-py3-none-any.whl -
Subject digest:
57dfc1ace70187a8826968af913b7ad5cc516c578794cc00e81f9adeac0d8dee - Sigstore transparency entry: 2104792057
- Sigstore integration time:
-
Permalink:
geojoseph19/progz@568863a607086e8150ba049988596c0f4e6eec95 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/geojoseph19
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@568863a607086e8150ba049988596c0f4e6eec95 -
Trigger Event:
push
-
Statement type: