tqdm
Instantly make your loops show a smart progress meter - just wrap any iterable with tqdm(iterable), and you're done!
Rust implementation of the popular Python command line progress bar tool tqdm. The name "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).
Quick Start
Simply wrap tqdm::tqdm() around any iterable:
use tqdm;
for i in tqdm
This function returns a wrapper iterator that controls multiple progress bars, advancing the meter when next is called. Methods on the original iterable are bypassed using the auto-dereference trait, so they can be called with no overhead.
76%|███████████████▉ | 7618/10000 [00:09<00:03, 782.14it/s]
Usage
Styles and other parameters can be configured in-place:
use Style;
for i in tqdm
.style
.desc
47%|**********. | 4792/10000 [00:06<00:06, 783.39it/s]
Expose the tqdm::Iter trait to allow method chaining:
use Iter;
for i in .take.tqdm
Alternatively, create a progress bar with tqdm::pbar() and manually update it:
use pbar;
let mut pbar = pbar;
for i in 0..300
Advanced Usage
Multi-bars are also supported! Tqdm maintains a global registry to handle multiple bars:
use tqdm;
for t in
38%|##########0 | 77/200 [00:00<00:01, 83.24it/s]
77%|████████████████████ | 77/100 [00:00<00:00, 83.24it/s]
19%|*****. | 77/400 [00:00<00:03, 83.24it/s]
Async iterator items can be tracked using tqdm::tqdm_async() (you may need an async runtime like tokio):
use tqdm_async;
async
For more usage, please refer to doc.