Share progress bars via pbar.io - works with tqdm, rich, and more
Project description
pbar-io Python Client
Share your progress bars online with pbar.io - the universal progress bar service.
Installation
pip install pbar-io
Quick Start
With tqdm (recommended)
from tqdm import tqdm
from pbar_io import register
# One line to share your progress bar online
for item in register(tqdm(range(1000), desc="Training model")):
# Your code here
process(item)
# Automatically prints: Track progress at https://pbar.io/abc123
Manual usage
from pbar_io import ProgressBar
# Create a progress bar
bar = ProgressBar(title="Processing files", total=100)
print(f"Track at: {bar.url}")
# Update progress
for i in range(100):
process_file(i)
bar.update(1) # or bar.increment()
# Set specific value
bar.set(50)
# Update with metadata
bar.update(1, metadata={"eta": "5 minutes", "rate": "10 files/sec"})
Hierarchical progress bars
from pbar_io import ProgressBar
# Create parent bar
parent = ProgressBar(title="Overall progress", total=3)
# Create child bars
task1 = ProgressBar(title="Task 1", total=100, parent=parent)
task2 = ProgressBar(title="Task 2", total=200, parent=parent)
task3 = ProgressBar(title="Task 3", total=150, parent=parent)
# Parent automatically updates as children progress
for i in range(100):
task1.update(1)
With rich
from rich.progress import Progress
from pbar_io import track_rich
with Progress() as progress:
task = progress.add_task("Processing...", total=100)
# Enable remote tracking
track_rich(progress, task)
for i in range(100):
progress.update(task, advance=1)
Features
- 🌐 Universal Access - View progress in browser, terminal, or mobile
- 🚀 Real-time Updates - Live progress via WebSockets
- 🔒 Privacy Options - Public or private progress bars
- 📊 Hierarchical Progress - Parent-child progress tracking
- 🎨 Beautiful Terminal Output - ANSI colors in terminal
- ⚡ Zero Config - No account required for public bars
Configuration
from pbar_io import configure
# Set custom API endpoint (for self-hosted instances)
configure(api_url="https://your-instance.com/api")
# Use API key for private bars and higher limits
configure(api_key="your_api_key")
# Set default retention time
configure(retention_hours=24)
CLI Usage
# Create a progress bar from command line
pbar create "Backup in progress" --total 100
# Update progress
pbar update <id> --increment 10
# View in terminal
pbar view <id>
# Watch progress with auto-refresh
pbar watch <id>
API Reference
ProgressBar
class ProgressBar:
def __init__(self, title: str, total: int = 100, parent: ProgressBar = None,
unit: str = None, metadata: dict = None, public: bool = True)
@property
def url(self) -> str: ...
@property
def id(self) -> str: ...
def update(self, n: int = 1, metadata: dict = None) -> None: ...
def increment(self, n: int = 1) -> None: ...
def set(self, value: int) -> None: ...
def close(self) -> None: ...
Integration Functions
def register(pbar) -> Any:
"""Register any progress bar for remote tracking"""
def track_tqdm(tqdm_instance) -> None:
"""Track a tqdm progress bar"""
def track_rich(progress, task_id) -> None:
"""Track a rich progress task"""
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pbar_io-0.1.0.tar.gz.
File metadata
- Download URL: pbar_io-0.1.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8a55a0cf06c81ae43307f3f69dd0cad8bfc5ddbe0994bbe4c3647774a8b61f3
|
|
| MD5 |
125073846f9e8a93b8346d87d224c06b
|
|
| BLAKE2b-256 |
36e0367499645332a99b9101857c36b9770765ced104f58e5bc6b9a463e58ee6
|
Provenance
The following attestation bundles were made for pbar_io-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on rhodes73/pbar.io
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pbar_io-0.1.0.tar.gz -
Subject digest:
c8a55a0cf06c81ae43307f3f69dd0cad8bfc5ddbe0994bbe4c3647774a8b61f3 - Sigstore transparency entry: 452854864
- Sigstore integration time:
-
Permalink:
rhodes73/pbar.io@99111ecc8019a7d5478612418e46b14b4ddb52dd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rhodes73
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@99111ecc8019a7d5478612418e46b14b4ddb52dd -
Trigger Event:
release
-
Statement type:
File details
Details for the file pbar_io-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pbar_io-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff4ac9f907c47bd03837e27d62aca68708531e92734ac36698e340b102f9cd70
|
|
| MD5 |
7c6a35c865b262f4bb35ec82c907d955
|
|
| BLAKE2b-256 |
2b55c0a3a4ce15f9c94c14c1f3d19472e7f9a695d542f4f9a0259bdb19cbd2f8
|
Provenance
The following attestation bundles were made for pbar_io-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on rhodes73/pbar.io
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pbar_io-0.1.0-py3-none-any.whl -
Subject digest:
ff4ac9f907c47bd03837e27d62aca68708531e92734ac36698e340b102f9cd70 - Sigstore transparency entry: 452854865
- Sigstore integration time:
-
Permalink:
rhodes73/pbar.io@99111ecc8019a7d5478612418e46b14b4ddb52dd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rhodes73
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@99111ecc8019a7d5478612418e46b14b4ddb52dd -
Trigger Event:
release
-
Statement type: