Skip to main content

progressBarDistributed

progressBarDistributed is a Python library that provides a tqdm-based progress bar for distributed tasks using shared memory. It allows you to track the progress of multiple workers across different processes.

Features

  • Distributed progress tracking using shared memory
  • Compatible with multiprocessing and joblib parallel processing
  • Customizable progress bar display using tqdm

Installation

To install SharedMemoryProgressBar, you can use pip:

pip install .

Usage

Usage multiprocessing

Here's a basic example of how to use SharedMemoryProgressBar using multiprocessing

import multiprocessing
def _multiprocessing_worker(worker_id, steps, shm_name):
    import time
    from progressBarDistributed import SharedMemoryProgressBarWorker
    with SharedMemoryProgressBarWorker(worker_id, shm_name) as pbar:
        pbar.set_total_steps(steps)
        for _ in range(steps):
            time.sleep(0.1)
            pbar.update(1)
    raise NotImplementedError()

def main(n_jobs):
    from progressBarDistributed import SharedMemoryProgressBar
    import random
    with SharedMemoryProgressBar(n_jobs) as pbar:
        shm_name = pbar.shm_name
        args_list = [(i, random.randint(10, 20), shm_name) for i in range(n_jobs)]
        processes = []
        for i in range(n_jobs):
            p = multiprocessing.Process(target=_multiprocessing_worker, args=args_list[i])
            p.start()
            processes.append(p)
        for p in processes:
            p.join()
if __name__ == "__main__":
    main(4)

Usage subprocess

Here's a basic example of how to use SharedMemoryProgressBar using subprocesses

### worker.py
import sys, os
import random
import time
from progressBarDistributed import SharedMemoryProgressBarWorker

def compute_steps():
    random.randint(0, 1000)
    
if __name__ == "__main__":
    shm_name = sys.argv[1]
    worker_id = int(os.environ.get("PROGRESS_BAR_WORKER_ID"))
    steps = compute_steps() #Compute the number of steps that this worker is going to do
    with SharedMemoryProgressBarWorker(worker_id, shm_name) as pbar:
        pbar.set_total_steps(steps)
        for _ in range(steps):
            time.sleep(0.1)
            pbar.update(1)
### END OF worker.py
### main.py
from subprocess import Popen
from progressBarDistributed import SharedMemoryProgressBar

def main(n_jobs):
    processes = []
    with SharedMemoryProgressBar(n_jobs) as pbar:
        for i in range(n_jobs):
            env = os.environ.copy()
            env["PROGRESS_BAR_WORKER_ID"] = str(i)
            cmd = [sys.executable, "worker.py", pbar.shm_name]
            print(cmd)
            p = Popen(cmd, universal_newlines=True, shell=False, env=env)
            processes.append(p)
        # Wait for the processes to finish
        for i, p in enumerate(processes):
            out, err = p.communicate()
if __name__ == "__main__":
    main(4)
### END OF main.py

API Reference

SharedMemoryProgressBar

__init__(n_workers, shm_name=None): Initialize the progress bar
get_worker(worker_id, shm_name): Get a worker instance
close(): Clean up resources

SharedMemoryProgressBarWorker

update(n=1): Update progress set_total_steps(n): Set the total number of steps for the worker

Metadata

Release files for progressBarDistributed 2026.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for progressBarDistributed 2026.6.0
File Size Uploaded
progressbardistributed-2026.6.0.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for progressBarDistributed 2026.6.0
File Interpreter ABI Platform
progressbardistributed-2026.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / progressbardistributed-2026.6.0.tar.gz

Download URL progressbardistributed-2026.6.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6f39f0eaf7585d0a3c2fd0ca6f21d65d610e2c55b8e1405f25ee74c725dcef01
BLAKE2b-256 checksum
How to use checksums
6f0574d25ad1590b92179bfc9ce238d79af94837bb48bb3f6688ba445180a9f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release files / progressbardistributed-2026.6.0-py3-none-any.whl

Download URL progressbardistributed-2026.6.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a8dfbff01313a9c5d68c6cd6c80b1b86ed0d8803fa7d0f13de651a88e2f83d0
BLAKE2b-256 checksum
How to use checksums
5b8433c9f1a43e2749f736076c37b338014852d9d3d5d1b8253658ba24ecc5e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.6.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page