rich
                                
                                 rich copied to clipboard
                                
                                    rich copied to clipboard
                            
                            
                            
                        [REQUEST] Progress bars with undetermined 'total'
Hi. The documentation describes the usage of indeterminate progress bars that displays a waiting animation during the time the number of steps is computed.

However, sometimes you never know how many steps you except (when reading a stream for instance), but this is something rich does not accept: https://github.com/willmcgugan/rich/blob/1c1d72ccad965a41500253680c73e6606924cd13/rich/progress.py#L667-L673
I suggest in those cases to display a waiting animation instead.
Of course in this case the percentage and the ETA would not be very usable, but the bar could display the number of items processed (this is what tqdm does).
What do you think?
Would a status not be more appropriate for that?
Status can do the job if you know the thing you iterate on has always an undetermined size. Sometimes you may want to use a progress bar without knowing in advance if the total size could be determined.
Just to note a few things that you'd need to do manually with a status that could perhaps be done more cleanly with a progress bar: elapsed time so far, number of units complete so far and the rate of units. TQDM is a nice example of this, if you just leave out a total (really enjoying rich so far btw - really lovely library 😄 )
I'm unlikely to get to this any time soon. Opening it up for contributions.
I will help on this one. Since it is the same as #1528, I guess will take both.
I will look at their override and see if anything is salvageable. @willmcgugan Do you have any comment on their solution or preference on how to proceed (e.g. the use of float("inf") vs None as a value for total)?
elapsed time so far
Elapsed time would be very nice, particularly when the progress bar hits 100%, it should at least show that instead of time remaining, which is 00:00:00. I suspect some would like elapsed time during run for long jobs, but not as critical for my needs. Perhaps this should be a separate issue?
Have a look at TimeRemainingColumn. You can set elapsed_when_finished=True which displays the elapsed time when it reaches 100%.
The TimeElapsedColumn will display just the elapsed time.
Have a look at
TimeRemainingColumn. You can setelapsed_when_finished=Truewhich displays the elapsed time when it reaches 100%.The
TimeElapsedColumnwill display just the elapsed time.
Thanks! I've only touch on track() and not Progress. Guess I'm now in the advanced settings :-)