progressbar

Progress Bar for Qurrium (qurry.tools.progressbar)

qurry.tools.progressbar.default_setup(bar_format: str = 'qurry-full', bar_ascii: str = '4squares') dict[str, str][source]

Get the default setup for progress bar.

Parameters:
  • bar_format (str, optional) – The format of the bar. Defaults to ‘qurry-full’.

  • progressbar_ascii (str, optional) – The ascii of the bar. Defaults to ‘4squares’.

Returns:

The default setup for progress bar.

Return type:

dict[str, str]

qurry.tools.progressbar.qurry_progressbar(iterable: Iterable[T], *args, bar_format: str = 'qurry-full', bar_ascii: str = '4squares', **kwargs) tqdm[T][source]

A progress bar for Qurry.

Parameters:
  • iterable (Optional[Iterable[T]], optional) – The iterable object. Defaults to None.

  • bar_format (str, optional) – The format of the bar. Defaults to ‘qurry-full’.

  • bar_ascii (str, optional) – The ascii of the bar. Defaults to ‘4squares’.

Returns:

The progress bar.

Return type:

tqdm[T]

qurry.tools.progressbar.set_pbar_description(pbar: tqdm | None, description: str) None[source]

Set the description of the progress bar.

Parameters:
  • pbar (Optional[tqdm.tqdm]) – The progress bar.

  • description (str) – The description.

class qurry.tools.progressbar.tqdm(*_, **__)[source]

A fake tqdm class for type hint.

For tqdm not yet implemented their type hint by subscript like: >>> some_tqdm: tqdm[int] = tqdm(range(10))

So, we make a fake tqdm class to make it work. And it should be tracked by this issue: https://github.com/tqdm/tqdm/issues/260 To avoid the conflict, you SHOULD NOT IMPORT this class and keep it only working for qurry_progressbar() as type hint.