A Fast, Extensible Progress Bar for Python and CLI
tqdm
tqdm
derives from the Arabic word taqaddum (تقدّم) which can mean “progress,” and is an abbreviation for “I love you so much” in Spanish (te quiero demasiado).
Instantly make your loops show a smart progress meter – just wrap any iterable with tqdm(iterable)
, and you’re done!
from tqdm import tqdm
for i in tqdm(range(10000)):
...
76%|████████████████████████ | 7568/10000 [00:33<00:10, 229.00it/s]
trange(N)
can be also used as a convenient shortcut for tqdm(range(N))
.
It can also be executed as a module with pipes:
$ seq 9999999 | tqdm --bytes | wc -l
75.2MB [00:00, 217MB/s]
9999999
$ tar -zcf - docs/ | tqdm --bytes --total `du -sb docs/