Skip to content
Myr

move header to top of

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jaron Rosenau · committed by GitHub · parent d52eaad · Browse files · 1 file+4 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−7 removed

  • other:+4 added−7 removed

1 file+4 added−7 removed

modified:docs/utils.md+4 added-7 removed
1# Utilities23```{currentmodule} click4```54# Utilities56Besides the functionality that Click provides to interface with argument parsing and handling, it also provides a bunch7of addon functionality that is useful for writing command line utilities.89## Printing to Stdout
41 unmodified lines
5152```{versionadded} 2.053```5455The {func}`echo` function supports ANSI colors and styles. On Windows this uses [colorama].55The {func}`echo` function supports ANSI colors and styles. On Windows this uses [colorama](https://pypi.org/project/colorama/).5657Primarily this means that:5859- Click's {func}`echo` function will automatically strip ANSI color codes if the stream is not connected to a terminal.
262 unmodified lines
322Sometimes, you have command line scripts that need to process a lot of data, but you want to quickly show the user some323progress about how long that will take. Click supports simple progress bar rendering for that through the324{func}`progressbar` function.325326```{note} If you find that you have requirements beyond what Click's progress bar supports, try using [tqdm].326```{note} If you find that you have requirements beyond what Click's progress bar supports, try using [tqdm](https://tqdm.github.io/).327```328329The basic usage is very simple: the idea is that you have an iterable that you want to operate on. For each item in the330iterable it might take some time to do processing. So say you have a loop like this:
56 unmodified lines
387 for archive in zip_file:388 archive.extract()389 bar.update(archive.size)390```391392[colorama]: https://pypi.org/project/colorama/393[tqdm]: https://tqdm.github.io/