localrec.progressbar module

class localrec.progressbar.ProgressBar(total, width=40, fmt='Progress: %(bar)s %(percent)3d%%', symbol='=', output=None, extraArgs=None)[source]

Bases: object

Text progress bar class for Python.

A text progress bar is typically used to display the progress of a long running operation, providing a visual cue that processing is underway.

Example:

N = 1000 pb = ProgressBar(N, fmt=ProgressBar.FULL) pb.start() for x in range(N):

pb.update(x+1) sleep(0.1)

pb.finish()

DEFAULT = 'Progress: %(bar)s %(percent)3d%%'
DOT = '.'
FULL = '%(bar)s %(current)d/%(total)d (%(percent)3d%%) %(remaining)d to go'
NOBAR = '%(current)d/%(total)d (%(percent)3d%%) %(remaining)d to go'
OBJID = '%(bar)s %(current)d/%(total)d (%(percent)3d%%) (objectId=%(objectId)d)'
finish(printNewLine=True)[source]

Finalize the progress and print last update with 100% complete message

start()[source]

Print empty progress bar.

update(value)[source]

Update the current value and print the progress. :param value: New value, should be greater than the previous

value and less or equal the total value/

Returns