rsalmei / alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
MIT License
5.53k stars 206 forks source link

Simple line progress bar #134

Closed shadowrylander closed 2 years ago

shadowrylander commented 2 years ago

Hello!

Is it possible to have a simple line progress bar, similar to the rich progress bar? I feel your package here is more fluid, but a little too much for me.

Thank you kindly for the help, and thanks for the package! 😸

rsalmei commented 2 years ago

Hello!

I only support disabling segments at the moment, like the monitor and stats and elapsed time... But it is a long-standing request, I can surely implement that!

I'm doing it actually, to allow us to customize any of those segments as you wish! Stay tuned... Very soon! 😉

shadowrylander commented 2 years ago

Eee! Thank you! 😹 Although, to clarify, I think I wanted a thin progression line, actually! 😅 The stats are quite handy!

rsalmei commented 2 years ago

Ok, what did you mean by "thin" then? My alive-progress shows lines by default like this:

|████████████████                        | ▅▃▁ 44/110 [40%] in 5s (9.4/s, eta: 7s)

The one you've mentioned seems to only show 40% (without 44/110), and only elapsed time, without any stats. So, I thought you've wanted to change the monitor to only a percent, and disable stats, this is already possible. So I was just missing the custom monitor, to use {percent:.0%} instead of my default '{count}/{total} [{percent:.0%}]'. What didn't I understand?

shadowrylander commented 2 years ago

Sorry about that; these example from rich are what I meant: https://raw.githubusercontent.com/Textualize/rich/master/imgs/progress.gif https://raw.githubusercontent.com/Textualize/rich/master/imgs/downloader.gif

Literally thin progress "lines", instead of the thicker progress "bars".

rsalmei commented 2 years ago

Ohhhh I see... 😂 I've understood "thin" as leaner, simpler info, so I thought you've wanted to slim down some of the plentiful info I have! Not as an actually narrower progress bar! 😂

But in that case, you can simply create a custom bar, which is super easy! Untitled

There's also the awesome check tool, where you get to see your creation!

image

Pass a number to choose a variety of options, including animations! Untitled

Does that work for you? 😄

rsalmei commented 2 years ago

Oh, forgot to say, if you want to remove even the borders, you can pass borders=' ' (two spaces). The bar_factory supports a plethora of options, get creative!!

Untitled

    Args:
        chars (Optional[str]): the sequence of increasing glyphs to fill the bar
            can be None for a transparent fill, unless tip is also None.
        tip (Optional[str): the tip in front of the bar
            can be None, unless chars is also None.
        background (Optional[str]): the pattern to be used underneath the bar
        borders (Optional[Union[str, Tuple[str, str]]): the pattern or patterns to be used
            before and after the bar
        errors (Optional[Union[str, Tuple[str, str]]): the pattern or patterns to be used
            when an underflow or overflow occurs
shadowrylander commented 2 years ago

Hah! That's what I was looking for! Thanks! 😻😹 Er, any way to color them...? 😅

TheTechRobo commented 2 years ago

you might yuse ansui escape codes

rsalmei commented 2 years ago

You're welcome! 👍 No, not at the moment. Since I do herculean work to try to fit animations within a terminal line, even when the user resizes the terminal or in the presence of grapheme clusters (emoji), any color codes would wreck the length assumptions (they are invisible chars). But someday I might support it, who knows 🙂

rsalmei commented 2 years ago

Read my comments here: https://github.com/rsalmei/alive-progress/issues/49

shadowrylander commented 2 years ago

@rsalmei Got it! Thanks for all the help! @TheTechRobo Issue 49 is the key! ... Or the lock! 😹