Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqdm_tag-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for tqdm_tag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b021e410fa1929c61171802249cbb54e8078dba40677e5b32d352da62a1b7edd
MD5 cb3c21b50f74f5c161c9333998a0a3a0
BLAKE2b-256 985fea89252ac05290fe9e3acdc2db4864e0e0bc88bdcded7ab734b2ca4d5229

See more details on using hashes here.

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

Hashes for tqdm_tag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0f153a50f7077781ef186f37af911cbe731686b4ecdfc5dc45d3955987d886e
MD5 a7811013ec7885b4b8de6f489c8c8b39
BLAKE2b-256 7eb3e33ab40149b0bae223f32c5f4a614f283d1984299205e899f21292a6d324

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page