Skip to content

riklopfer/tqdm-thread

Repository files navigation

tqdm-thread

Python application Upload Python Package

When you want to show that something is working, but don't have an iterable. For example, if you're loading a large Pickle file and want to show progress. All kwargs work as expected with tqdm with a couple exceptions:

  1. step_sec -- this is new. how many seconds to sleep between steps. default: 1.0
  2. total -- since we don't actually know the total, this create a new progress bar every total steps. default: None
  3. default bar_format is different; if total then '{desc} {bar} {elapsed}' else '{desc} {elapsed}'
import time
from tqdm_thread import tqdm_thread

with tqdm_thread(desc="doing serious work"):
    # no total; no pogress bar; just a counter
    time.sleep(10)

with tqdm_thread(desc="doing serious work", total=10):
    # adding 'total' means that you will get a bar
    time.sleep(10)

with tqdm_thread(desc="doing serious work", total=5):
    # here, two progress bars will be created
    time.sleep(10)

Tests

# pip install pytest

pytest -vs .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages