Skip to main content

Lightweight Python CLI progress bars, spinners, and task manager

Project description

progressx

Lightweight CLI progress bars, spinners, and task manager for Python.

Features

  • Progress bars
  • Spinners
  • Colored bars and spinners
  • Multiple live tasks
  • Clean terminal rendering
  • No third-party runtime dependencies

Installation

pip install progressx

Quick start

from progressx import ProgressBar
import time

bar = ProgressBar(total=100, label="Upload")

for _ in range(100):
    bar.update()
    print("\r" + bar.render(), end="", flush=True)
    time.sleep(0.02)

print()

Spinner

import time

spinner = Spinner(label="Loading")

for _ in range(20):
    spinner.tick()
    print("\r" + spinner.render(), end="", flush=True)
    time.sleep(0.1)

spinner.succeed("done")
print("\r" + spinner.render())

Progress manager

from progressx import ProgressBar, Spinner, ProgressManager
import time

with ProgressManager() as manager:
    spinner = manager.add(Spinner(label="Preparing"))
    bar = manager.add(ProgressBar(total=50, label="Download"))

    for i in range(50):
        spinner.tick()
        if i == 10:
            spinner.succeed("ready")
        bar.update()
        time.sleep(0.05)

CLI demo

progressx demo

How to run locally

python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip pytest build
python -m pip install -e .

Run tests:

pytest

Run demo:

progressx demo

Example usage

Simple progress bar

import time
from progressx import ProgressBar

bar = ProgressBar(total=20, label="Export")

for _ in range(20):
    bar.update()
    print("\r" + bar.render(), end="", flush=True)
    time.sleep(0.1)

print()

Multiple tasks

import time
from progressx import ProgressBar, Spinner, ProgressManager

with ProgressManager(refresh_rate=0.05) as manager:
    prepare = manager.add(Spinner(label="Preparing"))
    files = manager.add(ProgressBar(total=30, label="Files"))
    rows = manager.add(ProgressBar(total=50, label="Rows", color="blue"))

    for i in range(50):
        prepare.tick()
        if i == 8:
            prepare.succeed("done")

        if i < 30:
            files.update()

        rows.update()
        time.sleep(0.06)

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

progressx-0.1.1.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.

progressx-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: progressx-0.1.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for progressx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a1c10316e8c8d8ae500a43ccacead6e62fa9ab4be0d6a50eb8ce4089d6e2478d
MD5 c426344492e97a871854e6332d7d2a4e
BLAKE2b-256 e779d290922bfd7f5f317eb4bffc6f89cd16b104edb5ffabd7dd4fa168e61f69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: progressx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for progressx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aef65c0f0762f6ad16b7a4078b4b55afb450eaacfd535fddff9b89fcad78f695
MD5 f50db4743b114951d0d0e125ecd02551
BLAKE2b-256 12f233dc05e4cb2ec48e7e3521c2cb51338ea12f914ef02e3792218ef0ceed11

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