Coder Social home page Coder Social logo

tqdm's Introduction

tqdm

Rust implementation of Python command line progress bar tool tqdm.

From original documentation:

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!

demo

This crate provides a wrapper Iterator. It controls multiple progress bars when next is called.

Most traits are bypassed with auto-dereference, so original methods can be called with no overhead.

Usage

Just wrap anything that implements the Iterator trait with tqdm

use tqdm::tqdm;
for i in tqdm(0..10000) {
  ...
 76%|███████████████▉     | 7618/10000 [00:09<00:03, 782.14it/s]

Expose trait to allow method chaining

use tqdm::Iter;
for i in (0..).take(10000).tqdm().style(tqdm::Style::Balloon) {
  ...
 47%|**********.          | 4792/10000 [00:06<00:06, 783.39it/s]

Multi-threading is also supported!

use tqdm::tqdm;
use std::thread;
for t in (0..3) {
  thread::spawn(move || {
    for i in tqdm(0..).style(...) {
      ...
 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]

For more usage, please refer to doc

tqdm's People

Contributors

meitarr avatar mrlazy1708 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.