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.4

  • Fixed suffix truncation by implementing multi-line wrapping and proper cursor management.

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.4.tar.gz (8.0 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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zobar-0.1.4.tar.gz
  • Upload date:
  • Size: 8.0 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.4.tar.gz
Algorithm Hash digest
SHA256 c11df9a8e2de8b7c61e56176c5e3483df3f5505faa4cb39d0ed5fe1c5b119ffb
MD5 ef42c3fe3360273ae1bf6ea9a056b004
BLAKE2b-256 afc964fafcafd91bb6d8aa4a56bf4285ac7e13580f9fbc91c1abfad17ba45859

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zobar-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 62bde848870bdced8c7bae92be22d1a79ea1ea2e3c6d18157497a24c670f89d3
MD5 8737a8fe368c47b743d059b08d337162
BLAKE2b-256 5e0dbf363384d0c764698f95e76de6443630330dcf5242f5af9d98f15d0960c7

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