PQDM - Parallel TQDM

0.2.0 · active · verified Wed Apr 15

PQDM is a TQDM and concurrent futures wrapper designed to provide enjoyable parallelization of iterating through an Iterable with a progress bar. It supports both process-based and thread-based parallel execution and automatically integrates with `tqdm.notebook` in Jupyter environments. The current version is 0.2.0, with the last PyPI release in February 2022, suggesting a mature or slower development cadence.

Warnings

Install

Imports

Quickstart

This example demonstrates how to use `pqdm` to parallelize a simple CPU-bound task using 4 processes, displaying a TQDM progress bar. For I/O-bound tasks, `from pqdm.threads import pqdm` would be more appropriate.

from pqdm.processes import pqdm
import time

def long_running_task(number):
    time.sleep(0.1) # Simulate work
    return number * number

items = list(range(1, 101))

# Parallelize the task with 4 processes and a progress bar
results = pqdm(items, long_running_task, n_jobs=4, desc="Processing numbers")

print(f"First 5 results: {results[:5]}")

view raw JSON →