Beta/venv/lib/python3.12/site-packages/tqdm/tqdm.1

244 lines
7.4 KiB
Groff
Raw Normal View History

2026-06-16 17:09:34 +00:00
.\" Automatically generated by Pandoc 3.10
2026-02-06 22:23:20 +01:00
.\"
2026-06-16 17:09:34 +00:00
.TH "TQDM" "1" "2015\-2026" "tqdm User Manuals"
2026-02-06 22:23:20 +01:00
.SH NAME
tqdm \- fast, extensible progress bar for Python and CLI
.SH SYNOPSIS
2026-06-16 17:09:34 +00:00
tqdm [\f[I]options\f[R]]
2026-02-06 22:23:20 +01:00
.SH DESCRIPTION
2026-06-16 17:09:34 +00:00
See \c
.UR https://github.com/tqdm/tqdm
.UE \c
\&.
2026-02-06 22:23:20 +01:00
Can be used as a pipe:
.IP
2026-06-16 17:09:34 +00:00
.EX
$ \f[I]# count lines of code\f[R]
$ cat *.py \f[B]|\f[R] tqdm \f[B]|\f[R] wc \-l
327it [00:00, 981773.38it/s]
2026-02-06 22:23:20 +01:00
327
2026-06-16 17:09:34 +00:00
$ \f[I]# find all files\f[R]
$ find . \-name \(dq*.py\(dq \f[B]|\f[R] tqdm \f[B]|\f[R] wc \-l
432it [00:00, 833842.30it/s]
2026-02-06 22:23:20 +01:00
432
2026-06-16 17:09:34 +00:00
\f[I]# ... and more info\f[R]
$ find . \-name \(aq*.py\(aq \-exec wc \-l \(rs{} \(rs; \(rs
\f[B]|\f[R] tqdm \-\-total 432 \-\-unit files \-\-desc counting \(rs
\f[B]|\f[R] awk \(aq{ sum += $1 }; END { print sum }\(aq
counting: 100%\f[B]|\f[R]█████████\f[B]|\f[R] 432/432 [00:00<00:00, 794361.83files/s]
2026-02-06 22:23:20 +01:00
131998
2026-06-16 17:09:34 +00:00
.EE
2026-02-06 22:23:20 +01:00
.SH OPTIONS
.TP
2026-06-16 17:09:34 +00:00
\-h, \-\-help
2026-02-06 22:23:20 +01:00
Print this help and exit.
.TP
2026-06-16 17:09:34 +00:00
\-v, \-\-version
2026-02-06 22:23:20 +01:00
Print version and exit.
.TP
2026-06-16 17:09:34 +00:00
\-\-desc=\f[I]desc\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
2026-06-16 17:09:34 +00:00
Prefix for the progress bar.
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-total=\f[I]total\f[R]
2026-02-06 22:23:20 +01:00
int or float, optional.
The number of expected iterations.
If unspecified, len(iterable) is used if possible.
2026-06-16 17:09:34 +00:00
If float(\(lqinf\(rq) or as a last resort, only basic progress
statistics are displayed (no ETA, no progress bar).
If \f[CR]gui\f[R] is True and this parameter needs subsequent updating,
specify an initial arbitrary large positive number, e.g.\ 9e9.
.TP
\-\-leave
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
If [default: True], keeps all traces of the progress bar upon
termination of iteration.
If \f[CR]None\f[R], will leave only if \f[CR]position\f[R] is
\f[CR]0\f[R].
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-ncols=\f[I]ncols\f[R]
2026-02-06 22:23:20 +01:00
int, optional.
The width of the entire output message.
2026-06-16 17:09:34 +00:00
If specified, dynamically resizes the progress bar to stay within this
2026-02-06 22:23:20 +01:00
bound.
If unspecified, attempts to use environment width.
The fallback is a meter width of 10 and no limit for the counter and
statistics.
If 0, will not print any meter (only stats).
.TP
2026-06-16 17:09:34 +00:00
\-\-mininterval=\f[I]mininterval\f[R]
2026-02-06 22:23:20 +01:00
float, optional.
Minimum progress display update interval [default: 0.1] seconds.
.TP
2026-06-16 17:09:34 +00:00
\-\-maxinterval=\f[I]maxinterval\f[R]
2026-02-06 22:23:20 +01:00
float, optional.
Maximum progress display update interval [default: 10] seconds.
2026-06-16 17:09:34 +00:00
Automatically adjusts \f[CR]miniters\f[R] to correspond to
\f[CR]mininterval\f[R] after long display update lag.
Only works if \f[CR]dynamic_miniters\f[R] or monitor thread is enabled.
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-miniters=\f[I]miniters\f[R]
2026-02-06 22:23:20 +01:00
int or float, optional.
Minimum progress display update interval, in iterations.
2026-06-16 17:09:34 +00:00
If 0 and \f[CR]dynamic_miniters\f[R], will automatically adjust to equal
\f[CR]mininterval\f[R] (more CPU efficient, good for tight loops).
2026-02-06 22:23:20 +01:00
If > 0, will skip display of specified number of iterations.
2026-06-16 17:09:34 +00:00
Tweak this and \f[CR]mininterval\f[R] to get very efficient loops.
2026-02-06 22:23:20 +01:00
If your progress is erratic with both fast and slow iterations (network,
skipping items, etc) you should set miniters=1.
.TP
2026-06-16 17:09:34 +00:00
\-\-ascii=\f[I]ascii\f[R]
2026-02-06 22:23:20 +01:00
bool or str, optional.
If unspecified or False, use unicode (smooth blocks) to fill the meter.
2026-06-16 17:09:34 +00:00
The fallback is to use ASCII characters \(rq 123456789#\(lq.
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-disable
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
Whether to disable the entire progress bar wrapper [default: False].
2026-02-06 22:23:20 +01:00
If set to None, disable on non\-TTY.
.TP
2026-06-16 17:09:34 +00:00
\-\-unit=\f[I]unit\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
String that will be used to define the unit of each iteration [default:
it].
.TP
2026-06-16 17:09:34 +00:00
\-\-unit\-scale=\f[I]unit_scale\f[R]
2026-02-06 22:23:20 +01:00
bool or int or float, optional.
If 1 or True, the number of iterations will be reduced/scaled
automatically and a metric prefix following the International System of
2026-06-16 17:09:34 +00:00
Units standard will be added (kilo, mega, etc.)
[default: False].
If any other non\-zero number, will scale \f[CR]total\f[R] and
\f[CR]n\f[R].
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-dynamic\-ncols
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
If set, constantly alters \f[CR]ncols\f[R] and \f[CR]nrows\f[R] to the
2026-02-06 22:23:20 +01:00
environment (allowing for window resizes) [default: False].
.TP
2026-06-16 17:09:34 +00:00
\-\-smoothing=\f[I]smoothing\f[R]
2026-02-06 22:23:20 +01:00
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].
.TP
2026-06-16 17:09:34 +00:00
\-\-bar\-format=\f[I]bar_format\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
Specify a custom bar string formatting.
May impact performance.
2026-06-16 17:09:34 +00:00
[default: `{l_bar}{bar}{r_bar}'], where l_bar=`{desc}:
{percentage:3.0f}%|' and r_bar=`| {n_fmt}/{total_fmt}
[{elapsed}<{remaining}, \(cq \(cq{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.
Note that a trailing \(lq:\(rq is automatically removed after {desc} if
the latter is empty.
.TP
\-\-initial=\f[I]initial\f[R]
2026-02-06 22:23:20 +01:00
int or float, optional.
The initial counter value.
Useful when restarting a progress bar [default: 0].
2026-06-16 17:09:34 +00:00
If using float, consider specifying \f[CR]{n:.3f}\f[R] or similar in
\f[CR]bar_format\f[R], or specifying \f[CR]unit_scale\f[R].
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-position=\f[I]position\f[R]
2026-02-06 22:23:20 +01:00
int, optional.
Specify the line offset to print this bar (starting from 0) Automatic if
unspecified.
Useful to manage multiple bars at once (eg, from threads).
.TP
2026-06-16 17:09:34 +00:00
\-\-postfix=\f[I]postfix\f[R]
2026-02-06 22:23:20 +01:00
dict or *, optional.
Specify additional stats to display at the end of the bar.
2026-06-16 17:09:34 +00:00
Calls \f[CR]set_postfix(**postfix)\f[R] if possible (dict).
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-unit\-divisor=\f[I]unit_divisor\f[R]
2026-02-06 22:23:20 +01:00
float, optional.
2026-06-16 17:09:34 +00:00
[default: 1000], ignored unless \f[CR]unit_scale\f[R] is True.
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-write\-bytes
2026-02-06 22:23:20 +01:00
bool, optional.
Whether to write bytes.
If (default: False) will write unicode.
.TP
2026-06-16 17:09:34 +00:00
\-\-lock\-args=\f[I]lock_args\f[R]
2026-02-06 22:23:20 +01:00
tuple, optional.
2026-06-16 17:09:34 +00:00
Passed to \f[CR]refresh\f[R] for intermediate output (initialisation,
2026-02-06 22:23:20 +01:00
iterating, and updating).
.TP
2026-06-16 17:09:34 +00:00
\-\-nrows=\f[I]nrows\f[R]
2026-02-06 22:23:20 +01:00
int, optional.
The screen height.
If specified, hides nested bars outside this bound.
If unspecified, attempts to use environment height.
The fallback is 20.
.TP
2026-06-16 17:09:34 +00:00
\-\-colour=\f[I]colour\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
2026-06-16 17:09:34 +00:00
Bar colour (e.g.\ `green', `#00ff00').
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-delay=\f[I]delay\f[R]
2026-02-06 22:23:20 +01:00
float, optional.
2026-06-16 17:09:34 +00:00
Don\(cqt display until [default: 0] seconds have elapsed.
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-delim=\f[I]delim\f[R]
2026-02-06 22:23:20 +01:00
chr, optional.
2026-06-16 17:09:34 +00:00
Delimiting character [default: `\(rsn'].
Use `\(rs0' for null.
N.B.: on Windows systems, Python converts `\(rsn' to `\(rsr\(rsn'.
.TP
\-\-buf\-size=\f[I]buf_size\f[R]
2026-02-06 22:23:20 +01:00
int, optional.
2026-06-16 17:09:34 +00:00
String buffer size in bytes [default: 256] used when \f[CR]delim\f[R] is
2026-02-06 22:23:20 +01:00
specified.
.TP
2026-06-16 17:09:34 +00:00
\-\-bytes
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
If true, will count bytes, ignore \f[CR]delim\f[R], and default
\f[CR]unit_scale\f[R] to True, \f[CR]unit_divisor\f[R] to 1024, and
\f[CR]unit\f[R] to `B'.
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-tee
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
If true, passes \f[CR]stdin\f[R] to both \f[CR]stderr\f[R] and
\f[CR]stdout\f[R].
2026-02-06 22:23:20 +01:00
.TP
2026-06-16 17:09:34 +00:00
\-\-update
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
If true, will treat input as newly elapsed iterations, i.e.\ numbers to
pass to \f[CR]update()\f[R].
Note that this is slow (\(ti2e5 it/s) since every input must be decoded
as a number.
.TP
\-\-update\-to
2026-02-06 22:23:20 +01:00
bool, optional.
2026-06-16 17:09:34 +00:00
If true, will treat input as total elapsed iterations, i.e.\ numbers to
assign to \f[CR]self.n\f[R].
Note that this is slow (\(ti2e5 it/s) since every input must be decoded
as a number.
.TP
\-\-null
2026-02-06 22:23:20 +01:00
bool, optional.
If true, will discard input (no stdout).
.TP
2026-06-16 17:09:34 +00:00
\-\-manpath=\f[I]manpath\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
Directory in which to install tqdm man pages.
.TP
2026-06-16 17:09:34 +00:00
\-\-comppath=\f[I]comppath\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
Directory in which to place tqdm completion.
.TP
2026-06-16 17:09:34 +00:00
\-\-log=\f[I]log\f[R]
2026-02-06 22:23:20 +01:00
str, optional.
2026-06-16 17:09:34 +00:00
CRITICAL|FATAL|ERROR|WARN(ING)|[default: `INFO']|DEBUG|NOTSET.
2026-02-06 22:23:20 +01:00
.SH AUTHORS
2026-06-16 17:09:34 +00:00
tqdm developers \c
.UR https://github.com/tqdm
.UE \c.