tqdm progress bar for Mojo?
I cant get tqdm to work via Python interface , so i am wondering if any of you managed to use it in Mojo or if we have something similar already implemented in Mojo. Thx.
GitHub
GitHub - tqdm/tqdm: :zap: A Fast, Extensible Progress Bar for Pytho...
:zap: A Fast, Extensible Progress Bar for Python and CLI - tqdm/tqdm
12 Replies
i’m thinking this is possible with some c calls but i’ll get back to you
could be a good use case for the glibc project i was working on
Didnt you have something like that in Vodoo? Somewhere i saw something similar, cant recall right now where.
oh you are right lol
forgot about that
yes it should be in the code still somewhere that’s how i left it i just haven’t updated in a while so i dont think it’ll run perfect
here what i came up with for now based on @benny's Voodoo magic
Thx @benny
Just found out that instead of clearing the whole screen,
\r
might be a good alternative for this :
...
I actually made one recently. Just hadn't gotten around to putting it up in the community section yet.
https://github.com/Ryul0rd/awdy
GitHub
GitHub - Ryul0rd/awdy: Are We Done Yet (awdy) is a tqdm-like progre...
Are We Done Yet (awdy) is a tqdm-like progress bar written in pure Mojo. - Ryul0rd/awdy
Fantastic. looking forward to see how to use it. Hillarious name, brilliant.
Funny enough i improved on my code a little bit and put it on github
https://github.com/dorjeduck/progressbar.mojo
your implementation looks definitely more refined. I link from my repo to yours as this is the one people should use. For now I will leave my one on github ...
GitHub
GitHub - dorjeduck/progressbar.mojo: Basic Progress Bar for Mojo
Basic Progress Bar for Mojo. Contribute to dorjeduck/progressbar.mojo development by creating an account on GitHub.
If you need some ansi terminal funcs, I have a bunch here: https://github.com/thatstoasty/mist/blob/nightly/mist/screen.mojo
It seems like you're already handling cursor movement and screen clearing, but in case you need some text coloring/formatting as well this should be usable. Unless nightly broke it again 😅
great resource, thanks for sharing
yeah I saw this and it looks nice but I didn't want to build a library with dependencies while mojo is both unstable and lacking an official package manager
Agreed, it’s painful refactoring everything plus dependencies for some releases. Fingers crossed for some package management news soon
i wrapped up https://github.com/dorjeduck/progressbar.mojo today. It went partially other ways then expected, now including the possibility to "vectorize" the loop and runtime customization.
Hopefully Mojo includes an Iterable trait soon, so @Ryulord's awdy can become even more tqdm like. Wonder if
vectorize
also becomes like a wrapper for Iterable at one point.GitHub
GitHub - dorjeduck/progressbar.mojo: Basic Progress Bar for Mojo
Basic Progress Bar for Mojo. Contribute to dorjeduck/progressbar.mojo development by creating an account on GitHub.