.\" Man page generated from reStructuredText. . .TH "ENLIGHTEN" "1" "Dec 30, 2020" "1.7.2" "Enlighten" .SH NAME enlighten \- Enlighten Documentation . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH PIP .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ pip install enlighten .ft P .fi .UNINDENT .UNINDENT .SH RPM .SS Fedora and EL8 (RHEL/CentOS) .sp (\fI\%EPEL\fP repositories must be \fI\%configured\fP for EL8) .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ dnf install python3\-enlighten .ft P .fi .UNINDENT .UNINDENT .SS EL7 (RHEL/CentOS) .sp (\fI\%EPEL\fP repositories must be \fI\%configured\fP) .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ yum install python2\-enlighten $ yum install python36\-enlighten .ft P .fi .UNINDENT .UNINDENT .SH PKG .SS Arch Linux .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ pacman \-S python\-enlighten .ft P .fi .UNINDENT .UNINDENT .SH DEB .SS Debian and Ubuntu .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ apt\-get install python3\-enlighten .ft P .fi .UNINDENT .UNINDENT .SH BASIC .sp For a basic status bar, invoke the \fBCounter\fP class directly. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import time import enlighten pbar = enlighten.Counter(total=100, desc=\(aqBasic\(aq, unit=\(aqticks\(aq) for num in range(100): time.sleep(0.1) # Simulate work pbar.update() .ft P .fi .UNINDENT .UNINDENT .SH ADVANCED .sp To maintain multiple progress bars simultaneously or write to the console, a manager is required. .sp Advanced output will only work when the output stream, \fBsys.stdout\fP by default, is attached to a TTY. \fBget_manager()\fP can be used to get a manager instance. It will return a disabled \fBManager\fP instance if the stream is not attached to a TTY and an enabled instance if it is. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import time import enlighten manager = enlighten.get_manager() ticks = manager.counter(total=100, desc=\(aqTicks\(aq, unit=\(aqticks\(aq) tocks = manager.counter(total=20, desc=\(aqTocks\(aq, unit=\(aqtocks\(aq) for num in range(100): time.sleep(0.1) # Simulate work print(num) ticks.update() if not num % 5: tocks.update() manager.stop() .ft P .fi .UNINDENT .UNINDENT .SH COUNTERS .sp The \fBCounter\fP class has two output formats, progress bar and counter. .sp The progress bar format is used when a total is not \fBNone\fP and the count is less than the total. If neither of these conditions are met, the counter format is used: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import time import enlighten counter = enlighten.Counter(desc=\(aqBasic\(aq, unit=\(aqticks\(aq) for num in range(100): time.sleep(0.1) # Simulate work counter.update() .ft P .fi .UNINDENT .UNINDENT .SH STATUS BARS .sp Status bars are bars that work similarly to progress similarly to progress bars and counters, but present relatively static information. Status bars are created with \fBManager.status_bar\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import enlighten import time manager = enlighten.get_manager() status_bar = manager.status_bar(\(aqStatic Message\(aq, color=\(aqwhite_on_red\(aq, justify=enlighten.Justify.CENTER) time.sleep(1) status_bar.update(\(aqUpdated static message\(aq) time.sleep(1) .ft P .fi .UNINDENT .UNINDENT .sp Status bars can also use formatting with dynamic variables. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import enlighten import time manager = enlighten.get_manager() status_format = \(aq{program}{fill}Stage: {stage}{fill} Status {status}\(aq status_bar = manager.status_bar(status_format=status_format, color=\(aqbold_slategray\(aq, program=\(aqDemo\(aq, stage=\(aqLoading\(aq, status=\(aqOKAY\(aq) time.sleep(1) status_bar.update(stage=\(aqInitializing\(aq, status=\(aqOKAY\(aq) time.sleep(1) status_bar.update(status=\(aqFAIL\(aq) .ft P .fi .UNINDENT .UNINDENT .sp Status bars, like other bars can be pinned. To pin a status bar to the top of all other bars, initialize it before any other bars. To pin a bar to the bottom of the screen, use \fBposition=1\fP when initializing. .sp See \fBStatusBar\fP for more details. .SH COLOR .sp Status bars and the bar component of a progress bar can be colored by setting the \fBcolor\fP keyword argument. See Series Color for more information about valid colors. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import time import enlighten counter = enlighten.Counter(total=100, desc=\(aqColorized\(aq, unit=\(aqticks\(aq, color=\(aqred\(aq) for num in range(100): time.sleep(0.1) # Simulate work counter.update() .ft P .fi .UNINDENT .UNINDENT .sp Additionally, any part of the progress bar can be colored using counter formatting and the \fI\%color capabilities\fP of the underlying \fI\%Blessed\fP \fI\%Terminal\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import enlighten manager = enlighten.get_manager() # Standard bar format std_bar_format = u\(aq{desc}{desc_pad}{percentage:3.0f}%|{bar}| \(aq + \e u\(aq{count:{len_total}d}/{total:d} \(aq + \e u\(aq[{elapsed}<{eta}, {rate:.2f}{unit_pad}{unit}/s]\(aq # Red text bar_format = manager.term.red(std_bar_format) # Red on white background bar_format = manager.term.red_on_white(std_bar_format) # X11 colors bar_format = manager.term.peru_on_seagreen(std_bar_format) # RBG text bar_format = manager.term.color_rgb(2, 5, 128)(std_bar_format) # RBG background bar_format = manager.term.on_color_rgb(255, 190, 195)(std_bar_format) # RGB text and background bar_format = manager.term.on_color_rgb(255, 190, 195)(std_bar_format) bar_format = manager.term.color_rgb(2, 5, 128)(bar_format) # Apply color to select parts bar_format = manager.term.red(u\(aq{desc}\(aq) + u\(aq{desc_pad}\(aq + \e manager.term.blue(u\(aq{percentage:3.0f}%\(aq) + u\(aq|{bar}|\(aq # Apply to counter ticks = manager.counter(total=100, desc=\(aqTicks\(aq, unit=\(aqticks\(aq, bar_format=bar_format) .ft P .fi .UNINDENT .UNINDENT .sp If the \fBcolor\fP option is applied to a \fBCounter\fP, it will override any foreground color applied. .SH MULTICOLORED .sp The bar component of a progress bar can be multicolored to track multiple categories in a single progress bar. .sp The colors are drawn from right to left in the order they were added. .sp By default, when multicolored progress bars are used, additional fields are available for \fBbar_format\fP: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 count_n (\fBint\fP) \- Current value of \fBcount\fP .IP \(bu 2 count_0(\fBint\fP) \- Remaining count after deducting counts for all subcounters .IP \(bu 2 percentage_n (\fBfloat\fP) \- Percentage complete .IP \(bu 2 percentage_0(\fBfloat\fP) \- Remaining percentage after deducting percentages for all subcounters .UNINDENT .UNINDENT .UNINDENT .sp When \fBadd_subcounter()\fP is called with \fBall_fields\fP set to \fBTrue\fP, the subcounter will have the additional fields: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 eta_n (\fBstr\fP) \- Estimated time to completion .IP \(bu 2 rate_n (\fBfloat\fP) \- Average increments per second since parent was created .UNINDENT .UNINDENT .UNINDENT .sp More information about \fBbar_format\fP can be found in the Format section of the API. .sp One use case for multicolored progress bars is recording the status of a series of tests. In this example, Failures are red, errors are white, and successes are green. The count of each is listed in the progress bar. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import random import time import enlighten bar_format = u\(aq{desc}{desc_pad}{percentage:3.0f}%|{bar}| \(aq + \e u\(aqS:{count_0:{len_total}d} \(aq + \e u\(aqF:{count_2:{len_total}d} \(aq + \e u\(aqE:{count_1:{len_total}d} \(aq + \e u\(aq[{elapsed}<{eta}, {rate:.2f}{unit_pad}{unit}/s]\(aq success = enlighten.Counter(total=100, desc=\(aqTesting\(aq, unit=\(aqtests\(aq, color=\(aqgreen\(aq, bar_format=bar_format) errors = success.add_subcounter(\(aqwhite\(aq) failures = success.add_subcounter(\(aqred\(aq) while success.count < 100: time.sleep(random.uniform(0.1, 0.3)) # Random processing time result = random.randint(0, 10) if result == 7: errors.update() if result in (5, 6): failures.update() else: success.update() .ft P .fi .UNINDENT .UNINDENT .sp A more complicated example is recording process start\-up. In this case, all items will start red, transition to yellow, and eventually all will be green. The count, percentage, rate, and eta fields are all derived from the second subcounter added. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import random import time import enlighten services = 100 bar_format = u\(aq{desc}{desc_pad}{percentage_2:3.0f}%|{bar}|\(aq + \e u\(aq {count_2:{len_total}d}/{total:d} \(aq + \e u\(aq[{elapsed}<{eta_2}, {rate_2:.2f}{unit_pad}{unit}/s]\(aq initializing = enlighten.Counter(total=services, desc=\(aqStarting\(aq, unit=\(aqservices\(aq, color=\(aqred\(aq, bar_format=bar_format) starting = initializing.add_subcounter(\(aqyellow\(aq) started = initializing.add_subcounter(\(aqgreen\(aq, all_fields=True) while started.count < services: remaining = services \- initializing.count if remaining: num = random.randint(0, min(4, remaining)) initializing.update(num) ready = initializing.count \- initializing.subcount if ready: num = random.randint(0, min(3, ready)) starting.update_from(initializing, num) if starting.count: num = random.randint(0, min(2, starting.count)) started.update_from(starting, num) time.sleep(random.uniform(0.1, 0.5)) # Random processing time .ft P .fi .UNINDENT .UNINDENT .SH ADDITIONAL EXAMPLES .INDENT 0.0 .IP \(bu 2 \fBbasic\fP \- Basic progress bar .IP \(bu 2 \fBcontext manager\fP \- Managers and counters as context managers .IP \(bu 2 \fBfloats\fP \- Support totals and counts that are \fBfloats\fP .IP \(bu 2 \fBmulticolored\fP \- Multicolored progress bars .IP \(bu 2 \fBmultiple with logging\fP \- Nested progress bars and logging .IP \(bu 2 \fBFTP downloader\fP \- Show progress downloading files from FTP .IP \(bu 2 \fBMultiprocessing queues\fP \- Progress bars with queues for IPC .UNINDENT .SH CUSTOMIZATION .sp Enlighten is highly configurable. For information on modifying the output, see the Series and Format sections of the \fBCounter\fP documentation. .SH ENABLE / DISABLE .sp A program may want to disable progress bars based on a configuration setting as well as if output redirection occurs. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import sys import enlighten # Example configuration object config = {\(aqstream\(aq: sys.stdout, \(aquseCounter\(aq: False} enableCounter = config[\(aquseCounter\(aq] and stream.isatty() manager = enlighten.Manager(stream=config[\(aqstream\(aq], enabled=enableCounter) .ft P .fi .UNINDENT .UNINDENT .sp The \fBget_manager()\fP function slightly simplifies this .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import enlighten # Example configuration object config = {\(aqstream\(aq: None, # Defaults to sys.stdout \(aquseCounter\(aq: False} manager = enlighten.get_manager(stream=config[\(aqstream\(aq], enabled=config[\(aquseCounter\(aq]) .ft P .fi .UNINDENT .UNINDENT .SH CONTEXT MANAGERS .sp Both \fBCounter\fP and \fBManager\fP can be used as context managers. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import enlighten SPLINES = 100 with enlighten.Manager() as manager: with manager.counter(total=SPLINES, desc=\(aqReticulating:\(aq, unit=\(aqsplines\(aq) as retic: for num in range(SPLINES + 1): retic.update() .ft P .fi .UNINDENT .UNINDENT .SH AUTOMATIC UPDATING .sp Both \fBCounter\fP and Both \fBSubCounter\fP instances can be called as functions on one or more iterators. A generator is returned which yields each element of the iterables and then updates the count by 1. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 When a \fBCounter\fP instance is called as a function, type checking is lazy and won\(aqt validate an iterable was passed until iteration begins. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import time import enlighten flock1 = [\(aqHarry\(aq, \(aqSally\(aq, \(aqRandy\(aq, \(aqMandy\(aq, \(aqDanny\(aq, \(aqJoe\(aq] flock2 = [\(aqPunchy\(aq, \(aqKicky\(aq, \(aqSpotty\(aq, \(aqTouchy\(aq, \(aqBrenda\(aq] total = len(flock1) + len(flock2) manager = enlighten.Manager() pbar = manager.counter(total=total, desc=\(aqCounting Sheep\(aq, unit=\(aqsheep\(aq) for sheep in pbar(flock1, flock2): time.sleep(0.2) print(\(aq%s: Baaa\(aq % sheep) .ft P .fi .UNINDENT .UNINDENT .SH USER-DEFINED FIELDS .sp Both \fBCounter\fP and Both \fBStatusBar\fP accept user defined fields as keyword arguments at initialization and during an update. These fields are persistent and only need to be specified when they change. .sp In the following example, \fBsource\fP is a user\-defined field that is periodically updated. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C import enlighten import random import time bar_format = u\(aq{desc}{desc_pad}{source} {percentage:3.0f}%|{bar}| \(aq + \e u\(aq{count:{len_total}d}/{total:d} \(aq + \e u\(aq[{elapsed}<{eta}, {rate:.2f}{unit_pad}{unit}/s]\(aq manager = enlighten.get_manager(bar_format=bar_format) bar = manager.counter(total=100, desc=\(aqLoading\(aq, unit=\(aqfiles\(aq, source=\(aqserver.a\(aq) for num in range(100): time.sleep(0.1) # Simulate work if not num % 5: bar.update(source=random.choice([\(aqserver.a\(aq, \(aqserver.b\(aq, \(aqserver.c\(aq])) else: bar.update() .ft P .fi .UNINDENT .UNINDENT .sp For more information, see the Counter Format and StatusBar Format sections. .SH WHY IS ENLIGHTEN CALLED ENLIGHTEN? .sp A progress bar\(aqs purpose is to inform the user about an ongoing process. Enlighten, meaning "to inform", seems a fitting name. (Plus any names related to progress were already taken) .SH IS WINDOWS SUPPORTED? .sp Enlighten has supported Windows since version 1.3.0. .sp Windows does not currently support resizing. .sp Enlighten also works relatively well in Linux\-like subsystems for Windows such as \fI\%Cygwin\fP or \fI\%Windows Subsystem for Linux\fP\&. .SH IS PYCHARM SUPPORTED? .sp PyCharm uses multiple consoles and the behavior differs depending on how the code is called. .sp Enlighten works natively in the PyCharm command terminal. .sp To use Enlighten with Run or Debug, terminal emulation must be enabled. Navigate to \fIRun \-> Edit Configurations \-> Templates \-> Python\fP and select \fIEmulate terminal in output console\fP\&. .sp The PyCharm Python console is currently not supported because \fBsys.stdout\fP does not reference a valid TTY. .SH CAN YOU ADD SUPPORT FOR _______ TERMINAL? .sp We are happy to add support for as many terminals as we can. However, not all terminals can be supported. There a few requirements. .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP 1. 3 The terminal must be detectable programmatically .INDENT 3.0 .INDENT 3.5 We need to be able to identify the terminal in some reasonable way and differentiate it from other terminals. This could be through environment variables, the \fBplatform\fP module, or some other method. .UNINDENT .UNINDENT .IP 2. 3 A subset of terminal codes must be supported .INDENT 3.0 .INDENT 3.5 While these codes may vary among terminals, the capability must be provided and activated by printing a terminal sequence. The required codes are listed below. .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 move / CUP \- Cursor Position .IP \(bu 2 hide_cursor / DECTCEM \- Text Cursor Enable Mode .IP \(bu 2 show_cursor / DECTCEM \- Text Cursor Enable Mode .IP \(bu 2 csr / DECSTBM \- Set Top and Bottom Margins .IP \(bu 2 clear_eos / ED \- Erase in Display .IP \(bu 2 clear_eol / EL \- Erase in Line .IP \(bu 2 feed / CUD \- Cursor Down (Or scroll with linefeed) .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .IP 3. 3 Terminal dimensions must be detectable .INDENT 3.0 .INDENT 3.5 The height and width of the terminal must be available to the running process. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH WHY DOES RUNTIMEERROR: REENTRANT CALL GET RAISED SOMETIMES DURING A RESIZE? .sp This is caused when another thread or process is writing to a standard stream (STDOUT, STDERR) at the same time the resize signal handler is writing to the stream. .sp Enlighten tries to detect when a program is threaded or running multiple processes and defer resize handling until the next normal write event. However, this condition is evaluated when the scroll area is set, typically when the first counter is added. If no threads or processes are detected at that time, and the value of threaded was not set explicitly, resize events will not be deferred. .sp In order to guarantee resize handling is deferred, it is best to pass \fBthreaded=True\fP when creating a manager instance. .SH CLASSES .INDENT 0.0 .TP .B class enlighten.Manager(stream=None, counter_class=Counter, **kwargs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBstream\fP (file object) \-\- Output stream. If \fBNone\fP, defaults to \fBsys.stdout\fP .IP \(bu 2 \fBcounter_class\fP (class) \-\- Progress bar class (Default: \fI\%Counter\fP) .IP \(bu 2 \fBset_scroll\fP (\fIbool\fP) \-\- Enable scroll area redefinition (Default: \fBTrue\fP) .IP \(bu 2 \fBcompanion_stream\fP (file object) \-\- See \fI\%companion_stream\fP below. (Default: \fBNone\fP) .IP \(bu 2 \fBenabled\fP (\fIbool\fP) \-\- Status (Default: True) .IP \(bu 2 \fBno_resize\fP (\fIbool\fP) \-\- Disable resizing support .IP \(bu 2 \fBthreaded\fP (\fIbool\fP) \-\- When True resize handling is deferred until next write (Default: False unless multiple threads or multiple processes are detected) .IP \(bu 2 \fBkwargs\fP (\fIDict\fP\fI[\fP\fIstr\fP\fI, \fP\fIAny\fP\fI]\fP) \-\- Any additional keyword arguments will be used as default values when \fI\%counter()\fP is called. .UNINDENT .UNINDENT .sp Manager class for outputting progress bars to streams attached to TTYs .sp Progress bars are displayed at the bottom of the screen with standard output displayed above. .sp \fBcompanion_stream\fP .INDENT 7.0 .INDENT 3.5 A companion stream is a file object that shares a TTY with the primary output stream. The cursor position in the companion stream will be moved in coordination with the primary stream. .sp If the value is \fBNone\fP, \fBsys.stdout\fP and \fBsys.stderr\fP will be used as companion streams. Unless explicitly specified, a stream which is not attached to a TTY (the case when redirected to a file), will not be used as a companion stream. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B counter(position=None, **kwargs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBposition\fP (\fIint\fP) \-\- Line number counting from the bottom of the screen .IP \(bu 2 \fBautorefresh\fP (\fIbool\fP) \-\- Refresh this counter when other bars are drawn .IP \(bu 2 \fBkwargs\fP (\fIDict\fP\fI[\fP\fIstr\fP\fI, \fP\fIAny\fP\fI]\fP) \-\- Any additional keyword arguments are passed to \fI\%Counter\fP .UNINDENT .TP .B Returns Instance of counter class .TP .B Return type \fI\%Counter\fP .UNINDENT .sp Get a new progress bar instance .sp If \fBposition\fP is specified, the counter\(aqs position will be pinned. A \fBValueError\fP will be raised if \fBposition\fP exceeds the screen height or has already been pinned by another counter. .sp If \fBautorefresh\fP is \fBTrue\fP, this bar will be redrawn whenever another bar is drawn assuming it had been \fBmin_delta\fP seconds since the last update. This is usually unnecessary. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Counters are not automatically drawn when created because fields may be missing if subcounters are used. To force the counter to draw before updating, call \fI\%refresh()\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B status_bar(*args, **kwargs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBposition\fP (\fIint\fP) \-\- Line number counting from the bottom of the screen .IP \(bu 2 \fBautorefresh\fP (\fIbool\fP) \-\- Refresh this counter when other bars are drawn .IP \(bu 2 \fBkwargs\fP (\fIDict\fP\fI[\fP\fIstr\fP\fI, \fP\fIAny\fP\fI]\fP) \-\- Any additional keyword arguments are passed to \fI\%StatusBar\fP .UNINDENT .TP .B Returns Instance of status bar class .TP .B Return type \fI\%StatusBar\fP .UNINDENT .sp Get a new status bar instance .sp If \fBposition\fP is specified, the counter\(aqs position can change dynamically if additional counters are called without a \fBposition\fP argument. .sp If \fBautorefresh\fP is \fBTrue\fP, this bar will be redrawn whenever another bar is drawn assuming it had been \fBmin_delta\fP seconds since the last update. Generally, only need when \fBelapsed\fP is used in \fI\%status_format\fP\&. .UNINDENT .INDENT 7.0 .TP .B stop() Clean up and reset terminal .sp This method should be called when the manager and counters will no longer be needed. .sp Any progress bars that have \fBleave\fP set to \fBTrue\fP or have not been closed will remain on the console. All others will be cleared. .sp Manager and all counters will be disabled. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class enlighten.Counter(**kwargs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBbar_format\fP (\fIstr\fP) \-\- Progress bar format, see \fI\%Format\fP below .IP \(bu 2 \fBcount\fP (\fIint\fP) \-\- Initial count (Default: 0) .IP \(bu 2 \fBcounter_format\fP (\fIstr\fP) \-\- Counter format, see \fI\%Format\fP below .IP \(bu 2 \fBcolor\fP (\fIstr\fP) \-\- Series color as a string or RGB tuple see \fI\%Series Color\fP .IP \(bu 2 \fBdesc\fP (\fIstr\fP) \-\- Description .IP \(bu 2 \fBenabled\fP (\fIbool\fP) \-\- Status (Default: \fBTrue\fP) .IP \(bu 2 \fBfill\fP (\fIstr\fP) \-\- Fill character used for \fBcounter_format\fP (Default: \(aq \(aq) .IP \(bu 2 \fBfields\fP (\fIdict\fP) \-\- Additional fields used for \fI\%formatting\fP .IP \(bu 2 \fBleave\fP (\fITrue\fP) \-\- Leave progress bar after closing (Default: \fBTrue\fP) .IP \(bu 2 \fBmanager\fP (\fI\%Manager\fP) \-\- Manager instance. Creates instance if not specified. .IP \(bu 2 \fBmin_delta\fP (\fIfloat\fP) \-\- Minimum time, in seconds, between refreshes (Default: 0.1) .IP \(bu 2 \fBoffset\fP (\fIint\fP) \-\- Number of non\-printable characters to account for when formatting .IP \(bu 2 \fBseries\fP (sequence) \-\- Progression series, see \fI\%Series\fP below .IP \(bu 2 \fBstream\fP (file object) \-\- Output stream. Not used when instantiated through a manager .IP \(bu 2 \fBtotal\fP (\fIint\fP) \-\- Total count when complete .IP \(bu 2 \fBunit\fP (\fIstr\fP) \-\- Unit label .UNINDENT .UNINDENT .sp Progress bar and counter class .sp A \fI\%Counter\fP instance can be created with the \fI\%Manager.counter()\fP method or, when a standalone progress bar for simple applications is required, the \fI\%Counter\fP class can be called directly. The output stream will default to \fBsys.stdout\fP unless \fBstream\fP is set. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 With the default values for \fBbar_format\fP and \fBcounter_format\fP, \fBfloats\fP can not be used for \fBtotal\fP, \fBcount\fP, or provided to \fI\%update()\fP\&. In order to use \fBfloats\fP, provide custom formats to \fBbar_format\fP and \fBcounter_format\fP\&. See \fI\%Format\fP below. .UNINDENT .UNINDENT .sp \fBSeries\fP .INDENT 7.0 .INDENT 3.5 The progress bar is constructed from the characters in \fBseries\fP\&. \fBseries\fP must be a sequence (\fBstr\fP, \fBlist\fP, \fBtuple\fP) containing single characters. .sp Default progress series (\fBseries\fP): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C \(aq ▏▎▍▌▋▊▉█\(aq .ft P .fi .UNINDENT .UNINDENT .sp The first character is the fill character. When the \fBcount\fP is 0, the bar will be made up of only this character. In the example below, characters 5 through 9 are fill characters. .sp The last character is the full character. When the \fBcount\fP is equal to \fBtotal\fP, the bar will be made up of only this character. In the example below, characters 0 through 3 are full characters. .sp The remaining characters are fractional characters used to more accurately represent the transition between the full and fill characters. In the example below, character 4 is a fractional character. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C \(aq45% |████▋ |\(aq \(aq0123456789\(aq .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp \fBSeries Color\fP .INDENT 7.0 .INDENT 3.5 The characters specified by \fBseries\fP will be displayed in the terminal\(aqs current foreground color. This can be overwritten with the \fBcolor\fP argument. .sp \fBcolor\fP can be specified as \fBNone\fP, a \fBstring\fP or, an iterable of three integers, 0 \- 255, describing an RGB color. .sp For backward compatibility, a color can be expressed as an integer 0 \- 255, but this is deprecated in favor of named or RGB colors. .sp Compound colors, such as \(aqwhite_on_seagreen\(aq, \(aqbold_red\(aq, or \(aqunderline_on_peru\(aq are also supported. .sp If a terminal is not capable of 24\-bit color, and is given a color outside of its range, the color will be downconverted to a supported color. .sp Valid colors for 8 color terminals: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 black .IP \(bu 2 blue .IP \(bu 2 cyan .IP \(bu 2 green .IP \(bu 2 magenta .IP \(bu 2 red .IP \(bu 2 white .IP \(bu 2 yellow .UNINDENT .UNINDENT .UNINDENT .sp Additional colors for 16 color terminals: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 bright_black .IP \(bu 2 bright_blue .IP \(bu 2 bright_cyan .IP \(bu 2 bright_green .IP \(bu 2 bright_magenta .IP \(bu 2 bright_red .IP \(bu 2 bright_white .IP \(bu 2 bright_yellow .UNINDENT .UNINDENT .UNINDENT .sp See this \fI\%chart\fP for a complete list of supported color strings. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If an invalid color is specified, an \fBAttributeError\fP will be raised .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp \fBFormat\fP .INDENT 7.0 .INDENT 3.5 If \fBtotal\fP is \fBNone\fP or \fBcount\fP becomes higher than \fBtotal\fP, the counter format will be used instead of the progress bar format. .sp Default counter format (\fBcounter_format\fP): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C \(aq{desc}{desc_pad}{count:d} {unit}{unit_pad}{elapsed}, {rate:.2f}{unit_pad}{unit}/s]{fill}\(aq # Example output \(aqLoaded 30042 Files [00:01, 21446.45 Files/s] \(aq .ft P .fi .UNINDENT .UNINDENT .sp Default progress bar format (\fBbar_format\fP): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C \(aq{desc}{desc_pad}{percentage:3.0f}%|{bar}| {count:{len_total}d}/{total:d} [{elapsed}<{eta}, {rate:.2f}{unit_pad}{unit}/s]\(aq # Example output \(aqProcessing 22%|█████▊ | 23/101 [00:27<01:32, 0.84 Files/s]\(aq .ft P .fi .UNINDENT .UNINDENT .sp Available fields: .INDENT 0.0 .IP \(bu 2 count(\fBint\fP) \- Current value of \fBcount\fP .IP \(bu 2 desc(\fBstr\fP) \- Value of \fBdesc\fP .IP \(bu 2 desc_pad(\fBstr\fP) \- A single space if \fBdesc\fP is set, otherwise empty .IP \(bu 2 elapsed(\fBstr\fP) \- Time elapsed since instance was created .IP \(bu 2 interval(\fBfloat\fP) \- Average seconds per iteration (inverse of rate) .IP \(bu 2 rate(\fBfloat\fP) \- Average iterations per second since instance was created .IP \(bu 2 unit(\fBstr\fP) \- Value of \fBunit\fP .IP \(bu 2 unit_pad(\fBstr\fP) \- A single space if \fBunit\fP is set, otherwise empty .UNINDENT .sp Additional fields for \fBbar_format\fP only: .INDENT 0.0 .IP \(bu 2 bar(\fBstr\fP) \- Progress bar draw with characters from \fBseries\fP .IP \(bu 2 eta(\fBstr\fP) \- Estimated time to completion .IP \(bu 2 len_total(\fBint\fP) \- Length of \fBtotal\fP when converted to a string .IP \(bu 2 percentage(\fBfloat\fP) \- Percentage complete .IP \(bu 2 total(\fBint\fP) \- Value of \fBtotal\fP .UNINDENT .sp Additional fields for \fBcounter_format\fP only: .INDENT 0.0 .IP \(bu 2 fill(\fBstr\fP) \- Filled with \fI\%fill\fP until line is width of terminal. May be used multiple times. Minimum width is 3. .UNINDENT .sp Additional fields when subcounters are used: .INDENT 0.0 .IP \(bu 2 count_n (\fBint\fP) \- Current value of \fBcount\fP .IP \(bu 2 count_0(\fBint\fP) \- Remaining count after deducting counts for all subcounters .IP \(bu 2 percentage_n (\fBfloat\fP) \- Percentage complete (\fBbar_format\fP only) .IP \(bu 2 percentage_0(\fBfloat\fP) \- Remaining percentage after deducting percentages for all subcounters (\fBbar_format\fP only) .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fBn\fP denotes the order the subcounter was added starting at 1. For example, \fBcount_1\fP is the count for the first subcounter added and \fBcount_2\fP is the count for the second subcounter added. .UNINDENT .UNINDENT .sp Additional fields when \fI\%add_subcounter()\fP is called with \fBall_fields\fP set to \fBTrue\fP: .INDENT 0.0 .IP \(bu 2 eta_n (\fBstr\fP) \- Estimated time to completion (\fBbar_format\fP only) .IP \(bu 2 interval_n(\fBfloat\fP) \- Average seconds per iteration (inverse of rate) .IP \(bu 2 rate_n (\fBfloat\fP) \- Average iterations per second since parent was created .UNINDENT .sp User\-defined fields: .INDENT 0.0 .INDENT 3.5 Users can define fields in two ways, the \fBfields\fP parameter and by passing keyword arguments to \fI\%Manager.counter()\fP or \fI\%Counter.update()\fP .sp The \fBfields\fP parameter can be used to pass a dictionary of additional user\-defined fields. The dictionary values can be updated after initialization to allow for dynamic fields. Any fields that share names with built\-in fields are ignored. .sp If fields are passed as keyword arguments to \fI\%Manager.counter()\fP or \fI\%Counter.update()\fP, they take precedent over the \fBfields\fP parameter. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp \fBOffset\fP .INDENT 7.0 .INDENT 3.5 When \fBoffset\fP is \fBNone\fP, the width of the bar portion of the progress bar and the fill size for counter will be automatically determined, taking into account terminal escape sequences that may be included in the string. .sp Under special circumstances, and to permit backward compatibility, \fBoffset\fP may be explicitly set to an \fBint\fP value. When explicitly set, automatic detection of escape sequences is disabled. .UNINDENT .UNINDENT .sp \fBInstance Attributes\fP .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .TP .B count \fBint\fP \- Current count .UNINDENT .INDENT 0.0 .TP .B desc \fBstr\fP \- Description .UNINDENT .INDENT 0.0 .TP .B elapsed \fBfloat\fP \- Time since start (since last update if \fBcount\(gaequals :py:attr:\(gatotal\fP) .UNINDENT .INDENT 0.0 .TP .B enabled \fBbool\fP \- Current status .UNINDENT .INDENT 0.0 .TP .B manager \fI\%Manager\fP \- Manager Instance .UNINDENT .INDENT 0.0 .TP .B position \fBint\fP \- Current position .UNINDENT .INDENT 0.0 .TP .B total \fBint\fP \- Total count when complete .UNINDENT .INDENT 0.0 .TP .B unit \fBstr\fP \- Unit label .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B add_subcounter(color, count=0, all_fields=False) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcolor\fP (\fIstr\fP) \-\- Series color as a string or RGB tuple see \fI\%Series Color\fP .IP \(bu 2 \fBcount\fP (\fIint\fP) \-\- Initial count (Default: 0) .IP \(bu 2 \fBall_fields\fP (\fIbool\fP) \-\- Populate \fBrate\fP, \fBinterval\fP, and \fBeta\fP formatting fields (Default: False) .UNINDENT .TP .B Returns Subcounter instance .TP .B Return type \fI\%SubCounter\fP .UNINDENT .sp Add a subcounter for multicolored progress bars .UNINDENT .INDENT 7.0 .TP .B clear(flush=True) .INDENT 7.0 .TP .B Parameters \fBflush\fP (\fIbool\fP) \-\- Flush stream after clearing bar (Default:True) .UNINDENT .sp Clear bar .UNINDENT .INDENT 7.0 .TP .B close(clear=False) Do final refresh and remove from manager .sp If \fBleave\fP is True, the default, the effect is the same as \fI\%refresh()\fP\&. .UNINDENT .INDENT 7.0 .TP .B property color Color property .sp Preferred to be a string or iterable of three integers for RGB. Single integer supported for backwards compatibility .UNINDENT .INDENT 7.0 .TP .B property fill Fill character used in formatting .UNINDENT .INDENT 7.0 .TP .B format(width=None, elapsed=None) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBwidth\fP (\fIint\fP) \-\- Width in columns to make progress bar .IP \(bu 2 \fBelapsed\fP (\fIfloat\fP) \-\- Time since started. Automatically determined if \fBNone\fP .UNINDENT .TP .B Returns Formatted progress bar or counter .TP .B Return type \fBstr\fP .UNINDENT .sp Format progress bar or counter .UNINDENT .INDENT 7.0 .TP .B refresh(flush=True, elapsed=None) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBflush\fP (\fIbool\fP) \-\- Flush stream after writing bar (Default:True) .IP \(bu 2 \fBelapsed\fP (\fIfloat\fP) \-\- Time since started. Automatically determined if \fBNone\fP .UNINDENT .UNINDENT .sp Redraw bar .UNINDENT .INDENT 7.0 .TP .B property subcount Sum of counts from all subcounters .UNINDENT .INDENT 7.0 .TP .B update(incr=1, force=False, **fields) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBincr\fP (\fIint\fP) \-\- Amount to increment \fBcount\fP (Default: 1) .IP \(bu 2 \fBforce\fP (\fIbool\fP) \-\- Force refresh even if \fBmin_delta\fP has not been reached .IP \(bu 2 \fBfields\fP (\fIdict\fP) \-\- Fields for for \fI\%formatting\fP .UNINDENT .UNINDENT .sp Increment progress bar and redraw .sp Progress bar is only redrawn if \fBmin_delta\fP seconds past since the last update .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class enlighten.StatusBar(*args, **kwargs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBenabled\fP (\fIbool\fP) \-\- Status (Default: \fBTrue\fP) .IP \(bu 2 \fBcolor\fP (\fIstr\fP) \-\- Color as a string or RGB tuple see \fI\%Status Color\fP .IP \(bu 2 \fBfields\fP (\fIdict\fP) \-\- Additional fields used for \fI\%formating\fP .IP \(bu 2 \fBfill\fP (\fIstr\fP) \-\- Fill character used in formatting and justifying text (Default: \(aq \(aq) .IP \(bu 2 \fBjustify\fP (\fIstr\fP) \-\- One of \fI\%Justify.CENTER\fP, \fI\%Justify.LEFT\fP, \fI\%Justify.RIGHT\fP .IP \(bu 2 \fBleave\fP (\fITrue\fP) \-\- Leave status bar after closing (Default: \fBTrue\fP) .IP \(bu 2 \fBmin_delta\fP (\fIfloat\fP) \-\- Minimum time, in seconds, between refreshes (Default: 0.1) .IP \(bu 2 \fBstatus_format\fP (\fIstr\fP) \-\- Status bar format, see \fI\%Format\fP .UNINDENT .UNINDENT .sp Status bar class .sp A \fI\%StatusBar\fP instance should be created with the \fI\%Manager.status_bar()\fP method. .sp \fBStatus Color\fP .sp Color works similarly to color on \fI\%Counter\fP, except it affects the entire status bar. See \fI\%Series Color\fP for more information. .sp \fBFormat\fP .sp There are two ways to populate the status bar, direct and formatted. Direct takes precedence over formatted. .sp \fBDirect Status\fP .sp Direct status is used when arguments are passed to \fI\%Manager.status_bar()\fP or \fI\%StatusBar.update()\fP\&. Any arguments are coerced to strings and joined with a space. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C status_bar.update(\(aqHello\(aq, \(aqWorld!\(aq) # Example output: Hello World! status_bar.update(\(aqHello World!\(aq) # Example output: Hello World! count = [1, 2, 3, 4] status_bar.update(*count) # Example output: 1 2 3 4 .ft P .fi .UNINDENT .UNINDENT .sp \fBFormatted Status\fP .INDENT 7.0 .INDENT 3.5 Formatted status uses the format specified in the \fBstatus_format\fP parameter to populate the status bar. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C \(aqCurrent Stage: {stage}\(aq # Example output \(aqCurrent Stage: Testing\(aq .ft P .fi .UNINDENT .UNINDENT .sp Available fields: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 elapsed(\fBstr\fP) \- Time elapsed since instance was created .IP \(bu 2 fill(\fBstr\fP) \- Filled with \fI\%fill\fP until line is width of terminal. May be used multiple times. Minimum width is 3. .UNINDENT .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The status bar is only updated when \fI\%StatusBar.update()\fP or \fI\%StatusBar.refresh()\fP is called, so fields like \fBelapsed\fP will need additional calls to appear dynamic. .UNINDENT .UNINDENT .sp User\-defined fields: .INDENT 0.0 .INDENT 3.5 Users can define fields in two ways, the \fBfields\fP parameter and by passing keyword arguments to \fI\%Manager.status_bar()\fP or \fI\%StatusBar.update()\fP .sp The \fBfields\fP parameter can be used to pass a dictionary of additional user\-defined fields. The dictionary values can be updated after initialization to allow for dynamic fields. Any fields that share names with available fields are ignored. .sp If fields are passed as keyword arguments to \fI\%Manager.status_bar()\fP or \fI\%StatusBar.update()\fP, they take precedent over the \fBfields\fP parameter. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp \fBInstance Attributes\fP .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .TP .B elapsed \fBfloat\fP \- Time since start .UNINDENT .INDENT 0.0 .TP .B enabled \fBbool\fP \- Current status .UNINDENT .INDENT 0.0 .TP .B manager \fI\%Manager\fP \- Manager Instance .UNINDENT .INDENT 0.0 .TP .B position \fBint\fP \- Current position .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B clear(flush=True) .INDENT 7.0 .TP .B Parameters \fBflush\fP (\fIbool\fP) \-\- Flush stream after clearing bar (Default:True) .UNINDENT .sp Clear bar .UNINDENT .INDENT 7.0 .TP .B close(clear=False) Do final refresh and remove from manager .sp If \fBleave\fP is True, the default, the effect is the same as \fI\%refresh()\fP\&. .UNINDENT .INDENT 7.0 .TP .B property color Color property .sp Preferred to be a string or iterable of three integers for RGB. Single integer supported for backwards compatibility .UNINDENT .INDENT 7.0 .TP .B property fill Fill character used in formatting .UNINDENT .INDENT 7.0 .TP .B format(width=None, elapsed=None) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBwidth\fP (\fIint\fP) \-\- Width in columns to make progress bar .IP \(bu 2 \fBelapsed\fP (\fIfloat\fP) \-\- Time since started. Automatically determined if \fBNone\fP .UNINDENT .TP .B Returns Formatted status bar .TP .B Return type \fBstr\fP .UNINDENT .sp Format status bar .UNINDENT .INDENT 7.0 .TP .B property justify Maps to justify method determined by \fBjustify\fP parameter .UNINDENT .INDENT 7.0 .TP .B refresh(flush=True, elapsed=None) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBflush\fP (\fIbool\fP) \-\- Flush stream after writing bar (Default:True) .IP \(bu 2 \fBelapsed\fP (\fIfloat\fP) \-\- Time since started. Automatically determined if \fBNone\fP .UNINDENT .UNINDENT .sp Redraw bar .UNINDENT .INDENT 7.0 .TP .B update(*objects, **fields) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBobjects\fP (\fIlist\fP) \-\- Values for \fI\%Direct Status\fP .IP \(bu 2 \fBforce\fP (\fIbool\fP) \-\- Force refresh even if \fBmin_delta\fP has not been reached .IP \(bu 2 \fBfields\fP (\fIdict\fP) \-\- Fields for for \fI\%Formatted Status\fP .UNINDENT .UNINDENT .sp Update status and redraw .sp Status bar is only redrawn if \fBmin_delta\fP seconds past since the last update .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class enlighten.SubCounter(parent, color=None, count=0, all_fields=False) A child counter for multicolored progress bars. .sp This class tracks a portion of multicolored progress bar and should be initialized through \fI\%Counter.add_subcounter()\fP .sp \fBInstance Attributes\fP .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .TP .B count \fBint\fP \- Current count .UNINDENT .INDENT 0.0 .TP .B parent \fI\%Counter\fP \- Parent counter .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update(incr=1, force=False) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBincr\fP (\fIint\fP) \-\- Amount to increment \fBcount\fP (Default: 1) .IP \(bu 2 \fBforce\fP (\fIbool\fP) \-\- Force refresh even if \fBmin_delta\fP has not been reached .UNINDENT .UNINDENT .sp Increment progress bar and redraw .sp Both this counter and the parent are incremented. .sp Progress bar is only redrawn if min_delta seconds past since the last update on the parent. .UNINDENT .INDENT 7.0 .TP .B update_from(source, incr=1, force=False) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsource\fP (\fI\%SubCounter\fP) \-\- \fI\%SubCounter\fP or \fI\%Counter\fP to increment from .IP \(bu 2 \fBincr\fP (\fIint\fP) \-\- Amount to increment \fBcount\fP (Default: 1) .IP \(bu 2 \fBforce\fP (\fIbool\fP) \-\- Force refresh even if \fBmin_delta\fP has not been reached .UNINDENT .UNINDENT .sp Move a value to this counter from another counter. .sp \fBsource\fP must be the parent \fI\%Counter\fP instance or a \fI\%SubCounter\fP with the same parent .UNINDENT .UNINDENT .SH FUNCTIONS .INDENT 0.0 .TP .B enlighten.get_manager(stream=None, counter_class=Counter, **kwargs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBstream\fP (file object) \-\- Output stream. If \fBNone\fP, defaults to \fBsys.stdout\fP .IP \(bu 2 \fBcounter_class\fP (class) \-\- Progress bar class (Default: \fI\%Counter\fP) .IP \(bu 2 \fBkwargs\fP (\fIDict\fP\fI[\fP\fIstr\fP\fI, \fP\fIAny\fP\fI]\fP) \-\- Any additional keyword arguments will passed to the manager class. .UNINDENT .TP .B Returns Manager instance .TP .B Return type \fI\%Manager\fP .UNINDENT .sp Convenience function to get a manager instance .sp If \fBstream\fP is not attached to a TTY, the \fI\%Manager\fP instance is disabled. .UNINDENT .SH CONSTANTS .INDENT 0.0 .TP .B class enlighten.Justify Enumerated type for justification options .INDENT 7.0 .TP .B CENTER Justify center .UNINDENT .INDENT 7.0 .TP .B LEFT Justify left .UNINDENT .INDENT 7.0 .TP .B RIGHT Justify right .UNINDENT .UNINDENT .sp Enlighten Progress Bar is a console progress bar module for Python. (Yes, another one.) The main advantage of Enlighten is it allows writing to stdout and stderr without any redirection. \fI\%\fP .sp The code for this animation can be found in \fI\%demo.py\fP in \fI\%examples\fP\&. .SH AUTHOR Avram Lubkin .SH COPYRIGHT 2020 - 2020, Avram Lubkin .\" Generated by docutils manpage writer. .