DEV Community

MrRobot
MrRobot

Posted on

tqdm - Progress Bars for Python Loops

tqdm is a Python library that provides fast, extensible, and visually appealing progress bars for loops and iterable processing. It allows developers to monitor the progress of long-running tasks, making scripts more user-friendly and easier to debug. tqdm integrates seamlessly with standard Python loops, pandas, and other iterable-based libraries. It’s commonly used in data processing, machine learning training, file operations, and any task where tracking progress is helpful.


Installation:

pip install tqdm
Enter fullscreen mode Exit fullscreen mode

Example usage:

from tqdm import tqdm
import time

for i in tqdm(range(10), desc="Processing"):
    time.sleep(0.5)  # Simulate a task
Enter fullscreen mode Exit fullscreen mode

PyPI page: https://pypi.org/project/tqdm/
GitHub page: https://github.com/tqdm/tqdm


3 Project Ideas:

  1. Track the progress of data preprocessing or transformation on large datasets.
  2. Visualize file download or upload progress in a script.
  3. Monitor the training progress of a machine learning model over multiple epochs.

Top comments (0)