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

Spinner Only? #40

Closed engineerjoe440 closed 3 years ago

engineerjoe440 commented 4 years ago

I might have overlooked something, but is it possible to only have a spinner without a progress bar? I dug around in the source a little bit, but I couldn't find exactly what I was looking for.

If this isn't an option, is it a possible addition?

Best I could figure out was minimizing the progress bar like the following. Works, but not the best.

from alive_progress import alive_bar

with alive_bar(1,length=3,spinner='classic') as progress_bar:
        # do something...
        progress_bar()
rsalmei commented 4 years ago

Hello @engineerjoe440,

I don't think I really understand, you would like to use a progress bar without a progress bar? 🤔 I might be able to help you, but what are you actually trying to achieve?

engineerjoe440 commented 4 years ago

Hi @rsalmei,

Yeah, I thought it could be useful for situations where a process was being "spun up" outside of the visibility of the Python script. In other words, imagine a case where a Python script is activating something in a subprocess or other means that cannot otherwise provide feedback to the main script about how far along in its process it is.

I thought that if there were a simple way to expose the spinners on their own, (independently of the progress bar) that could be quite useful. So I'm not really thinking a "progress bar" more so a function that exposes the spinners on their own.

Does that make any more sense?

Thanks!!!

rsalmei commented 4 years ago

Hey man, I think it does! 👍

That's really not possible at this moment, but actually I am implementing a new feature in the future v2 that might help you. I'm creating the concept of "quantifying". It is a new mode where the bar will enter unbounded (so two nice spinners will be running), to allow one to calculate the very total to be used in the bar. Then, when you have it, you can reset the bar including it, and it will reset the time and rendering to the bounded mode! The key is that it will provide feedback to the user with at least the elapsed time while you're quantifying the total, and reuse the same bar for the actual processing...

Would that work for you? It would be basically two spinners instead of one like you asked, with the addition of an elapsed time counter! If it does, it is already in the work, but it is trickier than I thought, gonna take some time.

You're welcome man!

engineerjoe440 commented 4 years ago

Hey @rsalmei,

I think that sounds awesome!!! Take your time, I'll be excited to see it when you're ready. I think I'll probably have to see it to confirm that it's exactly what I'm imagining, but if it is, it'll be awesome!

Thanks again! Stay safe and healthy!

rsalmei commented 4 years ago

Hey @engineerjoe440, how are you?

I think I have it! It is working nicely, have a look: quantifying mode

Would that work for what you need?

engineerjoe440 commented 4 years ago

@rsalmei Sorry for the delayed response.... Super busy lately. I think that's awesome!!! Basically, it will allow some kind of "quantifying" state where the time is indeterminate, and then the bar will be set up to finish the loading and indicate a percentage.

BEAUTIFUL!!!

I think that is great!!!!

rsalmei commented 4 years ago

Great, thank you! I'll let you know when it is released!

rsalmei commented 4 years ago

Hey @engineerjoe440, how are you man!

I'm polishing now the 2.0 in #51, should not take long, but I'll have to keep you hanging for a little more. This quantifying mode did not make it yet, it was getting way too big an update...

But it will in the next one, the 2.1!

Just wanted to let you know that! Stay safe and healthy in there too!

engineerjoe440 commented 4 years ago

Thanks again @rsalmei !!! This is an awesome project!

rsalmei commented 3 years ago

Hey @engineerjoe440, how are you man?

I'm sorry it is taking so long, super busy lately (learning Rust!). I'd like to tell you, even if your request would be nicely fulfilled by the future "Quantifying Mode" feature (in version 2.1), I now did implement support for disabling the bar, as well as the spinner or even both!! 😄 So I can deliver what you've originally asked right in the next 2.0!! 🎉

I'm going to close this one then, but feel free to contact me anytime!

engineerjoe440 commented 3 years ago

Oh man!!! That sounds terrific!!!! Thank you!!!

I'm really excited to see it! But I totally get running out of time! I've been super busy too, so no worries! But this is still such an awesome project! Way to go!!!

rsalmei commented 3 years ago

Hey man! I don't know if you had the chance to see it, but there's even more news in this regard! I've even cited your name there, did github notified you? https://github.com/rsalmei/alive-progress/issues/72 Anyway, look how cool it is! 👍

engineerjoe440 commented 3 years ago

Yeah!!!! I saw the GitHub notification... I just hadn't wandered over though to look ;)