Skip to main content

larzprogress

Progress bars & spinners that behave in a pipe. Pure Python, zero deps.

Wrap a loop and get a live progress bar with percentage, counts, rate, and ETA - or a spinner for work of unknown length. The part most home-grown progress code gets wrong: when output is not a terminal (a log file, a CI pipe), larzprogress stays silent instead of spraying carriage returns and bar characters into your logs.

from larzprogress import progress, ProgressBar, Spinner

for item in progress(items, desc="Processing"):
    handle(item)
# Processing: 62%|███████████░░░░░| 620/1000 [00:12<00:07, 51.2 it/s]

with Spinner("Connecting"):
    connect()

Why

  • Pipe-safe by default. Output only animates on a TTY; redirect to a file or run in CI and it produces nothing (no \r, no half-drawn bars in your logs) - the same care larzcolor takes.
  • Everything you want on the bar. Percentage, count, elapsed, ETA, and rate, throttled so it doesn't flicker.
  • Manual or automatic. progress(iterable) wraps a loop; ProgressBar gives you update()/close() for custom flows; Spinner covers unknown-length work.
  • Testable & zero-dep. Injectable clock and stream (this repo's tests assert exact output), no tqdm, no dependency.

Install

pip install larzprogress

Usage

from larzprogress import progress, ProgressBar, Spinner

# wrap an iterable
for row in progress(rows, desc="Import"):
    save(row)

# manual
bar = ProgressBar(total=len(work), desc="Build")
for w in work:
    do(w); bar.update()
bar.close()

# or as a context manager
with ProgressBar(total=100) as bar:
    for _ in range(100):
        bar.update()

# unknown length
with Spinner("Fetching"):
    fetch()

Force behaviour with disable=True/False when you need to.

Tests

python -m unittest discover -s tests -v   # 13 tests incl. the silent-in-a-pipe guarantee

The Larz stack

One of 30+ pure-Python, zero-dependency libraries at github.com/larz-scripter.

License

MIT (c) larz-scripter

Metadata

Release files for larzprogress 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for larzprogress 0.1.0
File Size Uploaded Provenance
larzprogress-0.1.0.tar.gz 5.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for larzprogress 0.1.0
File Interpreter ABI Platform
larzprogress-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / larzprogress-0.1.0.tar.gz

Download URL larzprogress-0.1.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7cafa33ff7b16e1fafd93e0ebbd456d9cd09361fa7bcb7396068a5e56ad585de
BLAKE2b-256 checksum
How to use checksums
3af30d0a4ea682566e9b5c1dae780a305ccebb009cf5a397e6dd227b480cec52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / larzprogress-0.1.0-py3-none-any.whl

Download URL larzprogress-0.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6979f18995c0a95af12c8e376e4bc6cf39f6a43a136b4eb275923e9df9856971
BLAKE2b-256 checksum
How to use checksums
01cb9e28351e95c24ac6046c9eb3a5baf266f1f6b248fb5d57b69752653759ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for larzprogress 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page