Image by Author
# Introduction Loading…
Progress bars make waiting more bearable. They show how much of a task has been completed, how much remains, and whether a loop is still running or has stalled. 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
tqdm is one of the most popular Python libraries for adding progress bars to loops and iterable-based workflows. It is 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:
- Automatic progress tracking for any iterable with minimal code changes
- High performance with very low overhead, even for large loops
- Clear and informative output, including iteration speed and estimated time remaining
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
rich is a modern Python library designed to create visually appealing and highly readable terminal output, including advanced progress bars. Unlike traditional progress bar libraries, rich focuses on presentation, making it ideal for applications where clarity and aesthetics matter, such as developer tools, dashboards, and command-line interfaces.
The 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 polished without adding complex logic to your code.
Key features:
- Visually rich progress bars with colors, styling, and smooth animations
- Simple API for tracking progress over iterables
- Seamless integration with other rich components such as 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. alive-progress
alive-progress is a Python library that focuses on creating animated and visually engaging progress bars for terminal applications. It stands out by providing smooth animations and dynamic indicators that make long-running tasks easier to monitor and more pleasant to watch.
This library is well suited 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 titles, styles, and behavior while keeping the implementation straightforward.
Key features:
- Smooth animated progress bars with dynamic indicators
- Flexible customization for 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. Halo
Halo is a Python library designed to display elegant spinner animations in the terminal. Instead of showing progress as a percentage or bar, Halo provides visual indicators that signal an ongoing process, making it ideal for tasks where progress cannot be easily quantified.
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 spinners make it easy to add polished feedback to command-line tools.
Key features:
- Lightweight spinner animations for indeterminate tasks
- Simple and intuitive API with start, succeed, and fail states
- 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. ipywidgets
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 renders progress indicators directly in the notebook interface, making it especially 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 Jupyter environments.
Key features:
- Native progress bar rendering inside Jupyter notebooks
- 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:
# 6. progress
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 offers multiple progress indicators, including bars, spinners, and counters, allowing developers to choose the format that best fits 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 such as bars and spinners
- 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
click is a Python library for building 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 that are distributed and used from the terminal.
The progress bar provided by click is simple, reliable, and designed to work seamlessly with its command system. It is especially useful when building data pipelines, automation scripts, or developer tools where progress feedback should 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 covered in this article, focusing on where they work best and how they are typically used.
Library
Best Use Case
Environment Support
Style
tqdm
Data processing and ML loops
Terminal, Jupyter Notebook
Simple and informative
rich
Polished CLI tools
Terminal, Jupyter Notebook
Colorful and styled
alive-progress
Animated long-running tasks
Terminal, Limited Notebook support
Animated and dynamic
Halo
Indeterminate tasks
Terminal only
Spinner-based
ipywidgets
Interactive experiments
Jupyter Notebook only
Native notebook UI
progress
Simple scripts and batch jobs
Terminal only
Minimal and classic
click
Command-line tools
Terminal (CLI)
Functional CLI output
Abid Ali Awan (@1abidaliawan) 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 telecommunication engineering. His vision is to build an AI product using a graph neural network for students struggling with mental illness.

