Python Progressbar2 Library

4.5.0 · active · verified Sun Mar 29

progressbar2 is an actively maintained Python library designed to provide visual, text-based progress bars for long-running operations in CLI applications. It is a fork of the original `progressbar` package, aiming for backwards compatibility while offering enhanced features and ongoing development. The current stable version is 4.5.0.

Warnings

Install

Imports

Quickstart

This example demonstrates basic usage with the context manager pattern. It initializes a progress bar with a maximum value and updates it in a loop. The bar automatically handles starting and finishing.

import time
import progressbar

MAX_VALUE = 100

with progressbar.ProgressBar(max_value=MAX_VALUE) as bar:
    for i in range(MAX_VALUE):
        # Simulate a task
        time.sleep(0.02)
        bar.update(i + 1)

print("Task completed!")

view raw JSON →