Lib Timer¶
Manages time.
- class idpconfgen.libs.libtimer.ProgressBar(total, prefix='', suffix='', decimals=1, bar_length=20)[source]¶
Contextualize a Progress Bar.
- Parameters:
total (int convertable) – The total number o iteractions expected.
prefix (str) – Some prefix to enhance readability.
suffix (str) – Some suffix to enhance readability.
decimals (int-convertable) – The demicals to show in percentage. Defaults to 1.
bar_length (int, float, -convertable) – The length of the bar. If not provided (
None
), uses 20.Thanks to for the initial template function
https (//dev.to/natamacm/progressbar-in-python-a3n)
Examples
>>> with ProgressBar(5000, suffix='frames') as PB: >>> for i in trajectory: >>> # do something >>> PB.increment()
- class idpconfgen.libs.libtimer.ProgressCounter(suffix='Running operations', **kwargs)[source]¶
Represent progression via a counter.
- class idpconfgen.libs.libtimer.ProgressFake(*args, **kwargs)[source]¶
Simulate the interface of ProgressBar but does nothing.
Used in servers where ProgressBar makes no sense.
- class idpconfgen.libs.libtimer.ProgressWatcher(items, *args, **kwargs)[source]¶
Construct a Progress Watcher context.