Enlighten Progress Bar

1.14.1 · active · verified Mon Apr 13

Enlighten Progress Bar is a console progress bar module for Python. It allows writing to stdout and stderr without any redirection, offering features for single or multiple progress bars, counters, and status bars, with experimental support for Jupyter Notebooks. As of version 1.14.1, it is actively maintained with regular updates and bug fixes.

Warnings

Install

Imports

Quickstart

This example demonstrates how to use `enlighten` to create and manage multiple progress bars, allowing interleaved console output. It's crucial to call `manager.stop()` for proper cleanup.

import time
import enlighten

# Get a manager instance to handle multiple progress bars
manager = enlighten.get_manager()

# Create two counters/progress bars
ticks = manager.counter(total=100, desc='Ticks', unit='ticks')
tocks = manager.counter(total=20, desc='Tocks', unit='tocks')

for num in range(100):
    time.sleep(0.05) # Simulate work
    print(f"Working on item {num}") # Output outside progress bars

    ticks.update()
    if not num % 5:
        tocks.update()

# Ensure all progress bars are cleaned up from the terminal
manager.stop()

print("Process complete!")

view raw JSON →