Skip to main content

Lightweight, dependency-free terminal progress bar with unique, customizable styles

Project description

progz

CI

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 Style dataclass
  • 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}")

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

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 = (60,60,60) # empty zone color
    show_spinner: bool = True     # braille spinner before bar
    spinner_color_rgb: tuple = (0,200,200)
    spinner_frames: tuple = ("⠋", "⠙", "⠹", ...)

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[2K to overwrite in color mode; space-padding in ASCII mode
  • 24-bit RGB via raw ANSI sequences — no terminal library needed

Contributing

  1. Fork the repo
  2. pip install -e ".[dev]"
  3. pytest
  4. Submit a PR

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

progz-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

progz-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file progz-0.1.1.tar.gz.

File metadata

  • Download URL: progz-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for progz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6728247c901d8a082df9e7711ee89262486486c25dbbeef32f568c3bd8e228ac
MD5 b1840e269ebfc10aaf4226a00dc11999
BLAKE2b-256 4b63a1df0b914fec77ddaad2df65742d491dc8aedbe54948c654a85df001bc6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for progz-0.1.1.tar.gz:

Publisher: publish.yml on geojoseph19/progz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file progz-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: progz-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for progz-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdfd662484a9864067da00f4b5f2f44dca1caedabb68ebbfadc452cf7b4e4041
MD5 5a09c1f16e236d11643c647eeb39f6d4
BLAKE2b-256 4d9ffe5ca0e47f4003c3e89d7497f3ea82ff038f509895579957bbca5847311f

See more details on using hashes here.

Provenance

The following attestation bundles were made for progz-0.1.1-py3-none-any.whl:

Publisher: publish.yml on geojoseph19/progz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page