A simple progress bar
Project description
Simple Progress Bar
Simplicity is the ultimate sophistication.
—— Leonardo da Vinci
A simple and elegant progress bar library for Python, built on top of Rich.
Installation
pip install simple-pbar
Usage
Basic Usage
from simple_pbar import simple_pbar, SimpleTask
import time
with simple_pbar(
SimpleTask(desc="Time consuming task", total=5),
) as pbar:
for i in range(5):
time.sleep(1)
pbar.go()
Multiple Tasks
from simple_pbar import simple_pbar, SimpleTask
import time
with simple_pbar(
SimpleTask(name="epoch", desc="Epoch Iteration", total=5),
SimpleTask(name="batch", desc="Batch Iteration", total=5),
) as pbar:
for i in range(5):
for j in range(5):
time.sleep(1)
pbar.go(name="batch", advance=1)
pbar.go(name="epoch", advance=1)
pbar.reset(name="batch")
Customize Columns
from simple_pbar import simple_pbar, SimpleTask, SimpleColumn
import time
with simple_pbar(
SimpleTask(name="epoch", desc="Epoch Iteration", total=5),
SimpleTask(name="batch", desc="Batch Iteration", total=5),
columns=[
SimpleColumn(name="current", desc="Current Index"),
]
) as pbar:
for i in range(5):
pbar.update_column(name="epoch", column_name="current", value=i)
for j in range(5):
pbar.update_column(name="batch", column_name="current", value=j)
time.sleep(1)
pbar.go(name="batch", advance=1)
pbar.go(name="epoch", advance=1)
pbar.reset(name="batch")
Log
from simple_pbar import simple_pbar, SimpleTask
import time
with simple_pbar(
SimpleTask(desc="Time consuming task", total=5),
) as pbar:
for i in range(5):
pbar.log(f"Iteration {i} started")
time.sleep(1)
pbar.go()
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 simple_pbar-0.1.1-py3-none-any.whl.
File metadata
- Download URL: simple_pbar-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a8f82d4bbee3b3f3ccd6ce45f607024ac51f057fd9dc1226616d0ff683f6300
|
|
| MD5 |
d9bdd552566a5f4231f8847385e72f02
|
|
| BLAKE2b-256 |
74fe4f9cae0e0e521a041e34d31719371d0c7544f9d7dadef7389477c67f7d50
|