progressbar.fast module

The lean, widget-free renderer used by progressbar.progressbar().

FastProgressBar reuses the full ProgressBar lifecycle (update gate, native iterator, stream redirect, resizing) and replaces only the render step with one fixed formatter, so the common “just wrap my loop” case stays cheap. See docs/explanation/performance-and-the-fast-path.rst for the full layer breakdown and measured costs.

class progressbar.fast.FastProgressBar(min_value: float = 0, max_value: float | type[<class 'progressbar.base.UnknownLength'>] | None = None, widgets: ~collections.abc.Sequence[~typing.Any] | None = None, left_justify: bool = True, initial_value: float = 0, poll_interval: ~datetime.timedelta | float | None = None, widget_kwargs: dict[str, ~typing.Any] | None = None, custom_len: ~collections.abc.Callable[[str], int] = <function len_color>, max_error: bool = True, prefix: str | None = None, suffix: str | None = None, variables: dict[str, ~typing.Any] | None = None, min_poll_interval: ~datetime.timedelta | float | None = None, desc: str | None = None, total: float | type[<class 'progressbar.base.UnknownLength'>] | None = None, unit: str = 'it', unit_scale: bool = False, postfix: ~typing.Any = None, **kwargs: ~typing.Any)[source]

Bases: ProgressBar

A lean ProgressBar whose render bypasses the widget system.

Reuses the full ProgressBar lifecycle (the next-update gate, the native iterator, stream redirect, resize, start/update/finish) and overrides only the render with a fixed formatter, so the common case is import- and render-cheap. Output stays close to the default look without the gradient.

Initializes a progress bar with sane defaults.

default_widgets() list[Any][source]

Return no widgets – _format_line renders everything itself.