Skip to main content

Progbarr is a Python library for creating highly performant and customizable progress bars in the console.

Project description

Progbarr

PyPI - Version PyPI - Downloads License Python Versions

Progbarr is a Python library for creating highly performant and customizable progress bars in the console.

Features

  • Supports filling with any UNICODE character
  • Supports setting foreground & background colors
    • by name (e.g., green),
    • by HEX (e.g., #ff00ff), or
    • by RGB (e.g., 128,0,128)
  • Minimal performance overhead

Installation

pip install progbarr

Usage

Syntax

from progbarr import ProgressBar

with ProgressBar(message, tasks, length, chars, color, bgcolor) as pb:
    for _ in range(tasks):
      # Perform some task
      pb.advance()

The table below explains the constructor parameters:

Parameter Type Description Tip
message str What is being done? Use present participle form
tasks int Number of tasks Must equal loop iterations
length int Bar length Must be a factor of tasks
chars str Bar characters border + fill + head + empty + border
color str / None Foreground color Use None for terminal default
bgcolor str / None Background color Use None for terminal default

Example (Classic)

from time import sleep
from progbarr import ProgressBar

with ProgressBar("Sleeping", 20, 20, "[## ]", None, None) as pb:
    for _ in range(20):
        sleep(0.35)
        pb.advance()

example-classic

More Examples

NB: The following example progress bars simulate the same tasks as the classic example above.

1. Block

with ProgressBar("Sleeping", 20, 20, "│   │", None, "orange") as pb: ...

example-block

2. Circles

with ProgressBar("Sleeping", 20, 20, " ●●○ ", "crimson", None) as pb: ...

example-circles

3. Squares

with ProgressBar("Sleeping", 20, 20, " ◼◼◻ ", "teal", None) as pb: ...

example-square

4. Track

with ProgressBar("Sleeping", 20, 20, " ―⚈― ", "darkgrey", None) as pb: ...

example-track

License

This project is licensed under the MIT License – see the LICENSE file for details.

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

progbarr-2.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

progbarr-2.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file progbarr-2.0.0.tar.gz.

File metadata

  • Download URL: progbarr-2.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for progbarr-2.0.0.tar.gz
Algorithm Hash digest
SHA256 55dd5cc33edbc30311be0aa2820ff242b0c5d81a1aa644072c83969776ebdcb5
MD5 a36df5d98e8c4d1bfbbd55faf149fc66
BLAKE2b-256 f92737272dae0473463f055c090821df6203c0370842d49394f2c546e8de9456

See more details on using hashes here.

File details

Details for the file progbarr-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: progbarr-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for progbarr-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8eafd8067c9f0423c71f592ec58b0e712051c3d578cb1729f4955a3ee3764f19
MD5 569cc5fbfd99418d34c303fb341ac29e
BLAKE2b-256 611f691ef1bd9ca476120dfc960befcff993e009bfcac27f9c3ac23f047c1d26

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