Top 7 Python Libraries for Progress Bars

by
0 comments
Top 7 Python Libraries for Progress Bars


Image by author

# Introduction Loading…

Progress bars make the wait more bearable. They show how much of the task has been completed, how much is left, and whether any loops are still running or paused. This simple visual feedback improves clarity when executing long-running scripts.

Progress bars are especially useful in data processing, model training, and machine learning workflows, where tasks may take several minutes or even hours to complete. Instead of waiting without feedback, developers can track progress in real time and better understand execution behavior.

In this article, we explore the top seven Python libraries for progress bars. Each library includes example code so you can quickly integrate it into your projects with minimal setup.

# 1. TQDM

Top 7 Python Libraries for Progress Bars

tqdm One of the most popular Python libraries for adding progress bars to loops and iterator-based workflows. It’s lightweight, easy to integrate, and works out of the box with minimal code changes.

The library automatically adapts to different environments, including terminals, notebooks, and scripts, making it a reliable choice for data processing and machine learning tasks where visibility into execution progress is important.

key features:

  • Automated progress tracking for any iterable with minimal code changes
  • High performance with very low overhead, even for large loops
  • Clear and informative output including repetition speed and estimated remaining time

Example code:

# pip install tqdm
from tqdm import tqdm
import time

records = range(1_000)

for record in tqdm(records, desc="Cleaning records"):
    time.sleep(0.002)

Output:

Cleaning records: 100%|██████████| 1000/1000 (00:02<00:00, 457.58it/s)

# 2. rich

Top 7 Python Libraries for Progress Bars

Rich is a modern Python library designed to create visually attractive and highly readable terminal output, including advanced progress bars. Unlike traditional progress bar libraries, Focus focuses on rich presentation, making it ideal for applications where clarity and aesthetics matter, such as developer tools, dashboards, and command-line interfaces.

Progress bars in Rich support rich text formatting, dynamic descriptions, and smooth animations. This makes it especially useful when you want progress indicators that are both informative and visually sophisticated without adding complex logic to your code.

key features:

  • Visually rich progress bars with colors, styles, and smooth animations
  • Simple API for tracking progress on iterable objects
  • Seamless integration with other rich components like tables, logs, and panels

Example code:

# pip install rich
from rich.progress import track
import time

endpoints = ("users", "orders", "payments", "logs")

for api in track(endpoints, description="Fetching APIs"):
    time.sleep(0.4)

Output:

Fetching APIs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01

# 3. Live-Progress

Top 7 Python Libraries for Progress Bars

living progress is a Python library that focuses on creating animated and visually appealing progress bars for terminal applications. It stands out by providing smooth animations and dynamic indicators that make monitoring long-running tasks easier and more pleasant to watch.

This library is suitable for scripts where user experience matters, such as training loops, batch jobs, and command-line tools. It offers a flexible API that allows developers to customize the title, style, and behavior while keeping implementation straightforward.

key features:

  • Smooth animated progress bars with dynamic indicators
  • Flexible customization of titles, styles and refresh behavior
  • Clear performance metrics including elapsed time and processing speed

Example code:

# pip install alive-progress
from alive_progress import alive_bar
import time

epochs = 10

with alive_bar(epochs, title="Training model") as bar:
    for _ in range(epochs):
        time.sleep(0.6)
        bar()

Output:

Training model |████████████████████████████████████████| 10/10 (100%) in 6.0s (1.67/s) 

# 4. Hello

Top 7 Python Libraries for Progress Bars

halo There is a Python library designed to display elegant spinner animations in the terminal. Instead of showing progress as percentages or bars, Halo provides visual indicators that indicate the ongoing process, making it ideal for tasks where progress cannot be easily determined.

This library is commonly used for startup routines, network calls, and background operations where a simple status indicator is more appropriate than a traditional progress bar. Its clean API and customizable spinner make it easy to add sophisticated feedback to command-line tools.

key features:

  • Lightweight spinner animations for uncertain tasks
  • Simple and intuitive API with start, success and failure statuses
  • Multiple built-in spinner styles with customizable text

Example code:

# pip install halo
from halo import Halo
import time

