1TQDM(1) TQDM(1)
2
3
4
6 tqdm - fast, extensible progress bar for Python and CLI
7
9 tqdm [options]
10
12 See <https://github.com/tqdm/tqdm>. Can be used as a pipe:
13
14 $ # count lines of code
15 $ cat *.py | tqdm | wc -l
16 327it [00:00, 981773.38it/s]
17 327
18
19 $ # find all files
20 $ find . -name "*.py" | tqdm | wc -l
21 432it [00:00, 833842.30it/s]
22 432
23
24 # ... and more info
25 $ find . -name '*.py' -exec wc -l \{} \; \
26 | tqdm --total 432 --unit files --desc counting \
27 | awk '{ sum += $1 }; END { print sum }'
28 counting: 100%|█████████| 432/432 [00:00<00:00, 794361.83files/s]
29 131998
30
32 -h, --help
33 Print this help and exit.
34
35 -v, --version
36 Print version and exit.
37
38 --desc=desc
39 str, optional. Prefix for the progressbar.
40
41 --total=total
42 int or float, optional. The number of expected iterations. If
43 unspecified, len(iterable) is used if possible. If float("inf")
44 or as a last resort, only basic progress statistics are dis‐
45 played (no ETA, no progressbar). If gui is True and this param‐
46 eter needs subsequent updating, specify an initial arbitrary
47 large positive number, e.g. 9e9.
48
49 --leave
50 bool, optional. If [default: True], keeps all traces of the
51 progressbar upon termination of iteration. If None, will leave
52 only if position is 0.
53
54 --ncols=ncols
55 int, optional. The width of the entire output message. If
56 specified, dynamically resizes the progressbar to stay within
57 this bound. If unspecified, attempts to use environment width.
58 The fallback is a meter width of 10 and no limit for the counter
59 and statistics. If 0, will not print any meter (only stats).
60
61 --mininterval=mininterval
62 float, optional. Minimum progress display update interval [de‐
63 fault: 0.1] seconds.
64
65 --maxinterval=maxinterval
66 float, optional. Maximum progress display update interval [de‐
67 fault: 10] seconds. Automatically adjusts miniters to corre‐
68 spond to mininterval after long display update lag. Only works
69 if dynamic_miniters or monitor thread is enabled.
70
71 --miniters=miniters
72 int or float, optional. Minimum progress display update inter‐
73 val, in iterations. If 0 and dynamic_miniters, will automati‐
74 cally adjust to equal mininterval (more CPU efficient, good for
75 tight loops). If > 0, will skip display of specified number of
76 iterations. Tweak this and mininterval to get very efficient
77 loops. If your progress is erratic with both fast and slow it‐
78 erations (network, skipping items, etc) you should set
79 miniters=1.
80
81 --ascii=ascii
82 bool or str, optional. If unspecified or False, use unicode
83 (smooth blocks) to fill the meter. The fallback is to use ASCII
84 characters " 123456789#".
85
86 --disable
87 bool, optional. Whether to disable the entire progressbar wrap‐
88 per [default: False]. If set to None, disable on non-TTY.
89
90 --unit=unit
91 str, optional. String that will be used to define the unit of
92 each iteration [default: it].
93
94 --unit-scale=unit_scale
95 bool or int or float, optional. If 1 or True, the number of it‐
96 erations will be reduced/scaled automatically and a metric pre‐
97 fix following the International System of Units standard will be
98 added (kilo, mega, etc.) [default: False]. If any other non-ze‐
99 ro number, will scale total and n.
100
101 --dynamic-ncols
102 bool, optional. If set, constantly alters ncols and nrows to
103 the environment (allowing for window resizes) [default: False].
104
105 --smoothing=smoothing
106 float, optional. Exponential moving average smoothing factor
107 for speed estimates (ignored in GUI mode). Ranges from 0 (aver‐
108 age speed) to 1 (current/instantaneous speed) [default: 0.3].
109
110 --bar-format=bar_format
111 str, optional. Specify a custom bar string formatting. May im‐
112 pact performance. [default: '{l_bar}{bar}{r_bar}'], where
113 l_bar='{desc}: {percentage:3.0f}%|' and r_bar='| {n_fmt}/{to‐
114 tal_fmt} [{elapsed}<{remaining}, ' '{rate_fmt}{postfix}]' Possi‐
115 ble vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt, per‐
116 centage, elapsed, elapsed_s, ncols, nrows, desc, unit, rate,
117 rate_fmt, rate_noinv, rate_noinv_fmt, rate_inv, rate_inv_fmt,
118 postfix, unit_divisor, remaining, remaining_s, eta. Note that a
119 trailing ": " is automatically removed after {desc} if the lat‐
120 ter is empty.
121
122 --initial=initial
123 int or float, optional. The initial counter value. Useful when
124 restarting a progress bar [default: 0]. If using float, consid‐
125 er specifying {n:.3f} or similar in bar_format, or specifying
126 unit_scale.
127
128 --position=position
129 int, optional. Specify the line offset to print this bar
130 (starting from 0) Automatic if unspecified. Useful to manage
131 multiple bars at once (eg, from threads).
132
133 --postfix=postfix
134 dict or *, optional. Specify additional stats to display at the
135 end of the bar. Calls set_postfix(**postfix) if possible
136 (dict).
137
138 --unit-divisor=unit_divisor
139 float, optional. [default: 1000], ignored unless unit_scale is
140 True.
141
142 --write-bytes
143 bool, optional. Whether to write bytes. If (default: False)
144 will write unicode.
145
146 --lock-args=lock_args
147 tuple, optional. Passed to refresh for intermediate output
148 (initialisation, iterating, and updating).
149
150 --nrows=nrows
151 int, optional. The screen height. If specified, hides nested
152 bars outside this bound. If unspecified, attempts to use envi‐
153 ronment height. The fallback is 20.
154
155 --colour=colour
156 str, optional. Bar colour (e.g. 'green', '#00ff00').
157
158 --delay=delay
159 float, optional. Don't display until [default: 0] seconds have
160 elapsed.
161
162 --delim=delim
163 chr, optional. Delimiting character [default: '\n']. Use '\0'
164 for null. N.B.: on Windows systems, Python converts '\n' to
165 '\r\n'.
166
167 --buf-size=buf_size
168 int, optional. String buffer size in bytes [default: 256] used
169 when delim is specified.
170
171 --bytes
172 bool, optional. If true, will count bytes, ignore delim, and
173 default unit_scale to True, unit_divisor to 1024, and unit to
174 'B'.
175
176 --tee bool, optional. If true, passes stdin to both stderr and std‐
177 out.
178
179 --update
180 bool, optional. If true, will treat input as newly elapsed it‐
181 erations, i.e. numbers to pass to update(). Note that this is
182 slow (~2e5 it/s) since every input must be decoded as a number.
183
184 --update-to
185 bool, optional. If true, will treat input as total elapsed it‐
186 erations, i.e. numbers to assign to self.n. Note that this is
187 slow (~2e5 it/s) since every input must be decoded as a number.
188
189 --null bool, optional. If true, will discard input (no stdout).
190
191 --manpath=manpath
192 str, optional. Directory in which to install tqdm man pages.
193
194 --comppath=comppath
195 str, optional. Directory in which to place tqdm completion.
196
197 --log=log
198 str, optional. CRITICAL|FATAL|ERROR|WARN(ING)|[default: 'IN‐
199 FO']|DEBUG|NOTSET.
200
202 tqdm developers <https://github.com/tqdm>.
203
204
205
206tqdm User Manuals 2015-2021 TQDM(1)