avid.common.console_abstraction.Progress

class avid.common.console_abstraction.Progress(console: Console | None = None, transient: bool = False, refresh_per_second: float = 10)

Bases: object

Progress abstraction that uses rich if available, provides simple fallback otherwise

__init__(console: Console | None = None, transient: bool = False, refresh_per_second: float = 10)

Methods

__init__([console, transient, ...])

add_task(description[, total, indicator_cadence])

Add a progress task :return: ID of the task that should be updated.

refresh()

Force a refresh of the progress display (like flush).

stop()

Stop the progress display and render a final state.

update(task_id[, advance, total, completed, ...])

Update progress for a task :param task_id: ID of the task that should be updated.

add_task(description: str, total: int | None = None, indicator_cadence: float | None = None) int

Add a progress task :return: ID of the task that should be updated. :param description: the task label. :param total: the value that indicates 100% of progress. If None the end of the task is not known. :param indicator_cadence: Used for action state indication in none terminal modes. It is the amount of advancement needed before a new state update will be printed in a new line. That is used to control the amount of output in file like outputs (like stdout).

refresh()

Force a refresh of the progress display (like flush).

stop()

Stop the progress display and render a final state.

update(task_id: int, advance: float | None = None, total: float | None = None, completed: float | None = None, indicator_cadence: float | None = None, **kwargs)

Update progress for a task :param task_id: ID of the task that should be updated. :param advance: Increment of the progress. If None is passed the progress will not be changed but other values will be updated. :param total: the value that indicates 100% of progress. If None the end of the task is not known. :param indicator_cadence: Used for action state indication in none terminal modes. It is the amount of advancement needed before a new state update will be printed in a new line. That is used to control the amount of output in file like outputs (like stdout).