progressbar.multi module

class progressbar.multi.MultiBar(bars: ~typing.Iterable[tuple[str, ~progressbar.bar.ProgressBar]] | None = None, fd: ~typing.TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, prepend_label: bool = True, append_label: bool = False, label_format='{label:20.20} ', initial_format: str | None = '{label:20.20} Not yet started', finished_format: str | None = None, update_interval: float = 0.016666666666666666, show_initial: bool = True, show_finished: bool = True, remove_finished: ~datetime.timedelta | float = datetime.timedelta(seconds=3600), sort_key: str | ~progressbar.multi.SortKey = SortKey.CREATED, sort_reverse: bool = True, sort_keyfunc: ~typing.Callable[[~progressbar.bar.ProgressBar], ~typing.Any] | None = None, **progressbar_kwargs)[source]

Bases: Dict[str, ProgressBar]

append_label: bool

Automatically append the label to the progressbars

fd: TextIO
finished_format: str | None

If finished_format is None, the progressbar rendering is used.

flush()[source]
get_sorted_bars()[source]
initial_format: str | None
join(timeout=None)[source]
label_format: str

The format for the label to append/prepend to the progressbar

prepend_label: bool

Automatically prepend the label to the progressbars

print(*args, end='\n', offset=None, flush=True, clear=True, **kwargs)[source]

Print to the progressbar stream without overwriting the progressbars.

Parameters:
  • end – The string to append to the end of the output

  • offset – The number of lines to offset the output by. If None, the output will be printed above the progressbars

  • flush – Whether to flush the output to the stream

  • clear – If True, the line will be cleared before printing.

  • **kwargs – Additional keyword arguments to pass to print

progressbar_kwargs: dict[str, Any]

The kwargs passed to the progressbar constructor

remove_finished: float | None
render(flush: bool = True, force: bool = False)[source]

Render the multibar to the given stream.

run(join=True)[source]

Start the multibar render loop and run the progressbars until they have force _thread_finished.

sort_keyfunc: Callable[[ProgressBar], Any]

The progressbar sorting key function

start()[source]
stop(timeout: float | None = None)[source]
update_interval: float
class progressbar.multi.SortKey(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

Sort keys for the MultiBar.

This is a string enum, so you can use any progressbar attribute or property as a sort key.

Note that the multibar defaults to lazily rendering only the changed progressbars. This means that sorting by dynamic attributes such as value might result in more rendering which can have a small performance impact.

CREATED = 'index'
LABEL = 'label'
PERCENTAGE = 'percentage'
VALUE = 'value'