Skip to main content

Zero-dependency, high-performance progress bar for HPC and workstations

Project description

zobar

Zero Overhead Bar

zobar demo

A zero-dependency, high-performance, hygienically correct progress bar for Python. Designed for HPC environments, workstations, and anywhere you need a progress bar that just works without breaking your terminal logs.

Features

  • Zero Dependencies: strictly standard library (sys, time, os, re).
  • Terminal Hygiene:
    • Single ownership of stdout (logs go to stderr).
    • Clears lines properly before redrawing.
    • Clean exit with newline.
  • Robust:
    • ANSI-aware width calculation (doesn't break on colored text).
    • Graceful degradation on non-TTY environments (e.g., piped output, CI/CD logs).
  • Customizable: Supports various styles (classic, gradient, braille, etc.) and colors.

Installation

pip install zobar

Usage

Basic Usage

The simplest way to use it is with the progress_bar wrapper:

import time
from zobar import progress_bar

items = range(100)
for item in progress_bar(items, desc="Processing"):
    time.sleep(0.05)

Manual Control

For more control, use the AnimatedProgressBar context manager:

import time
from zobar import AnimatedProgressBar

total_steps = 50
with AnimatedProgressBar(total=total_steps, desc="Downloading", bar_style='braille', color='green') as pbar:
    for i in range(total_steps):
        time.sleep(0.1)
        pbar.update(1)
        if i % 10 == 0:
            pbar.set_suffix(f"Current file: {i}")

Styles

Available styles: classic, gradient, braille, circles, blocks.

Changelog

v0.1.3

  • Added log_interval parameter for realtime logging in non-TTY environments (default: 30s).

v0.1.2

  • Added suffix support in non-TTY logs.

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

zobar-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

zobar-0.1.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file zobar-0.1.3.tar.gz.

File metadata

  • Download URL: zobar-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for zobar-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0f341169c64f027cd5adc064547486de6ee0a8b6d0820e613ebfd806c7ef3ccc
MD5 3aec72de516d4ffcf47434ee0d24d434
BLAKE2b-256 43b91ccea488e1b89738e65244c337b0f92f0108fb4949cedf81aecc3ca888f4

See more details on using hashes here.

File details

Details for the file zobar-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: zobar-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for zobar-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fe7b0b6940ea0afa3604413e3ada46fc5327a66fb75e7292011d4f3cfb024f9f
MD5 2c138d6e83d3578fed1ac166dd6c3bf5
BLAKE2b-256 bf0bb10c98495473284f0b009d8bb754360ca3e1556260a42b601647d7e05658

See more details on using hashes here.

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