CINXE.COM
tqdm documentation
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="A Fast, Extensible Progress Meter"><meta name=author content="Casper da Costa-Luis"><link href=https://tqdm.github.io/ rel=canonical><link href=docs/tqdm/ rel=next><link rel=icon href=https://tqdm.github.io/img/logo-trans.gif><meta name=generator content="mkdocs-1.6.1, mkdocs-material-9.5.46"><title>tqdm documentation</title><link rel=stylesheet href=assets/stylesheets/main.6f8fc17f.min.css><link rel=stylesheet href=assets/stylesheets/palette.06af60db.min.css><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><link rel=stylesheet href=css/extra.css><script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script><script defer data-domain=tqdm.github.io src=https://plausible.cdcl.ml/js/script.js></script><script async src=https://media.ethicalads.io/media/client/ethicalads.min.js crossorigin=anonymous></script><meta name=google-site-verification content=n_D8n0G1f7KHMv7VVD1_heCOPL-MLaG-5jtv17fXmIQ></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#tqdm class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class="md-header md-header--shadow" data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=. title="tqdm documentation" class="md-header__button md-logo" aria-label="tqdm documentation" data-md-component=logo> <img src=https://tqdm.github.io/img/logo-trans.gif alt=logo> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> tqdm documentation </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Home </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to dark mode" type=radio name=__palette id=__palette_0> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6m0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4M7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"/></svg> </label> <input class=md-option data-md-color-media data-md-color-scheme=slate data-md-color-primary=orange data-md-color-accent=indigo aria-label="Switch to light mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_0 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3"/></svg> </label> </form> <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg> </label> <div class=md-search data-md-component=search role=dialog> <label class=md-search__overlay for=__search></label> <div class=md-search__inner role=search> <form class=md-search__form name=search> <input type=text class=md-search__input name=query aria-label=Search placeholder=Search autocapitalize=off autocorrect=off autocomplete=off spellcheck=false data-md-component=search-query required> <label class="md-search__icon md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg> </label> <nav class=md-search__options aria-label=Search> <button type=reset class="md-search__icon md-icon" title=Clear aria-label=Clear tabindex=-1> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg> </button> </nav> </form> <div class=md-search__output> <div class=md-search__scrollwrap tabindex=0 data-md-scrollfix> <div class=md-search-result data-md-component=search-result> <div class=md-search-result__meta> Initializing search </div> <ol class=md-search-result__list role=presentation></ol> </div> </div> </div> </div> </div> <div class=md-header__source> <a href=https://github.com/tqdm/tqdm title="Go to repository" class=md-source data-md-component=source> <div class="md-source__icon md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg> </div> <div class=md-source__repository> tqdm/tqdm </div> </a> </div> </nav> </header> <div class=md-container data-md-component=container> <main class=md-main data-md-component=main> <div class="md-main__inner md-grid"> <div class="md-sidebar md-sidebar--primary" data-md-component=sidebar data-md-type=navigation> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav class="md-nav md-nav--primary" aria-label=Navigation data-md-level=0> <label class=md-nav__title for=__drawer> <a href=. title="tqdm documentation" class="md-nav__button md-logo" aria-label="tqdm documentation" data-md-component=logo> <img src=https://tqdm.github.io/img/logo-trans.gif alt=logo> </a> tqdm documentation </label> <div class=md-nav__source> <a href=https://github.com/tqdm/tqdm title="Go to repository" class=md-source data-md-component=source> <div class="md-source__icon md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg> </div> <div class=md-source__repository> tqdm/tqdm </div> </a> </div> <ul class=md-nav__list data-md-scrollfix> <li class="md-nav__item md-nav__item--active"> <input class="md-nav__toggle md-toggle" type=checkbox id=__toc> <a href=. class="md-nav__link md-nav__link--active"> <span class=md-ellipsis> Home </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2> <label class=md-nav__link for=__nav_2 id=__nav_2_label tabindex=0> <span class=md-ellipsis> Library Reference </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_2_label aria-expanded=false> <label class=md-nav__title for=__nav_2> <span class="md-nav__icon md-icon"></span> Library Reference </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=docs/tqdm/ class=md-nav__link> <span class=md-ellipsis> tqdm.tqdm </span> </a> </li> <li class=md-nav__item> <a href=docs/notebook/ class=md-nav__link> <span class=md-ellipsis> tqdm.notebook </span> </a> </li> <li class=md-nav__item> <a href=docs/asyncio/ class=md-nav__link> <span class=md-ellipsis> tqdm.asyncio </span> </a> </li> <li class=md-nav__item> <a href=docs/keras/ class=md-nav__link> <span class=md-ellipsis> tqdm.keras </span> </a> </li> <li class=md-nav__item> <a href=docs/dask/ class=md-nav__link> <span class=md-ellipsis> tqdm.dask </span> </a> </li> <li class=md-nav__item> <a href=docs/tk/ class=md-nav__link> <span class=md-ellipsis> tqdm.tk </span> </a> </li> <li class=md-nav__item> <a href=docs/gui/ class=md-nav__link> <span class=md-ellipsis> tqdm.gui </span> </a> </li> <li class=md-nav__item> <a href=docs/rich/ class=md-nav__link> <span class=md-ellipsis> tqdm.rich </span> </a> </li> <li class=md-nav__item> <a href=docs/cli/ class=md-nav__link> <span class=md-ellipsis> CLI </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib.concurrent/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib.concurrent </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib.itertools/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib.itertools </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib.logging/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib.logging </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib.slack/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib.slack </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib.discord/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib.discord </span> </a> </li> <li class=md-nav__item> <a href=docs/contrib.telegram/ class=md-nav__link> <span class=md-ellipsis> tqdm.contrib.telegram </span> </a> </li> <li class=md-nav__item> <a href=docs/tqdm.utils/ class=md-nav__link> <span class=md-ellipsis> tqdm.utils </span> </a> </li> <li class=md-nav__item> <a href=docs/shortcuts/ class=md-nav__link> <span class=md-ellipsis> Shortcuts </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_3> <label class=md-nav__link for=__nav_3 id=__nav_3_label tabindex=0> <span class=md-ellipsis> Developer Reference </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_3_label aria-expanded=false> <label class=md-nav__title for=__nav_3> <span class="md-nav__icon md-icon"></span> Developer Reference </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=dev/warnings/ class=md-nav__link> <span class=md-ellipsis> Warnings and Exceptions </span> </a> </li> <li class=md-nav__item> <a href=dev/TMonitor/ class=md-nav__link> <span class=md-ellipsis> tqdm.TMonitor </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=releases/ class=md-nav__link> <span class=md-ellipsis> Release History </span> </a> </li> <li class=md-nav__item> <a href=contributing/ class=md-nav__link> <span class=md-ellipsis> Contributing </span> </a> </li> <li class=md-nav__item> <a href=merch/ class=md-nav__link> <span class=md-ellipsis> Merch Store! </span> </a> </li> <li class=md-nav__item> <a href=ports/ class=md-nav__link> <span class=md-ellipsis> Ports to Other Languages </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_8> <label class=md-nav__link for=__nav_8 id=__nav_8_label tabindex=0> <span class=md-ellipsis> Presentation (PyData) </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_8_label aria-expanded=false> <label class=md-nav__title for=__nav_8> <span class="md-nav__icon md-icon"></span> Presentation (PyData) </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=presentation-%28pydata%29/video/ class=md-nav__link> <span class=md-ellipsis> Video </span> </a> </li> <li class=md-nav__item> <a href=PyData2019/slides.html class=md-nav__link> <span class=md-ellipsis> Slides </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_9> <label class=md-nav__link for=__nav_9 id=__nav_9_label tabindex=0> <span class=md-ellipsis> External Links </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_9_label aria-expanded=false> <label class=md-nav__title for=__nav_9> <span class="md-nav__icon md-icon"></span> External Links </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=https://github.com/tqdm/tqdm class=md-nav__link> <span class=md-ellipsis> Source Code (ENTIRE DOCUMENTATION ON ONE PAGE) </span> </a> </li> <li class=md-nav__item> <a href=https://github.com/tqdm/tqdm/wiki class=md-nav__link> <span class=md-ellipsis> wiki </span> </a> </li> <li class=md-nav__item> <a href=https://github.com/tqdm/tqdm#faq-and-known-issues class=md-nav__link> <span class=md-ellipsis> FAQs </span> </a> </li> <li class=md-nav__item> <a href="https://github.com/tqdm/tqdm/issues?q=" class=md-nav__link> <span class=md-ellipsis> Issues </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_9_5> <label class=md-nav__link for=__nav_9_5 id=__nav_9_5_label tabindex=0> <span class=md-ellipsis> Downloads </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_9_5_label aria-expanded=false> <label class=md-nav__title for=__nav_9_5> <span class="md-nav__icon md-icon"></span> Downloads </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=https://github.com/tqdm/tqdm/releases class=md-nav__link> <span class=md-ellipsis> GitHub </span> </a> </li> <li class=md-nav__item> <a href=https://pypi.org/project/tqdm class=md-nav__link> <span class=md-ellipsis> PyPI </span> </a> </li> <li class=md-nav__item> <a href=https://anaconda.org/conda-forge/tqdm class=md-nav__link> <span class=md-ellipsis> Conda </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_9_6> <label class=md-nav__link for=__nav_9_6 id=__nav_9_6_label tabindex=0> <span class=md-ellipsis> Tests </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_9_6_label aria-expanded=false> <label class=md-nav__title for=__nav_9_6> <span class="md-nav__icon md-icon"></span> Tests </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href="https://github.com/tqdm/tqdm/actions?query=workflow%3ATest" class=md-nav__link> <span class=md-ellipsis> GitHub Actions </span> </a> </li> <li class=md-nav__item> <a href=https://coveralls.io/github/tqdm/tqdm class=md-nav__link> <span class=md-ellipsis> Coveralls </span> </a> </li> <li class=md-nav__item> <a href=https://codecov.io/gh/tqdm/tqdm class=md-nav__link> <span class=md-ellipsis> Codecov </span> </a> </li> <li class=md-nav__item> <a href=https://www.codacy.com/app/tqdm/tqdm class=md-nav__link> <span class=md-ellipsis> Codacy </span> </a> </li> <li class=md-nav__item> <a href=https://tqdm.github.io/tqdm class=md-nav__link> <span class=md-ellipsis> Performance Benchmarks (asv) </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_9_7> <label class=md-nav__link for=__nav_9_7 id=__nav_9_7_label tabindex=0> <span class=md-ellipsis> Citations </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_9_7_label aria-expanded=false> <label class=md-nav__title for=__nav_9_7> <span class="md-nav__icon md-icon"></span> Citations </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=https://doi.org/10.5281/zenodo.595120 class=md-nav__link> <span class=md-ellipsis> DOI </span> </a> </li> <li class=md-nav__item> <a href=https://www.openhub.net/p/tqdm class=md-nav__link> <span class=md-ellipsis> Metrics (Open Hub) </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=licence/ class=md-nav__link> <span class=md-ellipsis> Licence </span> </a> </li> <li class=md-nav__item> <a href=video/ class=md-nav__link> <span class=md-ellipsis> Video </span> </a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component=sidebar data-md-type=toc> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <!-- Table of contents --> <nav class="md-nav md-nav--secondary" aria-label=toc.title> <!-- Hack: check whether the content contains a h1 headline. If it does, the top-level anchor must be skipped, since it would be redundant to the link to the current page that is located just above the anchor. Therefore we directly continue with the children of the anchor. --> <!-- Render item list --> <!-- secnav --> <div class="adaptive flat" data-ea-publisher=tqdmgithubio data-ea-type=image id=manual></div> </nav> </div> </div> </div> <div class=md-content data-md-component=content> <article class="md-content__inner md-typeset"> <p><img align=right src=https://tqdm.github.io/img/logo-trans.gif></p> <h1 id=tqdm>tqdm<a class=headerlink href=#tqdm title="Permanent link">#</a></h1> <p><a href=https://pypi.org/project/tqdm><img alt=PyPI-Versions src="https://img.shields.io/pypi/pyversions/tqdm.svg?logo=python&logoColor=white"></a> <a href=https://tqdm.github.io/releases><img alt=PyPI-Status src="https://img.shields.io/pypi/v/tqdm.svg?logo=PyPI&logoColor=white"></a> <a href=https://anaconda.org/conda-forge/tqdm><img alt=Conda-Forge-Status src="https://img.shields.io/conda/v/conda-forge/tqdm.svg?label=conda-forge&logo=conda-forge"></a> <br> <a href=https://hub.docker.com/r/tqdm/tqdm><img alt=Docker src="https://img.shields.io/badge/docker-pull-blue.svg?logo=docker&logoColor=white"></a> <a href=https://snapcraft.io/tqdm><img alt=Snapcraft src="https://img.shields.io/badge/snap-install-82BEA0.svg?logo=snapcraft"></a> <a href="https://mybinder.org/v2/gh/tqdm/tqdm/master?filepath=DEMO.ipynb"><img alt=binder-demo src=https://mybinder.org/badge_logo.svg></a></p> <p><a href=https://github.com/tqdm/tqdm/actions/workflows/test.yml><img alt=Build-Status src="https://img.shields.io/github/actions/workflow/status/tqdm/tqdm/test.yml?branch=master&label=tqdm&logo=GitHub"></a> <a href=https://coveralls.io/github/tqdm/tqdm><img alt=Coverage-Status src="https://img.shields.io/coveralls/github/tqdm/tqdm/master?logo=coveralls"></a> <a href=https://codecov.io/gh/tqdm/tqdm><img alt=Branch-Coverage-Status src=https://codecov.io/gh/tqdm/tqdm/branch/master/graph/badge.svg></a> <a href=https://www.codacy.com/app/tqdm/tqdm/dashboard><img alt=Codacy-Grade src=https://api.codacy.com/project/badge/Grade/3f965571598f44549c7818f29cdcf177></a> <br> <a href=https://pepy.tech/project/tqdm><img alt=PyPI-Downloads src="https://img.shields.io/pypi/dm/tqdm.svg?label=pypi%20downloads&logo=python&logoColor=white"></a> <a href=https://libraries.io/pypi/tqdm><img alt=Libraries-Rank src="https://img.shields.io/librariesio/sourcerank/pypi/tqdm.svg?logo=koding&logoColor=white"></a> <a href=https://repology.org/project/python:tqdm/versions><img alt=Repology src=https://repology.org/badge/tiny-repos/python:tqdm.svg></a> <a href=https://github.com/vinta/awesome-python><img alt=awesome-python src=https://awesome.re/mentioned-badge.svg></a> <a href="https://caspersci.uk.to/cgi-bin/hits.cgi?q=tqdm&a=plot&r=https://github.com/tqdm/tqdm&l=https://tqdm.github.io/img/favicon.png&f=https://tqdm.github.io/img/logo.gif&style=social"><img alt=README-Hits src="https://caspersci.uk.to/cgi-bin/hits.cgi?q=tqdm&style=social&r=https://github.com/tqdm/tqdm&l=https://tqdm.github.io/img/favicon.png&f=https://tqdm.github.io/img/logo.gif"></a></p> <hr> <p><code>tqdm</code> means "progress" in Arabic (<em>taqadum</em>, 鬲賯丿賾賲) and is an abbreviation for "I love you so much" in Spanish (<em>te quiero demasiado</em>).</p> <p>Instantly make your loops show a smart progress meter - just wrap any iterable with <code>tqdm(iterable)</code>, and you're done!</p> <div class=highlight><pre><span></span><code><span class=kn>from</span> <span class=nn>tqdm</span> <span class=kn>import</span> <span class=n>tqdm</span> <span class=k>for</span> <span class=n>i</span> <span class=ow>in</span> <span class=n>tqdm</span><span class=p>(</span><span class=nb>range</span><span class=p>(</span><span class=mi>10000</span><span class=p>)):</span> <span class=o>...</span> </code></pre></div> <p><code>76%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅 聽聽聽聽聽聽聽 | 7568/10000 [00:33<00:10, 229.00it/s]</code></p> <p><code>trange(N)</code> can be also used as a convenient shortcut for <code>tqdm(range(N))</code>.</p> <p><img alt=Screenshot src=https://tqdm.github.io/img/tqdm.gif></p> <p><a href=/video><img alt=Video src=https://tqdm.github.io/img/video.jpg></a> <a href=/PyData2019/slides.html><img alt=Slides src=https://tqdm.github.io/img/slides.jpg></a> <a href=/merch><img alt=Merch src=https://tqdm.github.io/img/merch.jpg></a></p> <p>It can also be executed as a module with pipes:</p> <div class=highlight><pre><span></span><code>$<span class=w> </span>seq<span class=w> </span><span class=m>9999999</span><span class=w> </span><span class=p>|</span><span class=w> </span>tqdm<span class=w> </span>--bytes<span class=w> </span><span class=p>|</span><span class=w> </span>wc<span class=w> </span>-l <span class=hll><span class=m>75</span>.2MB<span class=w> </span><span class=o>[</span><span class=m>00</span>:00,<span class=w> </span>217MB/s<span class=o>]</span> </span><span class=hll><span class=m>9999999</span> </span>$<span class=w> </span>7z<span class=w> </span>a<span class=w> </span>-bd<span class=w> </span>-r<span class=w> </span>backup.7z<span class=w> </span>docs/<span class=w> </span><span class=p>|</span><span class=w> </span>grep<span class=w> </span>Compressing<span class=w> </span><span class=p>|</span><span class=w> </span><span class=se>\</span> <span class=w> </span>tqdm<span class=w> </span>--total<span class=w> </span><span class=k>$(</span>find<span class=w> </span>docs/<span class=w> </span>-type<span class=w> </span>f<span class=w> </span><span class=p>|</span><span class=w> </span>wc<span class=w> </span>-l<span class=k>)</span><span class=w> </span>--unit<span class=w> </span>files<span class=w> </span>>><span class=w> </span>backup.log <span class=hll><span class=m>100</span>%<span class=p>|</span>鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枆<span class=p>|</span><span class=w> </span><span class=m>8014</span>/8014<span class=w> </span><span class=o>[</span><span class=m>01</span>:37<<span class=m>00</span>:00,<span class=w> </span><span class=m>82</span>.29files/s<span class=o>]</span> </span></code></pre></div> <p>Overhead is low -- about 60ns per iteration (80ns with <code>tqdm_gui</code>), and is unit tested against performance regression. By comparison, the well-established <a href=https://github.com/niltonvolpato/python-progressbar>ProgressBar</a> has an 800ns/iter overhead.</p> <p>In addition to its low overhead, <code>tqdm</code> uses smart algorithms to predict the remaining time and to skip unnecessary iteration displays, which allows for a negligible overhead in most cases.</p> <p><code>tqdm</code> 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.</p> <p><code>tqdm</code> does not require any dependencies (not even <code>curses</code>!), just Python and an environment supporting <code>carriage return \r</code> and <code>line feed \n</code> control characters.</p> <p><a href=https://doi.org/10.5281/zenodo.595120><img alt=DOI src=https://img.shields.io/badge/DOI-10.5281/zenodo.595120-blue.svg></a> <a href=https://raw.githubusercontent.com/tqdm/tqdm/master/LICENCE><img alt=LICENCE src=https://img.shields.io/pypi/l/tqdm.svg></a> <a href="https://www.openhub.net/p/tqdm?ref=Thin+badge"><img alt=OpenHub-Status src="https://www.openhub.net/p/tqdm/widgets/project_thin_badge?format=gif"></a> <a href=https://bestpractices.coreinfrastructure.org/projects/3264><img alt="CII Best Practices" src=https://bestpractices.coreinfrastructure.org/projects/3264/badge></a></p> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> © Casper da Costa-Luis <a href=https://github.com/casperdcl>@casperdcl</a> 2015-2022 </div> </div> <div class=md-social> <a href=https://github.com/tqdm/tqdm target=_blank rel=noopener title=github.com class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 496 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> <a href=https://github.com/tqdm/tqdm/wiki target=_blank rel=noopener title=github.com class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 640 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="m640 51.2-.3 12.2c-28.1.8-45 15.8-55.8 40.3-25 57.8-103.3 240-155.3 358.6H415l-81.9-193.1c-32.5 63.6-68.3 130-99.2 193.1-.3.3-15 0-15-.3C172 352.3 122.8 243.4 75.8 133.4 64.4 106.7 26.4 63.4.2 63.7c0-3.1-.3-10-.3-14.2h161.9v13.9c-19.2 1.1-52.8 13.3-43.3 34.2 21.9 49.7 103.6 240.3 125.6 288.6 15-29.7 57.8-109.2 75.3-142.8-13.9-28.3-58.6-133.9-72.8-160-9.7-17.8-36.1-19.4-55.8-19.7V49.8l142.5.3v13.1c-19.4.6-38.1 7.8-29.4 26.1 18.9 40 30.6 68.1 48.1 104.7 5.6-10.8 34.7-69.4 48.1-100.8 8.9-20.6-3.9-28.6-38.6-29.4.3-3.6 0-10.3.3-13.6 44.4-.3 111.1-.3 123.1-.6v13.6c-22.5.8-45.8 12.8-58.1 31.7l-59.2 122.8c6.4 16.1 63.3 142.8 69.2 156.7L559.2 91.8c-8.6-23.1-36.4-28.1-47.2-28.3V49.6l127.8 1.1z"/></svg> </a> <a href=https://github.com/tqdm/tqdm#faq-and-known-issues target=_blank rel=noopener title=github.com class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512m-86.2-346.7c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1 0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6-13.3 0-24-10.7-24-24v-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1 0-8.4-6.8-15.1-15.1-15.1h-58.3c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1-64 0"/></svg> </a> <a href=/releases/ target=_blank rel=noopener title class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 384 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128v320c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64h-37.5C269.4 26.7 233.8 0 192 0m0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64M72 272a24 24 0 1 1 48 0 24 24 0 1 1-48 0m104-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16s7.2-16 16-16M72 368a24 24 0 1 1 48 0 24 24 0 1 1-48 0m88 0c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16"/></svg> </a> <a href=https://doi.org/10.5281/zenodo.595120 target=_blank rel=noopener title=doi.org class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M294.75 188.19h-45.92V342h47.47c67.62 0 83.12-51.34 83.12-76.91 0-41.64-26.54-76.9-84.67-76.9M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8m-80.79 360.76h-29.84v-207.5h29.84zm-14.92-231.14a19.57 19.57 0 1 1 19.57-19.57 19.64 19.64 0 0 1-19.57 19.57M300 369h-81V161.26h80.6c76.73 0 110.44 54.83 110.44 103.85C410 318.39 368.38 369 300 369"/></svg> </a> <a href=/video/ target=_blank rel=noopener title class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 576 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305m-317.51 213.508V175.185l142.739 81.205z"/></svg> </a> </div> </div> </div> </footer> <div class="adaptive flat" data-ea-publisher=tqdmgithubio data-ea-type=text data-ea-style=fixedfooter id=foot></div> <script> function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); // call on next available tick } else { document.addEventListener("DOMContentLoaded", fn); } } docReady(function() { ethicalads.wait.then((placements) => { if (!placements.length) { console.debug('EthicalAds disabled'); div = document.querySelector('[data-ea-publisher]#manual') div.innerHTML = '<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5970675603981498" data-ad-slot="6206662262" data-ad-format="auto" data-full-width-responsive="true"></ins>' (adsbygoogle = window.adsbygoogle || []).push({}); console.debug('GoogleAds loaded'); } else { console.debug('EthicalAds loaded'); } }); }); </script> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": ".", "features": [], "search": "assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script> <script src=assets/javascripts/bundle.83f73b43.min.js></script> </body> </html>