TQDM(1)

๐Ÿ’– NAME ๐Ÿ’–

tqdm โ€” bestie, it's a progress bar for Python and CLI that's fast and extensible. That's the whole vibe. โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

tqdm [options]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so first things first, go peek at https://github.com/tqdm/tqdm โ€” that's the mothership. ๐Ÿซถ

and the way you can just... pipe into it? iconic. it's giving "slap it in the middle of a pipeline and suddenly you have โœจfeedbackโœจ". watch:

$ # count lines of code
$ cat *.py | tqdm | wc -l
327it [00:00, 981773.38it/s]
327

$ # find all files
$ find . -name "*.py" | tqdm | wc -l
432it [00:00, 833842.30it/s]
432

# ... and more info
$ find . -name '*.py' -exec wc -l \{} \; \
  | tqdm --total 432 --unit files --desc counting \
  | awk '{ sum += $1 }; END { print sum }'
counting: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 432/432 [00:00<00:00, 794361.83files/s]
131998

like?? the --total 432 --unit files --desc counting combo?? chef's kiss. ๐Ÿงš


๐Ÿ’… OPTIONS ๐Ÿ’…

okay this is the part where i hold your hand and we go through literally every single flag. no skips. no shortcuts. we're doing this together. ๐Ÿ’œ

  • -h, --help โ€” prints this help and dips out. classic. ๐Ÿ™ˆ
  • -v, --version โ€” prints the version and exits. boom. โญ
  • --desc=desc โ€” str, optional. a prefix that sits in front of your progress bar. your little label moment. ๐ŸŽ€
  • --total=total โ€” int or float, optional. how many iterations you're expecting. if you don't say, it uses len(iterable) when that's even possible. if it's float("inf") โ€” or if it's genuinely the last resort โ€” you only get the basic progress stats, so no ETA, no progress bar ๐Ÿ˜ญ. and if gui is True and this param needs to be updated later, give it an initial arbitrary big positive number, like 9e9.
  • --leave โ€” bool, optional. if [default: True], it keeps all traces of the progress bar after iteration ends. if None, it'll only leave it if position is 0.
  • --ncols=ncols โ€” int, optional. the width of the whole output message. if you set it, the bar dynamically resizes to stay inside that bound. if you don't, it tries to use the environment width. the fallback is a meter width of 10 with no limit on the counter and statistics. if it's 0, it prints no meter at all โ€” only stats.
  • --mininterval=mininterval โ€” float, optional. minimum progress display update interval, [default: 0.1] seconds. โœจ
  • --maxinterval=maxinterval โ€” float, optional. maximum progress display update interval, [default: 10] seconds. it automatically adjusts miniters to match mininterval after a long display update lag. only works if dynamic_miniters or the monitor thread is enabled. ๐Ÿ”ฅ
  • --miniters=miniters โ€” int or float, optional. minimum progress display update interval, in iterations. if 0 and dynamic_miniters, it'll auto-adjust to equal mininterval โ€” more CPU efficient, great for tight loops. if > 0, it skips displaying the specified number of iterations. tweak this and mininterval together for very efficient loops. and if your progress is erratic with both fast and slow iterations (network, skipping items, etc.) you should set miniters=1.
  • --ascii=ascii โ€” bool or str, optional. if unspecified or False, it uses unicode smooth blocks to fill the meter. the fallback is ASCII characters 123456789#.
  • --disable โ€” bool, optional. whether to disable the entire progress bar wrapper [default: False]. if set to None, it disables on non-TTY. ๐Ÿ™ˆ
  • --unit=unit โ€” str, optional. the string used to define the unit of each iteration [default: it].
  • --unit-scale=unit_scale โ€” bool or int or float, optional. if 1 or True, the number of iterations gets reduced/scaled automatically and a metric prefix following the International System of Units standard gets added (kilo, mega, etc.) [default: False]. if it's any other non-zero number, it scales total and n.
  • --dynamic-ncols โ€” bool, optional. if set, it constantly alters ncols and nrows to the environment (so window resizes work) [default: False]. ๐ŸชŸ
  • --smoothing=smoothing โ€” float, optional. exponential moving average smoothing factor for speed estimates (ignored in GUI mode). ranges from 0 (average speed) to 1 (current/instantaneous speed) [default: 0.3].
  • --bar-format=bar_format โ€” str, optional. specify a custom bar string formatting. may impact performance. [default: {l_bar}{bar}{r_bar}']`, where:
l_bar=`{desc}: {percentage:3.0f}%|'
r_bar=`| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, '
'{rate_fmt}{postfix}]'

possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt, percentage, elapsed, elapsed_s, ncols, nrows, desc, unit, rate, rate_fmt, rate_noinv, rate_noinv_fmt, rate_inv, rate_inv_fmt, postfix, unit_divisor, remaining, remaining_s, eta. also note that a trailing : is automatically removed after {desc} if {desc} is empty. ๐Ÿ’…

  • --initial=initial โ€” int or float, optional. the initial counter value. useful when you're restarting a progress bar [default: 0]. if you're using a float, consider specifying {n:.3f} or similar in bar_format, or specifying unit_scale. ๐ŸŒˆ
  • --position=position โ€” int, optional. the line offset to print this bar at (starting from 0). automatic if unspecified. useful for managing multiple bars at once (eg, from threads). ๐Ÿ‘‘
  • --postfix=postfix โ€” dict or *, optional. extra stats to display at the end of the bar. it calls set_postfix(**postfix) if possible (when it's a dict).
  • --unit-divisor=unit_divisor โ€” float, optional. [default: 1000], and it's ignored unless unit_scale is True.
  • --write-bytes โ€” bool, optional. whether to write bytes. if (default: False) it writes unicode.
  • --lock-args=lock_args โ€” tuple, optional. passed to refresh for intermediate output (initialisation, iterating, and updating).
  • --nrows=nrows โ€” int, optional. the screen height. if specified, it hides nested bars outside this bound. if unspecified, it tries to use the environment height. the fallback is 20.
  • --colour=colour โ€” str, optional. bar colour (e.g. green, #00ff00). ๐ŸŽจ
  • --delay=delay โ€” float, optional. don't display anything until [default: 0] seconds have elapsed.
  • --delim=delim โ€” chr, optional. delimiting character [default: \n]. use \0 for null. N.B.: on Windows systems, Python converts \n to \r\n.
  • --buf-size=buf_size โ€” int, optional. string buffer size in bytes [default: 256], used when delim is specified.
  • --bytes โ€” bool, optional. if true, it counts bytes, ignores delim, and defaults unit_scale to True, unit_divisor to 1024, and unit to B. ๐Ÿงฎ
  • --tee โ€” bool, optional. if true, it passes stdin to both stderr and stdout.
  • --update โ€” bool, optional. if true, it treats input as newly elapsed iterations, i.e. numbers to pass to update(). note that this is slow (~2e5 it/s) since every input must be decoded as a number. ๐Ÿ˜ญ
  • --update-to โ€” bool, optional. if true, it treats input as total elapsed iterations, i.e. numbers to assign to self.n. note that this is slow too (~2e5 it/s) since every input must be decoded as a number. ๐Ÿ˜ญ
  • --null โ€” bool, optional. if true, it discards input (no stdout).
  • --manpath=manpath โ€” str, optional. directory in which to install the tqdm man pages. ๐Ÿ“–
  • --comppath=comppath โ€” str, optional. directory in which to place tqdm completion.
  • --log=log โ€” str, optional. CRITICAL|FATAL|ERROR|WARN(ING)|[default: INFO]|DEBUG|NOTSET.

๐Ÿซถ AUTHORS ๐Ÿซถ

the tqdm developers โ€” https://github.com/tqdm โ€” absolute legends, no cap. ๐Ÿ‘‘


and that's the whole page bestie!! this was the tqdm User Manuals situation, dated 2015-2026, living under the section TQDM(1) in the General Commands Manual โ€” go forth and pipe things, i believe in you ๐Ÿ’–โœจ๐ŸŽ€
๐Ÿ“ฆ where this page comes from