Skip to main content

TQDM context manager thread

Project description

tqdm-thread

Python application

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 .

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-thread-0.0.6.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

tqdm_thread-0.0.6-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

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