Enhance tqdm progress bars by assigning tags and colors to iterations.
Project description
tqdm-tag
Enhance tqdm progress bars by assigning tags and colors to iterations.
Usage
from tqdm_tag import tqdm_status
N = 100
for _ in (pbar := tqdm_status(
range(N),
total=N,
)):
if _ == 1: pbar.set_tag("warn", "yellow") # add new tag
if _ == 30: pbar.set_tag("warn") # reuse tag
if _ == 90: pbar.set_tag("error", "red") # add another tag
Example 2: change color upon completion
import time
from tqdm_tag import tqdm_status
N = 10
for _ in (pbar := tqdm_status(
range(N),
total=N,
colour="red",
)):
time.sleep(.2)
if _ == N-1: pbar.set_tag("default", "green")
Example 3: pre-defined error class
from tqdm_tag import tqdm_error
N = 100
for _ in (pbar := tqdm_error(
range(N),
total=N,
)):
if _ == 1: pbar.warn()
if _ == 30: pbar.error(color="red")
TODO: screenshots/videos
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
tqdm_tag-0.1.0.tar.gz
(10.0 kB
view details)
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 tqdm_tag-0.1.0.tar.gz.
File metadata
- Download URL: tqdm_tag-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.2 cpython/3.12.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b021e410fa1929c61171802249cbb54e8078dba40677e5b32d352da62a1b7edd
|
|
| MD5 |
cb3c21b50f74f5c161c9333998a0a3a0
|
|
| BLAKE2b-256 |
985fea89252ac05290fe9e3acdc2db4864e0e0bc88bdcded7ab734b2ca4d5229
|
File details
Details for the file tqdm_tag-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tqdm_tag-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.2 cpython/3.12.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f153a50f7077781ef186f37af911cbe731686b4ecdfc5dc45d3955987d886e
|
|
| MD5 |
a7811013ec7885b4b8de6f489c8c8b39
|
|
| BLAKE2b-256 |
7eb3e33ab40149b0bae223f32c5f4a614f283d1984299205e899f21292a6d324
|