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: str = '{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: ~typing.Any)[source]¶
Bases:
dict
[str
,ProgressBar
]- print(*args: Any, end: str = '\n', offset: int | None = None, flush: bool = True, clear: bool = True, **kwargs: Any)[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
- render(flush: bool = True, force: bool = False) None [source]¶
Render the multibar to the given stream.
- run(join: bool = True) None [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
- class progressbar.multi.SortKey(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
-
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'¶