spinner = Halo(text="Starting database", spinner="line")
spinner.start()
time.sleep(3)
spinner.succeed("Database ready")

Output:

| Starting database
✔ Database ready

# 5. IPWidgets

Top 7 Python Libraries for Progress Bars

ipywidgets is a Python library that enables interactive user interface components in Jupyter Notebooks, including progress bars, sliders, buttons, and forms. Unlike terminal-based libraries, ipywidgets presents progress indicators directly in the notebook interface, making it particularly useful for exploratory data analysis and interactive experiments.

Progress bars created with ipywidgets integrate seamlessly with notebook workflows, allowing users to monitor long-running tasks without cluttering the output. This makes it a strong choice for machine learning experiments, parameter tuning, and iterative research conducted in the Jupyter environment.

key features:

  • Rendering native progress bar inside Jupyter Notebook
  • Interactive UI components beyond progress tracking
  • Fine-grained control over progress updates and display behavior

Example code:

# pip install ipywidgets
import ipywidgets as widgets
from IPython.display import display
import time

progress = widgets.IntProgress(value=0, max=5, description="Experiments")
display(progress)

for _ in range(5):
    time.sleep(1)
    progress.value += 1

Output:

Top 7 Python Libraries for Progress Bars

# 6. progress

Top 7 Python Libraries for Progress Bars

Progress is a lightweight Python library that provides simple and classic progress bars for terminal-based applications. It focuses on minimalism and readability, making it a good choice for scripts where clarity is more important than advanced styling or animations.

The library provides a number of progress indicators, including bars, spinners, and counters, allowing developers to choose the format that best suits their use case. Its straightforward API makes it easy to integrate into existing scripts with minimal changes.

key features:

  • Simple and clean terminal progress bars
  • Multiple progress indicators like bars and spinner
  • Minimal dependencies and easy integration

Example code:

# pip install progress
from progress.bar import Bar
import time

files = ("a.csv", "b.csv", "c.csv")

bar = Bar("Uploading files", max=len(files))
for _ in files:
    time.sleep(0.7)
    bar.next()
bar.finish()

Output:

Uploading files ████████████████████████████████ 100%

# 7. Click

Top 7 Python Libraries for Progress Bars

Click There is a Python library for creating command-line interfaces that includes built-in support for progress bars. Unlike standalone progress bar libraries, Click integrates progress tracking directly into CLI commands, making it ideal for tools distributed and used from the terminal.

The progress bar provided by Click is simple, reliable and designed to work seamlessly with its command system. This is especially useful when creating data pipelines, automation scripts, or developer tools, where progress feedback must be part of the command execution flow.

key features:

  • Built-in progress bars designed specifically for command-line interfaces
  • Seamless integration with click command decorators and options
  • Reliable output handling for terminal-based tools

Example code:

# pip install click
import time
import click

@click.command()
def main():
    items = list(range(30))

    # Progressbar wraps the iterable
    with click.progressbar(items, label="Processing items") as bar:
        for item in bar:
            # Simulate work
            time.sleep(0.05)

    click.echo("Done!")

if __name__ == "__main__":
    main()

Output:

Processing items  (####################################)  100%          
Done!

# Comparison of Python Progress Bar Libraries

The table below provides a simple comparison of the Python progress bar libraries included in this article, focusing on where they work best and how they are commonly used.

Library best use case environmental support Style
tqdm Data Processing and ML Loop Terminal, Jupyter Notebook simple and informative
Rich polished cli tools Terminal, Jupyter Notebook colorful and stylish
living progress animated long running tasks Terminal, limited notebook support animated and dynamic
halo indefinite work terminal only spinner based
ipywidgets interactive experiment jupyter notebook only basic notebook ui
Progress Simple Scripts and Batch Jobs terminal only minimalist and classic
Click command-line tools Terminal (CLI) functional CLI output

abid ali awan (@1Abidaliyawan) is a certified data scientist professional who loves building machine learning models. Currently, he is focusing on content creation and writing technical blogs on machine learning and data science technologies. Abid holds a master’s degree in technology management and a bachelor’s degree in telecommunications engineering. Their vision is to create AI products using graph neural networks for students struggling with mental illness.

Related Articles

Leave a Comment