A Fast, Extensible Progress Bar for Python and CLI
Go to file
Mikhail Korobov 3ae3bc4219 update contributing docs; remove a whitespace before !; add executable flag to setup.py 2015-06-08 03:33:43 +05:00
tqdm Rename min_interval back to mininterval; add defaults to docstring; document miniters and iterable parameters. 2015-06-08 03:27:22 +05:00
.coveragerc cleanup 2015-06-08 03:06:41 +05:00
.gitignore cleanup 2015-06-08 03:06:41 +05:00
.travis.yml cleanup 2015-06-08 03:06:41 +05:00
LICENSE Initial commit 2013-10-26 11:50:04 -07:00
README.md update contributing docs; remove a whitespace before !; add executable flag to setup.py 2015-06-08 03:33:43 +05:00
logo.png Add logo to tqdm 2015-06-06 16:12:49 +02:00
setup.cfg cleanup 2015-06-08 03:06:41 +05:00
setup.py update contributing docs; remove a whitespace before !; add executable flag to setup.py 2015-06-08 03:33:43 +05:00
tox.ini use 80 columns again 2015-06-08 03:19:28 +05:00
tqdm.gif New tqdm module structure and add a Makefile 2015-06-06 15:35:28 +02:00

README.md

Logo

tqdm

Build Status Coverage Status

Instantly make your loops show a progress meter - just wrap any iterable with "tqdm(iterable)", and you're done!

tqdm (read taqadum, تقدّم) means "progress" in arabic.

Screenshot

You can also use trange(N) as a shortcut for tqdm(xrange(N))

Installation

pip install tqdm
# or
pip install -e git+https://github.com/tqdm/tqdm.git#egg=master

Documentation

def tqdm(iterable, desc='', total=None,
         leave=False, file=sys.stderr,
         mininterval=0.5, miniters=1):         
    """Get an iterable object, and return an iterator which acts exactly like
    the iterable, but prints a progress meter and updates it every time a
    value is requested.

    Parameters
    ----------
    iterable: iterable        
        Iterable to show progress for.
    desc: str, optional
        A short string, describing the progress, that is added in the beginning
        of the line.
    total : int, optional
        The number of expected iterations. If not given, len(iterable) is used
        if it is defined.
    file : `io.TextIOWrapper` or `io.StringIO`, optional
        A file-like object to output the progress message to. By default,
        sys.stderr is used.
    leave : bool, optional
        If it is False (default), tqdm deletes its traces from screen after 
        it has finished iterating over all elements.
    mininterval : float, optional
        If less than mininterval seconds have passed since the last progress 
        meter update, it is not updated again (default: 0.5).
    miniters : float, optional
        If less than miniters iterations have passed since the last progress 
        meter update, it is not updated again (default: 1).
        
    """

def trange(*args, **kwargs):
    """A shortcut for writing tqdm(xrange)"""
    return tqdm(xrange(*args), **kwargs)

Contributions

To run the testing suite please make sure tox (http://tox.testrun.org/) is installed, then type tox from the command line.

License

MIT LICENSE.

Authors

  • noamraph (original author)