tqdm.1 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. .\" Automatically generated by Pandoc 1.19.2
  2. .\"
  3. .TH "TQDM" "1" "2015\-2021" "tqdm User Manuals" ""
  4. .hy
  5. .SH NAME
  6. .PP
  7. tqdm \- fast, extensible progress bar for Python and CLI
  8. .SH SYNOPSIS
  9. .PP
  10. tqdm [\f[I]options\f[]]
  11. .SH DESCRIPTION
  12. .PP
  13. See <https://github.com/tqdm/tqdm>.
  14. Can be used as a pipe:
  15. .IP
  16. .nf
  17. \f[C]
  18. $\ #\ count\ lines\ of\ code
  19. $\ cat\ *.py\ |\ tqdm\ |\ wc\ \-l
  20. 327it\ [00:00,\ 981773.38it/s]
  21. 327
  22. $\ #\ find\ all\ files
  23. $\ find\ .\ \-name\ "*.py"\ |\ tqdm\ |\ wc\ \-l
  24. 432it\ [00:00,\ 833842.30it/s]
  25. 432
  26. #\ ...\ and\ more\ info
  27. $\ find\ .\ \-name\ \[aq]*.py\[aq]\ \-exec\ wc\ \-l\ \\{}\ \\;\ \\
  28. \ \ |\ tqdm\ \-\-total\ 432\ \-\-unit\ files\ \-\-desc\ counting\ \\
  29. \ \ |\ awk\ \[aq]{\ sum\ +=\ $1\ };\ END\ {\ print\ sum\ }\[aq]
  30. counting:\ 100%|█████████|\ 432/432\ [00:00<00:00,\ 794361.83files/s]
  31. 131998
  32. \f[]
  33. .fi
  34. .SH OPTIONS
  35. .TP
  36. .B \-h, \-\-help
  37. Print this help and exit.
  38. .RS
  39. .RE
  40. .TP
  41. .B \-v, \-\-version
  42. Print version and exit.
  43. .RS
  44. .RE
  45. .TP
  46. .B \-\-desc=\f[I]desc\f[]
  47. str, optional.
  48. Prefix for the progressbar.
  49. .RS
  50. .RE
  51. .TP
  52. .B \-\-total=\f[I]total\f[]
  53. int or float, optional.
  54. The number of expected iterations.
  55. If unspecified, len(iterable) is used if possible.
  56. If float("inf") or as a last resort, only basic progress statistics are
  57. displayed (no ETA, no progressbar).
  58. If \f[C]gui\f[] is True and this parameter needs subsequent updating,
  59. specify an initial arbitrary large positive number, e.g.
  60. 9e9.
  61. .RS
  62. .RE
  63. .TP
  64. .B \-\-leave
  65. bool, optional.
  66. If [default: True], keeps all traces of the progressbar upon termination
  67. of iteration.
  68. If \f[C]None\f[], will leave only if \f[C]position\f[] is \f[C]0\f[].
  69. .RS
  70. .RE
  71. .TP
  72. .B \-\-ncols=\f[I]ncols\f[]
  73. int, optional.
  74. The width of the entire output message.
  75. If specified, dynamically resizes the progressbar to stay within this
  76. bound.
  77. If unspecified, attempts to use environment width.
  78. The fallback is a meter width of 10 and no limit for the counter and
  79. statistics.
  80. If 0, will not print any meter (only stats).
  81. .RS
  82. .RE
  83. .TP
  84. .B \-\-mininterval=\f[I]mininterval\f[]
  85. float, optional.
  86. Minimum progress display update interval [default: 0.1] seconds.
  87. .RS
  88. .RE
  89. .TP
  90. .B \-\-maxinterval=\f[I]maxinterval\f[]
  91. float, optional.
  92. Maximum progress display update interval [default: 10] seconds.
  93. Automatically adjusts \f[C]miniters\f[] to correspond to
  94. \f[C]mininterval\f[] after long display update lag.
  95. Only works if \f[C]dynamic_miniters\f[] or monitor thread is enabled.
  96. .RS
  97. .RE
  98. .TP
  99. .B \-\-miniters=\f[I]miniters\f[]
  100. int or float, optional.
  101. Minimum progress display update interval, in iterations.
  102. If 0 and \f[C]dynamic_miniters\f[], will automatically adjust to equal
  103. \f[C]mininterval\f[] (more CPU efficient, good for tight loops).
  104. If > 0, will skip display of specified number of iterations.
  105. Tweak this and \f[C]mininterval\f[] to get very efficient loops.
  106. If your progress is erratic with both fast and slow iterations (network,
  107. skipping items, etc) you should set miniters=1.
  108. .RS
  109. .RE
  110. .TP
  111. .B \-\-ascii=\f[I]ascii\f[]
  112. bool or str, optional.
  113. If unspecified or False, use unicode (smooth blocks) to fill the meter.
  114. The fallback is to use ASCII characters " 123456789#".
  115. .RS
  116. .RE
  117. .TP
  118. .B \-\-disable
  119. bool, optional.
  120. Whether to disable the entire progressbar wrapper [default: False].
  121. If set to None, disable on non\-TTY.
  122. .RS
  123. .RE
  124. .TP
  125. .B \-\-unit=\f[I]unit\f[]
  126. str, optional.
  127. String that will be used to define the unit of each iteration [default:
  128. it].
  129. .RS
  130. .RE
  131. .TP
  132. .B \-\-unit\-scale=\f[I]unit_scale\f[]
  133. bool or int or float, optional.
  134. If 1 or True, the number of iterations will be reduced/scaled
  135. automatically and a metric prefix following the International System of
  136. Units standard will be added (kilo, mega, etc.) [default: False].
  137. If any other non\-zero number, will scale \f[C]total\f[] and \f[C]n\f[].
  138. .RS
  139. .RE
  140. .TP
  141. .B \-\-dynamic\-ncols
  142. bool, optional.
  143. If set, constantly alters \f[C]ncols\f[] and \f[C]nrows\f[] to the
  144. environment (allowing for window resizes) [default: False].
  145. .RS
  146. .RE
  147. .TP
  148. .B \-\-smoothing=\f[I]smoothing\f[]
  149. float, optional.
  150. Exponential moving average smoothing factor for speed estimates (ignored
  151. in GUI mode).
  152. Ranges from 0 (average speed) to 1 (current/instantaneous speed)
  153. [default: 0.3].
  154. .RS
  155. .RE
  156. .TP
  157. .B \-\-bar\-format=\f[I]bar_format\f[]
  158. str, optional.
  159. Specify a custom bar string formatting.
  160. May impact performance.
  161. [default: \[aq]{l_bar}{bar}{r_bar}\[aq]], where l_bar=\[aq]{desc}:
  162. {percentage:3.0f}%|\[aq] and r_bar=\[aq]| {n_fmt}/{total_fmt}
  163. [{elapsed}<{remaining}, \[aq] \[aq]{rate_fmt}{postfix}]\[aq] Possible
  164. vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt, percentage,
  165. elapsed, elapsed_s, ncols, nrows, desc, unit, rate, rate_fmt,
  166. rate_noinv, rate_noinv_fmt, rate_inv, rate_inv_fmt, postfix,
  167. unit_divisor, remaining, remaining_s, eta.
  168. Note that a trailing ": " is automatically removed after {desc} if the
  169. latter is empty.
  170. .RS
  171. .RE
  172. .TP
  173. .B \-\-initial=\f[I]initial\f[]
  174. int or float, optional.
  175. The initial counter value.
  176. Useful when restarting a progress bar [default: 0].
  177. If using float, consider specifying \f[C]{n:.3f}\f[] or similar in
  178. \f[C]bar_format\f[], or specifying \f[C]unit_scale\f[].
  179. .RS
  180. .RE
  181. .TP
  182. .B \-\-position=\f[I]position\f[]
  183. int, optional.
  184. Specify the line offset to print this bar (starting from 0) Automatic if
  185. unspecified.
  186. Useful to manage multiple bars at once (eg, from threads).
  187. .RS
  188. .RE
  189. .TP
  190. .B \-\-postfix=\f[I]postfix\f[]
  191. dict or *, optional.
  192. Specify additional stats to display at the end of the bar.
  193. Calls \f[C]set_postfix(**postfix)\f[] if possible (dict).
  194. .RS
  195. .RE
  196. .TP
  197. .B \-\-unit\-divisor=\f[I]unit_divisor\f[]
  198. float, optional.
  199. [default: 1000], ignored unless \f[C]unit_scale\f[] is True.
  200. .RS
  201. .RE
  202. .TP
  203. .B \-\-write\-bytes
  204. bool, optional.
  205. If (default: None) and \f[C]file\f[] is unspecified, bytes will be
  206. written in Python 2.
  207. If \f[C]True\f[] will also write bytes.
  208. In all other cases will default to unicode.
  209. .RS
  210. .RE
  211. .TP
  212. .B \-\-lock\-args=\f[I]lock_args\f[]
  213. tuple, optional.
  214. Passed to \f[C]refresh\f[] for intermediate output (initialisation,
  215. iterating, and updating).
  216. .RS
  217. .RE
  218. .TP
  219. .B \-\-nrows=\f[I]nrows\f[]
  220. int, optional.
  221. The screen height.
  222. If specified, hides nested bars outside this bound.
  223. If unspecified, attempts to use environment height.
  224. The fallback is 20.
  225. .RS
  226. .RE
  227. .TP
  228. .B \-\-colour=\f[I]colour\f[]
  229. str, optional.
  230. Bar colour (e.g.
  231. \[aq]green\[aq], \[aq]#00ff00\[aq]).
  232. .RS
  233. .RE
  234. .TP
  235. .B \-\-delay=\f[I]delay\f[]
  236. float, optional.
  237. Don\[aq]t display until [default: 0] seconds have elapsed.
  238. .RS
  239. .RE
  240. .TP
  241. .B \-\-delim=\f[I]delim\f[]
  242. chr, optional.
  243. Delimiting character [default: \[aq]\\n\[aq]].
  244. Use \[aq]\\0\[aq] for null.
  245. N.B.: on Windows systems, Python converts \[aq]\\n\[aq] to
  246. \[aq]\\r\\n\[aq].
  247. .RS
  248. .RE
  249. .TP
  250. .B \-\-buf\-size=\f[I]buf_size\f[]
  251. int, optional.
  252. String buffer size in bytes [default: 256] used when \f[C]delim\f[] is
  253. specified.
  254. .RS
  255. .RE
  256. .TP
  257. .B \-\-bytes
  258. bool, optional.
  259. If true, will count bytes, ignore \f[C]delim\f[], and default
  260. \f[C]unit_scale\f[] to True, \f[C]unit_divisor\f[] to 1024, and
  261. \f[C]unit\f[] to \[aq]B\[aq].
  262. .RS
  263. .RE
  264. .TP
  265. .B \-\-tee
  266. bool, optional.
  267. If true, passes \f[C]stdin\f[] to both \f[C]stderr\f[] and
  268. \f[C]stdout\f[].
  269. .RS
  270. .RE
  271. .TP
  272. .B \-\-update
  273. bool, optional.
  274. If true, will treat input as newly elapsed iterations, i.e.
  275. numbers to pass to \f[C]update()\f[].
  276. Note that this is slow (~2e5 it/s) since every input must be decoded as
  277. a number.
  278. .RS
  279. .RE
  280. .TP
  281. .B \-\-update\-to
  282. bool, optional.
  283. If true, will treat input as total elapsed iterations, i.e.
  284. numbers to assign to \f[C]self.n\f[].
  285. Note that this is slow (~2e5 it/s) since every input must be decoded as
  286. a number.
  287. .RS
  288. .RE
  289. .TP
  290. .B \-\-null
  291. bool, optional.
  292. If true, will discard input (no stdout).
  293. .RS
  294. .RE
  295. .TP
  296. .B \-\-manpath=\f[I]manpath\f[]
  297. str, optional.
  298. Directory in which to install tqdm man pages.
  299. .RS
  300. .RE
  301. .TP
  302. .B \-\-comppath=\f[I]comppath\f[]
  303. str, optional.
  304. Directory in which to place tqdm completion.
  305. .RS
  306. .RE
  307. .TP
  308. .B \-\-log=\f[I]log\f[]
  309. str, optional.
  310. CRITICAL|FATAL|ERROR|WARN(ING)|[default: \[aq]INFO\[aq]]|DEBUG|NOTSET.
  311. .RS
  312. .RE
  313. .SH AUTHORS
  314. tqdm developers <https://github.com/tqdm>.