# TQDM | A Fast, Extensible Progress Bar for Python and CLI ⚡

**URL:** <https://onehack.st/t/tqdm-a-fast-extensible-progress-bar-for-python-and-cli/288110>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, gaming\
**Created:** [August 1, 2024, 8:47pm UTC](https://onehack.st/t/tqdm-a-fast-extensible-progress-bar-for-python-and-cli/288110 "2024-08-01T20:47:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [August 1, 2024, 8:47pm UTC](https://onehack.st/t/tqdm-a-fast-extensible-progress-bar-for-python-and-cli/288110/1 "2024-08-01T20:47:29Z")

</div>

[![Logo](https://camo.githubusercontent.com/650407309fabdeec9052e49df4f0c3acee037fdb89491ce4f773c46863de8a3f/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f6c6f676f2e676966)](https://camo.githubusercontent.com/650407309fabdeec9052e49df4f0c3acee037fdb89491ce4f773c46863de8a3f/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f6c6f676f2e676966)

## tqdm

[![Py-Versions](https://camo.githubusercontent.com/2d3afb7d3908ae5ba147c10bdd97056e5e967f3fcde174bb389909a566deb610/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f7471646d2e7376673f6c6f676f3d707974686f6e266c6f676f436f6c6f723d7768697465)](https://pypi.org/project/tqdm) [![Versions](https://camo.githubusercontent.com/57bedf03c91878ecf5d6100e01c4a8bd32af6a890a6ff53da5a9ec79aa742aa9/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f7471646d2e737667) ](https://tqdm.github.io/releases)[![Conda-Forge-Status](https://camo.githubusercontent.com/4dd297b27dca3804e2daded85e6aae79293f96d939929b7550b3810a3c596d89/68747470733a2f2f696d672e736869656c64732e696f2f636f6e64612f762f636f6e64612d666f7267652f7471646d2e7376673f6c6162656c3d636f6e64612d666f726765266c6f676f3d636f6e64612d666f726765)](https://anaconda.org/conda-forge/tqdm) [![Docker](https://camo.githubusercontent.com/cdc4cc69ff7a8b920c7c1a4a0c90db7cc598f6bb0c3a1df1037d3421f97c4b24/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f636b65722d70756c6c2d626c75652e7376673f6c6f676f3d646f636b6572266c6f676f436f6c6f723d7768697465)](https://hub.docker.com/r/tqdm/tqdm) [![Snapcraft](https://camo.githubusercontent.com/0a898e4a3d84a2ef16c587236f22d4b241f12532606f14dc06f27c1886e776d9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736e61702d696e7374616c6c2d3832424541302e7376673f6c6f676f3d736e61706372616674)](https://snapcraft.io/tqdm)

[![Build-Status](https://camo.githubusercontent.com/743f11984a5735008002ac2d2b146517e0b53a5788c4f07b0291ef5883ae9f34/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7471646d2f7471646d2f746573742e796d6c3f6272616e63683d6d6173746572266c6162656c3d7471646d266c6f676f3d476974487562)](https://github.com/tqdm/tqdm/actions/workflows/test.yml) [![Coverage-Status](https://camo.githubusercontent.com/7639fe08cb27e54ac75488ee27916eb03c8df097ee4f5f643c21c58bd31b99e2/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f7471646d2f7471646d2f6d61737465723f6c6f676f3d636f766572616c6c73)](https://coveralls.io/github/tqdm/tqdm) [![Branch-Coverage-Status](https://camo.githubusercontent.com/9c4eaabf6f8f3d24b4fc00f126a8c0df2fd9e2a9d4ef7859bfd19eaea4af93c0/68747470733a2f2f636f6465636f762e696f2f67682f7471646d2f7471646d2f6272616e63682f6d61737465722f67726170682f62616467652e737667) ](https://codecov.io/gh/tqdm/tqdm)[![Codacy-Grade](https://camo.githubusercontent.com/f9600995c10eb7e782e6a2e01efc42ba72baa2d38fd55f9cea9bc262232f19e6/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3366393635353731353938663434353439633738313866323963646366313737)](https://www.codacy.com/gh/tqdm/tqdm/dashboard) [![Libraries-Rank](https://camo.githubusercontent.com/e76acc3aebfce561dcefb3b472c92c77e21318edcd1c969c6703056810fc4025/68747470733a2f2f696d672e736869656c64732e696f2f6c6962726172696573696f2f736f7572636572616e6b2f707970692f7471646d2e7376673f6c6f676f3d6b6f64696e67266c6f676f436f6c6f723d7768697465)](https://libraries.io/pypi/tqdm) [![PyPI-Downloads](https://camo.githubusercontent.com/aa22cf48a6cfa083365bb7a424140e071547ec0f6719d94ba498cd8a1783a6bf/68747470733a2f2f696d672e736869656c64732e696f2f707970692f646d2f7471646d2e7376673f6c6162656c3d70797069253230646f776e6c6f616473266c6f676f3d50795049266c6f676f436f6c6f723d7768697465)](https://pepy.tech/project/tqdm)

[![LICENCE](https://camo.githubusercontent.com/62cd4a6b09cdef89e490fbf35d6f87ea065debc77dcb9f3635234dc81ca8b9bc/68747470733a2f2f696d672e736869656c64732e696f2f707970692f6c2f7471646d2e737667) ](https://raw.githubusercontent.com/tqdm/tqdm/master/LICENCE)[![OpenHub-Status](https://camo.githubusercontent.com/60c39c4397fa01770752a5d4a33284bf26932162ad6865953724a519c210ea0b/68747470733a2f2f7777772e6f70656e6875622e6e65742f702f7471646d2f776964676574732f70726f6a6563745f7468696e5f62616467653f666f726d61743d676966)](https://www.openhub.net/p/tqdm?ref=Thin+badge) [![binder-demo](https://camo.githubusercontent.com/e91e1d353a8b6acf0b42547ac3901f2c30138a3abaaa3d3c242da30b5b4f8426/68747470733a2f2f6d7962696e6465722e6f72672f62616467655f6c6f676f2e737667) ](https://mybinder.org/v2/gh/tqdm/tqdm/master?filepath=DEMO.ipynb)[![awesome-python](https://camo.githubusercontent.com/522920003893b259cdbe58547f34408775b7b65bd699e11092999f8019b3cc07/68747470733a2f2f617765736f6d652e72652f6d656e74696f6e65642d62616467652e737667)](https://github.com/vinta/awesome-python)

`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))`.

[![Screenshot](https://camo.githubusercontent.com/a7e57543a292da510fb55fae610e93ff6e3d022fd99b2ed343f4250d01f0fbdc/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f7471646d2e676966)](https://camo.githubusercontent.com/a7e57543a292da510fb55fae610e93ff6e3d022fd99b2ed343f4250d01f0fbdc/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f7471646d2e676966)  
[![Video](https://camo.githubusercontent.com/50cfe1e9ba5197111646f3b664d740ff7129d1cdeed3316d2cb049ce9be20120/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f766964656f2e6a7067)](https://tqdm.github.io/video) [![Slides](https://camo.githubusercontent.com/90e020891174f924c40aef4128eeee21193eb0b45b14d538170261ff3e7d6c41/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f736c696465732e6a7067)](https://tqdm.github.io/PyData2019/slides.html) [![Merch](https://camo.githubusercontent.com/d49b66fa32b3adf6b22893b9a6079da21a92e7d0f56c82fdc521197f5a2fd053/68747470733a2f2f7471646d2e6769746875622e696f2f696d672f6d657263682e6a7067)](https://tqdm.github.io/merch)

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/ | cut -f1` \ \> backup.tgz 32%|██████████▍ | 8.89G/27.9G [00:42\<01:31, 223MB/s]

Overhead is low – about 60ns per iteration (80ns with `tqdm.gui`), and is unit tested against performance regression. By comparison, the well-established [ProgressBar](https://github.com/niltonvolpato/python-progressbar) has an 800ns/iter overhead.

In addition to its low overhead, `tqdm` uses smart algorithms to predict the remaining time and to skip unnecessary iteration displays, which allows for a negligible overhead in most cases.

`tqdm` works on any platform (Linux, Windows, Mac, FreeBSD, NetBSD, Solaris/SunOS), in any console or in a GUI, and is also friendly with IPython/Jupyter notebooks.

`tqdm` does not require any dependencies (not even `curses`!), just Python and an environment supporting `carriage return \r` and `line feed \n` control characters.

* * *

Table of contents

- [Installation](https://github.com/tqdm/tqdm#installation)
  - [Latest PyPI stable release](https://github.com/tqdm/tqdm#latest-pypi-stable-release)
  - [Latest development release on GitHub](https://github.com/tqdm/tqdm#latest-development-release-on-github)
  - [Latest Conda release](https://github.com/tqdm/tqdm#latest-conda-release)
  - [Latest Snapcraft release](https://github.com/tqdm/tqdm#latest-snapcraft-release)
  - [Latest Docker release](https://github.com/tqdm/tqdm#latest-docker-release)
  - [Other](https://github.com/tqdm/tqdm#other)

- [Changelog](https://github.com/tqdm/tqdm#changelog)
- [Usage](https://github.com/tqdm/tqdm#usage)
  - [Iterable-based](https://github.com/tqdm/tqdm#iterable-based)
  - [Manual](https://github.com/tqdm/tqdm#manual)
  - [Module](https://github.com/tqdm/tqdm#module)

- [FAQ and Known Issues](https://github.com/tqdm/tqdm#faq-and-known-issues)
- [Documentation](https://github.com/tqdm/tqdm#documentation)
  - [Parameters](https://github.com/tqdm/tqdm#parameters)
  - [Extra CLI Options](https://github.com/tqdm/tqdm#extra-cli-options)
  - [Returns](https://github.com/tqdm/tqdm#returns)
  - [Convenience Functions](https://github.com/tqdm/tqdm#convenience-functions)
  - [Submodules](https://github.com/tqdm/tqdm#submodules)
    - [`contrib`](https://github.com/tqdm/tqdm#contrib)

- [Examples and Advanced Usage](https://github.com/tqdm/tqdm#examples-and-advanced-usage)
  - [Description and additional stats](https://github.com/tqdm/tqdm#description-and-additional-stats)
  - [Nested progress bars](https://github.com/tqdm/tqdm#nested-progress-bars)
  - [Hooks and callbacks](https://github.com/tqdm/tqdm#hooks-and-callbacks)
  - [`asyncio`](https://github.com/tqdm/tqdm#asyncio)
  - [Pandas Integration](https://github.com/tqdm/tqdm#pandas-integration)
  - [Keras Integration](https://github.com/tqdm/tqdm#keras-integration)
  - [Dask Integration](https://github.com/tqdm/tqdm#dask-integration)
  - [IPython/Jupyter Integration](https://github.com/tqdm/tqdm#ipython-jupyter-integration)
  - [Custom Integration](https://github.com/tqdm/tqdm#custom-integration)
  - [Dynamic Monitor/Meter](https://github.com/tqdm/tqdm#dynamic-monitor-meter)
  - [Writing messages](https://github.com/tqdm/tqdm#writing-messages)
  - [Redirecting writing](https://github.com/tqdm/tqdm#redirecting-writing)
  - [Redirecting `logging`](https://github.com/tqdm/tqdm#redirecting-logging)
  - [Monitoring thread, intervals and miniters](https://github.com/tqdm/tqdm#monitoring-thread-intervals-and-miniters)

- [Merch](https://github.com/tqdm/tqdm#merch)
- [Contributions](https://github.com/tqdm/tqdm#contributions)
  - [Ports to Other Languages](https://github.com/tqdm/tqdm#ports-to-other-languages)

- [LICENCE](https://github.com/tqdm/tqdm#licence)

## GitHub:

[https://github.com/tqdm/tqdm](https://github.com/tqdm/tqdm)
