tqdm : A Fast, Extensible Progress Meter for Python and CLI

tqdm is intended to be used in frontends (giving end users a visual indication of progress of computations or data transfer). It is also useful for developers for debugging purposes, both as a profiling tool and also as a way of displaying logging information of an iterative task (such as error during training of machine learning algorithms). Due to its ease of use, the library is also an ideal candidate for inclusion in Python educational courses. For general (not necessarily Python) purposes, the command-line interface (CLI) mode further presents a useful tool for CLI users and system administrators monitoring data flow through pipes.


Introduction
tqdm is a progress bar library designed to be fast and extensible. It is written in Python, though ports in other languages are available. tqdm means progress in Arabic (taqadum (Ġūl, 1963)) and is an abbreviation for I love you so much in Spanish (te quiero demasiado (Yahoo Answers, 2009)).
It is a common programming problem to have iterative operations where progress monitoring is desirable or advantageous. Including statements within a for loop to print out the current iteration number is a common strategy. However, there are many improvements which could be made in such a scenario: • preventing excessive printing, such as only displaying every n th iteration; • displaying iteration rate; • displaying elapsed and estimated completion times, and • showing all of the above on one continuously updating line.
Addressing all these issues may well take up more developer time and effort than the rest of the content of the loop. Any changes to iteration rates or attempts to re-use the printing logic in a different loop may well result in suboptimal display rates -displaying every n th iteration may be too (in)frequent -requiring manual adjustment of n to fix.
tqdm addresses all of these problems once and for all, taking advantage of Pythonic patterns to make it a trivial task to add visually appealing, customisable progress bars without any significant performance degradation even in the most demanding of scenarios.
tqdm is intended to be used in frontends (giving end users a visual indication of progress of computations or data transfer). It is also useful for developers for debugging purposes, both as a profiling tool and also as a way of displaying logging information of an iterative task (such as error during training of machine learning algorithms). Due to its ease of use, the library is also an ideal candidate for inclusion in Python educational courses. For general (not necessarily Python) purposes, the command-line interface (CLI) mode further presents a useful tool for CLI users and system administrators monitoring data flow through pipes.

Features
Exhaustive documentation may be found on the project's home page.
The two basic use cases are within Python code and within a CLI: • Display customisation via arguments such as desc, postfix and bar_format • Automatic limiting of display updates to avoid slowing down due to excessive iteration rates (Stack Overflow, 2019) • Automatic detection of console width to fill the display • Automatic use of Unicode to render smooth-filling progress bars on supported terminals • Support for custom rendering frontends, including: -Command-line interface -Jupyter HTML notebooks matplotlib • Support for custom hooks/callbacks, including: pandas keras (Ben, 2019)

Availability
The package supports both Python versions 2 and 3, and is available for download via conda Unit tests are run at least weekly on cloud-based continuous integration (Travis CI, 2019), with code style and security issues checked on Codacy (Wikipedia, 2018). Coverage is reported on Coveralls and Codecov, and performance is monitored against regression (tqdm developers, 2019a).
The source code of tqdm is hosted on GitHub, where it has received over 9 thousand stars (GitHub, 2019c; timqian, 2019), and was top trending repository during a period in December 2015 (Takizawa, 2018). The documentation has received over 500 thousand hits (da Costa-Luis, 2019), with highest rates during weekdays. Historical reading rates have also trended upwards at the end of holiday periods. This implies widespread use in commercial and academic settings. OpenHub valuates the work according to the constructive cost model (COCOMO) as being worth approximately $50,000.