progressbar33 - Text Progress Bar

2.4 · maintenance · verified Thu Apr 16

progressbar33 is a Python library for creating customizable text-based progress bars in terminal applications. It provides a simple API to display progress for long-running operations. The current version is 2.4, and its development appears to be in maintenance mode with infrequent updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a basic progress bar using `progressbar33` (which imports as `progressbar`). It initializes a `ProgressBar` with a list of widgets and updates it within a loop. The `with` statement ensures the progress bar is properly finished and cleaned up.

import time
from progressbar import ProgressBar, Percentage, Bar, RotatingMarker, ETA

# Define widgets for the progress bar
widgets = [
    'Processing: ', Percentage(),
    ' ', Bar(marker=RotatingMarker()),
    ' ', ETA(),
]

# Initialize the progress bar with a maximum value
max_items = 50
with ProgressBar(widgets=widgets, max_value=max_items) as bar:
    for i in range(max_items):
        # Simulate some work
        time.sleep(0.1)
        # Update the progress bar
        bar.update(i + 1)
print('\nTask Completed!')

view raw JSON →