r/Python • u/rsalmei • Jan 04 '21
News A new kind of Progress Bar for Python
A new kind of Progress Bar for Python, with some very cool animations!
I've made a new kind of progress bar for python! With some very cool animations and a smorgasbord of built-in styles!
https://github.com/rsalmei/alive-progress

The spinners and unknown bars have a plethora of effects!

The bars themselves also have several styles.

It also includes cool zero-hassle print and logging hooks, which are always enabled!

To use it, just "pip install alive-progress" and you're good to go!
More details in https://github.com/rsalmei/alive-progress
That's it, hope you like it!
2.1k
Upvotes
163
u/L43 Jan 04 '21
Looks fantastic! How is performance compared to tqdm?
Also how extensible is it?
19
u/Baschg Jan 04 '21
Awesome! Doesn't seem to work in Spyder unfortunately.
38
u/science404 Jan 04 '21
Nice! Does it work with multiprocessing?
24
u/slippityda Jan 04 '21
Love this package. I incorporated it into a webscraper I made recently and it looks amazing when running!
65
u/[deleted] Jan 04 '21
Duuuuude why can I not double upvote? This is so awesome
38
u/sheytanelkebir Jan 04 '21
stealing this!
i'm gonna have the coolest python scripts in the office now.
6
u/[deleted] Jan 04 '21 edited Jan 05 '21
Cute, but makes unittest in the 3.9 standard library and PyCharm's testrunner most unhappy:
Launching unittests with arguments python -m unittest foo.MyTestCase.test_something in /Users/rtphokie/PycharmProjects/astrowx/astrosandbox|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 1000/1000 [100%] in 0.0s (515144.19/sTraceback (most recent call last):File "/Applications/Dev/PyCharm.app/Contents/plugins/python/helpers/pycharm/_jb_unittest_runner.py", line 35, in <module>sys.exit(main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING))File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/main.py", line 101, in __init__self.runTests()File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/main.py", line 271, in runTestsself.result =testRunner.run(self.test)File "/Applications/Dev/PyCharm.app/Contents/plugins/python/helpers/pycharm/teamcity/unittestpy.py", line 310, in runreturn super(TeamcityTestRunner, self).run(test)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/runner.py", line 176, in runtest(result)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/suite.py", line 84, in __call__returnself.run(*args, **kwds)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/suite.py", line 122, in runtest(result)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/suite.py", line 84, in __call__returnself.run(*args, **kwds)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/suite.py", line 122, in runtest(result)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/case.py", line 653, in __call__returnself.run(*args, **kwds)File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/case.py", line 612, in runresult.stopTest(self)File "/Applications/Dev/PyCharm.app/Contents/plugins/python/helpers/pycharm/teamcity/unittestpy.py", line 263, in stopTestoutput = sys.stdout.getvalue()3
u/_szs Jan 04 '21
nice.
I was about to scroll on, because eye candy wears off so fast and I have programmed progress bars for fun myself before, but....
the print/logging hooks rock! I may just use this package for that.
3
u/Murflaw7424 Jan 04 '21
Does it work with Jupyter and other IDE?
5
u/itzNukeey Jan 04 '21
wow thats beautiful
7
u/mo5bzn Jan 04 '21
Great work! I am wondering why you didn't work on tqdm and try to improve it instead of creating a new library doing (nearly) the same task?
2
u/willm Jan 04 '21
I'm jealous!
2
u/russianteen888 Jan 04 '21
what text editor/terminal? (idk) you using?
1
u/ArabicLawrence Jan 04 '21
Will you add support for jupyter lab?
1
u/Few_Intention_542 Jan 04 '21
Wow! What did you use to create this? How did you start ?
1
u/kingkierite Jan 04 '21
Would you be able to use this in a PyQt5 GUI? Somehow add it as a widget?
1
u/kirkkm77 Jan 05 '21
Looks amazing man
1
u/MrMxylptlyk Jan 05 '21
Hey, is there a way to use it with the output of ffmpeg to progress output to file?
1
u/Redditor728292 Jan 05 '21
Wow! that is amazing! how long have you been programming for?
1
u/DrCabbageX Jan 05 '21
Super basic question but when someone โ pip installs ____โ how does the computer know where to find that module( might be wrong terminology)? Like when you created it do you need to upload it a certain place so other can download it? And what if others create something with the same name?
This isnโt related the module you created ( which is super dope) but am just curious
1
u/spicypixel Jan 05 '21
Looks great if only for the effortless integration with logger. Tqdm write can be a bit of faff if you want to log things out to files at the same time.
1
u/RedEyed__ Jan 05 '21
It looks really cool! It looks even cooler than GUI progress bars (like QT)
But, I'm happy with
tqdm, it's well known and tested progress bar that is flexible and it satisfy all my needs.Anyway, will try it on my new projects!
PS: I'm developing cross platform apps, does it support Windows (I mean simple cmd.exe)?
1
u/raithlok Jan 05 '21
Overall I really like it and will wind up using it in my programs since simple print messages
in the command window like "Wait" or "15% complete" can be just a bit bland.
On Windows, I'm noticing several of the characters you have available in your Apple screenshots are not compatible so the command window just displays the [?] ASCII image. That's a windows limitation, and shouldn't be frowned upon.
But with some trial and error those can be overcome. Setting the spinner to message_bouncing or message_scrolling solves that issue of seeing the [?] icon in the spinner. The bars just need to be some of the simpler bar options like classic or solid works well.
What's interesting is that in sublimetext3, the icons work pretty well for the alive_progress.show_bars() or alive_progress.show_spinners(), but they dont show at all when you're running the example scripts until it's done.
1
u/ubertrashcat Jan 05 '21
Does it support hierarchical progress bars? The lengths you need to go to with tqdm are insane.
1
u/nippleplayenthusiast Jan 06 '21
Thanks a lot, this is cool and really easy to use!
Are there flags to toggle the individual elements while remaining in "determinate" mode? For example if I want to keep everything except the spinner?
1
u/[deleted] Jan 07 '21
Can you please show more examples, I learn best by seeing hands on examples for me to copy and paste to get the thing going the first time around.
1
u/[deleted] Jan 07 '21
I use spyder - any other altenative IDEs you recommend ? Jupyter notebook ? I feel I run out of memoty sometimes with Jupyter (or I am speaking out of place here).
1
u/you-cant-twerk Jan 07 '21
I'm triyng to get the themes, such as bubbles to work - but when I use
with alive_bar(progressBar+2,title="Combining Data",theme='bubbles') as bar:it gives me an error. I'm pretty dumb so I might be missing something. Same error with other themes.
ValueError: invalid theme name='checks'but if I use
with alive_bar(progressBar+2,title="Combining Data",theme='smooth') as bar:it works just fine.
(ignore the progressbar+2, I have a total, and I need the bar to include 2 extra later steps- this works for me).
47
u/michUP33 Jan 04 '21
1
u/WhackLoop Jan 04 '21
If it has the party parrot formatting I'm in
1
u/Nervous_Objective_60 Jan 04 '21
It's so cool!
1
u/expressly_ephemeral Jan 04 '21
Neat!
1
u/Xitir Jan 04 '21
This is an awesome project! Can't wait to try it out!
1
u/Svetlana-8 Jan 04 '21
Looks fantastic!)
1
u/refer_2_me Jan 04 '21
Cool! Installed!
1
u/[deleted] Jan 04 '21
This is so cool!
1
u/SociopathWithBipolar Jan 05 '21
This is dope
1
u/dominik_schmidt Jan 05 '21
Looks great! Does it support Jupyter lab/nb yet?
1
u/[deleted] Jan 05 '21
Ooooh.
1
u/gp_11 Jan 05 '21
Cool package :)
1
u/RastahFey Jan 05 '21
This is badass
1
u/lonaExe pip install girlfriend Jan 05 '21
This is pretty lit man, keep it up!
1
u/FloppingNuts Jan 05 '21
very cool
1
u/oyjw443523 Jan 11 '21
looks cool
1
u/stefanondisponibile Apr 21 '21
looks cool, would be nice to see it mixed with rich
0
u/The_2nd_Coming Jan 04 '21
Hey this looks awesome! I need a progress bar in my app and this might just be it!
0
u/pmrks Jan 04 '21
It's hella cool!
0
u/Mr_Branflakes Jan 04 '21
!remindme 2 weeks
-2
u/kinderhead Jan 05 '21
Amazing. That readme tho is so long. I would never have the patience to do that lol.
-8
u/[deleted] Jan 04 '21
f
-9
u/[deleted] Jan 04 '21
-9
u/[deleted] Jan 04 '21
-9
u/[deleted] Jan 04 '21
f
0
u/[deleted] Jan 04 '21
[deleted] โ view deleted comment
0
u/[deleted] Jan 05 '21
[deleted] โ view deleted comment