Renders a visual progress bar.
bar_width (Optional[int], optional) – Width of bar or None for full width. Defaults to 40.
style (StyleType, optional) – Style for the bar background. Defaults to “bar.back”.
complete_style (StyleType, optional) – Style for the completed bar. Defaults to “bar.complete”.
finished_style (StyleType, optional) – Style for a finished bar. Defaults to “bar.finished”.
pulse_style (StyleType, optional) – Style for pulsing bars. Defaults to “bar.pulse”.
table_column (Column | None)
Gets a progress bar widget for a task.
task (Task)
Renders file size downloaded and total, e.g. ‘0.5/2.3 GB’.
Renders completed filesize.
table_column (Column | None)
Renders completed count/total, e.g. ‘ 10/1000’.
Best for bounded tasks with int quantities.
Space pads the completed count so that progress length does not change as task progresses past powers of 10.
Renders an auto-updating progress bar(s).
console (Console, optional) – Optional Console instance. Defaults to an internal Console instance writing to stdout.
auto_refresh (bool, optional) – Enable auto refresh. If disabled, you will need to call refresh().
refresh_per_second (Optional[float], optional) – Number of times per second to refresh the progress information or None to use default (10). Defaults to None.
speed_estimate_period (float) – (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30.
transient (bool) – (bool, optional): Clear the progress on exit. Defaults to False.
redirect_stdout (bool) – (bool, optional): Enable redirection of stdout, so print
may be used. Defaults to True.
redirect_stderr (bool) – (bool, optional): Enable redirection of stderr. Defaults to True.
get_time (Callable[[], float] | None) – (Callable, optional): A callable that gets the current time, or None to use Console.get_time. Defaults to None.
disable (bool, optional) – Disable progress display. Defaults to False
expand (bool, optional) – Expand tasks table to fit width. Defaults to False.
columns (str | ProgressColumn)
Add a new ‘task’ to the Progress display.
description (str) – A description of the task.
start (bool, optional) – Start the task immediately (to calculate elapsed time). If set to False, you will need to call start manually. Defaults to True.
total (float, optional) – Number of total steps in the progress if known. Set to None to render a pulsing animation. Defaults to 100.
completed (int, optional) – Number of steps completed so far. Defaults to 0.
visible (bool, optional) – Enable display of the task. Defaults to True.
**fields (str) – Additional data fields required for rendering.
An ID you can use when calling update.
TaskID
Advance task by a number of steps.
task_id (TaskID) – ID of task.
advance (float) – Number of steps to advance. Default is 1.
None
Check if all tasks have been completed.
a text column for the description (TextColumn)
the bar itself (BarColumn)
a text column showing completion percentage (TextColumn)
an estimated-time-remaining column (TimeRemainingColumn)
If the Progress instance is created without passing a columns argument, the default columns defined here will be used.
You can also create a Progress instance using custom columns before and/or after the defaults, as in this example:
- progress = Progress(
SpinnerColumn(), *Progress.get_default_columns(), “Elapsed:”, TimeElapsedColumn(),
)
This code shows the creation of a Progress display, containing a spinner to the left, the default columns, and a labeled elapsed time column.
Tuple[ProgressColumn, …]
Get a renderable for the progress display.
Get a number of renderables for the progress display.
Get a table to render the Progress display.
Track progress while reading from a binary file.
path (Union[str, PathLike[str]]) – The path to the file to read.
mode (str) – The mode to use to open the file. Only supports “r”, “rb” or “rt”.
buffering (int) – The buffering strategy to use, see io.open()
.
encoding (str, optional) – The encoding to use when reading in text mode, see io.open()
.
errors (str, optional) – The error handling strategy for decoding errors, see io.open()
.
newline (str, optional) – The strategy for handling newlines in text mode, see io.open()
.
total (int, optional) – Total number of bytes to read. If none given, os.stat(path).st_size is used.
task_id (TaskID) – Task to track. Default is new task.
description (str, optional) – Description of task, if new task is created.
A readable file-like object in binary mode.
BinaryIO
ValueError – When an invalid mode is given.
Refresh (render) the progress information.
None
Delete a task if it exists.
task_id (TaskID) – A task ID.
None
Reset a task so completed is 0 and the clock is reset.
task_id (TaskID) – ID of task.
start (bool, optional) – Start the task after reset. Defaults to True.
total (float, optional) – New total steps in task, or None to use current total. Defaults to None.
completed (int, optional) – Number of steps completed. Defaults to 0.
visible (bool, optional) – Enable display of the task. Defaults to True.
description (str, optional) – Change task description if not None. Defaults to None.
**fields (str) – Additional data fields required for rendering.
None
Start the progress display.
None
Start a task.
Starts a task (used when calculating elapsed time). You may need to call this manually, if you called add_task
with start=False
.
task_id (TaskID) – ID of task.
None
Stop the progress display.
None
Stop a task.
This will freeze the elapsed time on the task.
task_id (TaskID) – ID of task.
None
A list of task IDs.
Get a list of Task instances.
Track progress by iterating over a sequence.
sequence (Sequence[ProgressType]) – A sequence of values you want to iterate over and track progress.
total (float | None) – (float, optional): Total number of steps. Default is len(sequence).
completed (int, optional) – Number of steps completed so far. Defaults to 0.
task_id (TaskID | None) – (TaskID): Task to track. Default is new task.
description (str) – (str, optional): Description of task, if new task is created.
update_period (float, optional) – Minimum time (in seconds) between calls to update(). Defaults to 0.1.
An iterable of values taken from the provided sequence.
Iterable[ProgressType]
Update information associated with a task.
task_id (TaskID) – Task id (returned by add_task).
total (float, optional) – Updates task.total if not None.
completed (float, optional) – Updates task.completed if not None.
advance (float, optional) – Add a value to task.completed if not None.
description (str, optional) – Change task description if not None.
visible (bool, optional) – Set visible flag if not None.
refresh (bool) – Force a refresh of progress information. Default is False.
**fields (Any) – Additional data fields required for rendering.
None
Track progress file reading from a binary file.
file (BinaryIO) – A file-like object opened in binary mode.
total (int, optional) – Total number of bytes to read. This must be provided unless a task with a total is also given.
task_id (TaskID) – Task to track. Default is new task.
description (str, optional) – Description of task, if new task is created.
A readable file-like object in binary mode.
BinaryIO
ValueError – When no total value can be extracted from the arguments or the task.
Base class for a widget to use in progress display.
table_column (Column | None)
Get a table column, used to build tasks table.
Should return a renderable object.
task (Task)
Sample of progress for a given time.
Number of steps completed.
Timestamp of sample.
A column to insert an arbitrary column.
renderable (RenderableType, optional) – Any renderable. Defaults to empty string.
table_column (Column | None)
Should return a renderable object.
task (Task)
A column with a ‘spinner’ animation.
spinner_name (str, optional) – Name of spinner animation. Defaults to “dots”.
style (StyleType, optional) – Style of spinner. Defaults to “progress.spinner”.
speed (float, optional) – Speed factor of spinner. Defaults to 1.0.
finished_text (TextType, optional) – Text used when task is finished. Defaults to “ “.
table_column (Column | None)
Should return a renderable object.
task (Task)
Set a new spinner.
Information regarding a progress task.
This object should be considered read-only outside of the Progress
class.
Number of steps completed
Description of the task.
Time elapsed since task was started, or None
if the task hasn’t started.
Optional[float]
Arbitrary fields passed in via Progress.update.
Check if the task has finished.
The last speed for a finished task.
Optional[float]
Time task was finished.
float: Get the current time, in seconds.
Task ID associated with this task (used in Progress methods).
Get progress of task as a percentage. If a None total was set, returns 0
Get the number of steps remaining, if a non-None total was set.
Optional[float]
Get the estimated speed in steps per second.
Optional[float]
Time this task was started, or None if not started.
Optional[float]
Check if the task as started.
Time this task was stopped, or None if not stopped.
Optional[float]
Get estimated time to completion, or None
if no data.
Optional[float]
Total number of steps in this task.
Optional[float]
Indicates if this task is visible in the progress display.
Show task progress as a percentage.
text_format (str, optional) – Format for percentage display. Defaults to “[progress.percentage]{task.percentage:>3.0f}%”.
text_format_no_percentage (str, optional) – Format if percentage is unknown. Defaults to “”.
style (StyleType, optional) – Style of output. Defaults to “none”.
justify (JustifyMethod, optional) – Text justification. Defaults to “left”.
markup (bool, optional) – Enable markup. Defaults to True.
highlighter (Optional[Highlighter], optional) – Highlighter to apply to output. Defaults to None.
table_column (Optional[Column], optional) – Table Column to use. Defaults to None.
show_speed (bool, optional) – Show speed if total is unknown. Defaults to False.
A column containing text.
Renders time elapsed.
table_column (Column | None)
Renders estimated time remaining.
Renders total filesize.
table_column (Column | None)
Renders human readable transfer speed.
table_column (Column | None)
Read bytes from a file while tracking progress.
path (Union[str, PathLike[str], BinaryIO]) – The path to the file to read, or a file-like object in binary mode.
mode (str) – The mode to use to open the file. Only supports “r”, “rb” or “rt”.
buffering (int) – The buffering strategy to use, see io.open()
.
encoding (str, optional) – The encoding to use when reading in text mode, see io.open()
.
errors (str, optional) – The error handling strategy for decoding errors, see io.open()
.
newline (str, optional) – The strategy for handling newlines in text mode, see io.open()
total – (int, optional): Total number of bytes to read. Must be provided if reading from a file handle. Default for a path is os.stat(file).st_size.
description (str, optional) – Description of task show next to progress bar. Defaults to “Reading”.
auto_refresh (bool, optional) – Automatic refresh, disable to force a refresh after each iteration. Default is True.
transient – (bool, optional): Clear the progress on exit. Defaults to False.
console (Console, optional) – Console to write to. Default creates internal Console instance.
refresh_per_second (float) – Number of times per second to refresh the progress information. Defaults to 10.
style (StyleType, optional) – Style for the bar background. Defaults to “bar.back”.
complete_style (StyleType, optional) – Style for the completed bar. Defaults to “bar.complete”.
finished_style (StyleType, optional) – Style for a finished bar. Defaults to “bar.finished”.
pulse_style (StyleType, optional) – Style for pulsing bars. Defaults to “bar.pulse”.
disable (bool, optional) – Disable display of progress.
encoding – The encoding to use when reading in text mode.
A context manager yielding a progress reader.
ContextManager[BinaryIO]
Track progress by iterating over a sequence.
sequence (Iterable[ProgressType]) – A sequence (must support “len”) you wish to iterate over.
description (str, optional) – Description of task show next to progress bar. Defaults to “Working”.
total (float | None) – (float, optional): Total number of steps. Default is len(sequence).
completed (int, optional) – Number of steps completed so far. Defaults to 0.
auto_refresh (bool, optional) – Automatic refresh, disable to force a refresh after each iteration. Default is True.
transient (bool) – (bool, optional): Clear the progress on exit. Defaults to False.
console (Console, optional) – Console to write to. Default creates internal Console instance.
refresh_per_second (float) – Number of times per second to refresh the progress information. Defaults to 10.
style (StyleType, optional) – Style for the bar background. Defaults to “bar.back”.
complete_style (StyleType, optional) – Style for the completed bar. Defaults to “bar.complete”.
finished_style (StyleType, optional) – Style for a finished bar. Defaults to “bar.finished”.
pulse_style (StyleType, optional) – Style for pulsing bars. Defaults to “bar.pulse”.
update_period (float, optional) – Minimum time (in seconds) between calls to update(). Defaults to 0.1.
disable (bool, optional) – Disable display of progress.
show_speed (bool, optional) – Show speed if total isn’t known. Defaults to True.
An iterable of the values in the sequence.
Iterable[ProgressType]
Read bytes from a file while tracking progress.
file (Union[str, PathLike[str], BinaryIO]) – The path to the file to read, or a file-like object in binary mode.
total (int) – Total number of bytes to read.
description (str, optional) – Description of task show next to progress bar. Defaults to “Reading”.
auto_refresh (bool, optional) – Automatic refresh, disable to force a refresh after each iteration. Default is True.
transient (bool) – (bool, optional): Clear the progress on exit. Defaults to False.
console (Console, optional) – Console to write to. Default creates internal Console instance.
refresh_per_second (float) – Number of times per second to refresh the progress information. Defaults to 10.
style (StyleType, optional) – Style for the bar background. Defaults to “bar.back”.
complete_style (StyleType, optional) – Style for the completed bar. Defaults to “bar.complete”.
finished_style (StyleType, optional) – Style for a finished bar. Defaults to “bar.finished”.
pulse_style (StyleType, optional) – Style for pulsing bars. Defaults to “bar.pulse”.
disable (bool, optional) – Disable display of progress.
A context manager yielding a progress reader.
ContextManager[BinaryIO]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4