Skip to content

Reference

carrot edited this page Oct 20, 2024 · 2 revisions

Constructor

lowbar(tasks: range | int = 0,
       desc: str = '',
       load_fill: str = '#',
       blank_fill: str = '-',
       remove_ends: bool = False,
       keep_receipt: bool = False)

Parameters (all optional):

  • tasks - range | int
        Number of tasks to be tracked.

  • desc - str
        Description to be displayed alongside the bar.

  • load_fill - str
        Character used to represent progress. Must be a single character.

  • blank_fill - str
        Character used to represent remaining space in the bar. Must be a single character.

  • remove_ends - bool
        Remove the square brackets around the progress bar.

  • keep_receipt - bool
        Keep the final state of the progress bar in the console once completed.


update

update(percentage: int)

Updates the bar to the specified completion percentage.

Parameters:

  • percentage - int
        The current percentage of progress, ranging from 0 to 100.

add

add(percentage: int)

Increments the bar’s completion percentage by a specified amount.

Parameters:

  • percentage - int
        Percentage to add to the current progress. The final percentage is capped at 100.

next

next(tasks: int = 0)

Automatically adds to the completion percentage based on the number of tasks.

Parameters:

  • tasks - int, optional
        Total number of tasks. If omitted, it will use the number of tasks set in the constructor.

new

new()

Resets the progress bar to 0%.


log

log(text: str)

Logs a message to the console without interfering with the progress bar.

Parameters:

  • text - str
        The message to log.

clear

clear()

Clears the progress bar from the console output.

Clone this wiki locally