r/Python • u/dekked_ • Dec 21 '20
Discussion We hand-picked the best Python libraries released in 2020
Hello,
Every year, we produce a list of the top 10 Python libraries released or popularized that year.
2020 was a hard one, since there are so many good choices! Therefore, we decided we should list many more :) Most are around data science / machine learning.
The full list is available here: https://tryolabs.com/blog/2020/12/21/top-10-python-libraries-of-2020/
So:
What do you think about our picks?
Did we miss any good one? Especially non-data science libraries.
28
u/IlliterateJedi Dec 21 '20
I usually roll my eyes at things like this ('who is tryolabs and why should I care what they think?') but this looks pretty good.
18
3
u/testuser73847 Dec 22 '20
Me too. Tends to be clickbaity bullshit but I’m glad I had a look. Will toy around with some of these, may even use a few in class.
45
u/willm Dec 21 '20
Great list. Blown away by the positive feedback for Rich. I was worried it was going to be an xkcd 927 when I started it a year ago.
5
u/dekked_ Dec 21 '20
Definitely one of our less controversial picks :) We are heavy users. Congratulations!
5
Dec 22 '20
Rich is amazing, thanks for making making it. I use it in one of my pypi packages. It makes making good CLIs with python that much easier.
3
38
u/bitcycle Dec 21 '20
Yeah. Eight of the ten libraries and a majority of the honorable mentions would fall into the category of data science. I would recommend reviewing libraries recently added to this vinta/awesome-python list on Github. As a systems/full-stack/security dev, the top 10 Python libraries is not fully representative of what's out there.
18
u/dekked_ Dec 21 '20
We never said it's fully representative :) We are heavily biased towards data science / machine learning, it's what we do every day.
The awesome list looks nice, but the vast majority of libraries weren't made or popularized this year. Cool, though!
0
61
u/WildWouks Dec 21 '20
This is awesome. I have a application which I am struggling to get right. It will be a CLI interface. Will definitely look at typer and rich.
17
u/ChemEngandTripHop Dec 21 '20
9
13
u/mechamotoman Dec 22 '20
Having used both, I'd say typer os miles ahead
I used to think if you've got a simple project you should use Fire, and if you've got a complex project you should use Click
Not to dunk on Fire or anything, it's a solid library. The problem with it is that it only really works well for super simple CLIs. Once you get into more complicated stuff, you find yourself having to contort your codebase into knots to get it to do what you want.
Clickon the other hand is really powerful, and doesn't really limit you a whole lot, but the learning curve is steep, and there's a fair amount of boilerplate you need to put in if you want a simple CLI that can scale up in complexity as neededThe problem is that these two libraries have massively different APIs and design patterns. Once you realize the Fire no longer fits the bill, you're looking at quite possibly massive refactoring to switch over to click
Typer hits that sweet spot in the middle. It's super easy to work with for simple CLIs, Scales up super well, is capable of doing almost everything Click can do (it's built on click) and it's so much easier to use the Click
And the best part is, you use the exact same design pattern for simple CLIs as you do for complex CLIs, so it's really simple and straightforward to scale up as your project grows in complexity
2
u/ChemEngandTripHop Dec 22 '20
Thanks that was really informative. I'm just reaching the stage where I'm having to wrangle Fire for my more complex use-cases, will give Typer a shot!
1
u/dslfdslj Dec 22 '20
Do you know what the advantage of click over argparse is? Can it do something the other cannot do?
2
u/mechamotoman Dec 23 '20
It's very subjective, but my personal view is that click strikes a better balance between ease of use and capability
Anything you can do in Click could be done with argparse, but it would take a lot more effort
0
u/GiantElectron Dec 22 '20
What's the point of typer if it does everything that click does? only for type hints? It's not much of an improvement.
1
u/mechamotoman Dec 23 '20
The API is much cleaner, it has core built-in support for things which either can't easily be done in click or can't be done at all without additional packages, It's (IMO) much easier to use, It allows you to avoid data duplication (you don't need to declare each input to your CLI functions twice like you do with Click) And best of all (IMO), you can actually use your CLI functions as functions after registering them as CLI commands! (For the uninitiated, on click when you register a function to be used as a Click command in your CLI, the Click command decorator transforms your function into a special Click object that can't be used as a function
Overall, I'd say typer took all the things that make Click amazing and fantastic, and refined them into a new API that is more approachable, more enjoyable to use, and more flexible
6
u/uncanneyvalley Dec 22 '20
I haven't used Typer, but the same dude made FastAPI and it's amazing
4
u/ChemEngandTripHop Dec 22 '20
Yeah Tiangolo is a beast, when I realised he wrote it that was almost enough to convince me to switch on its own
-8
u/GiantElectron Dec 22 '20
I find his overuse of emoji in commit messages highly unprofessional.
1
u/ChemEngandTripHop Dec 22 '20
He's not spattering them all over the place, they're related to the content and consistent. Personally I find they let me sift through the commits more quickly than plain text alone
4
u/ElevenPhonons Dec 22 '20
Here's a listing of a few other libs for creating CLI tools that are leveraging type annotations.
https://github.com/mpkocher/pydantic-cli#other-related-tools
7
9
u/reddittestpilot Dec 21 '20
Interesting selection of libraries, thanks!
And you have included my favourite Python GUI, so it must be a good list ;-)
2
u/iiMoe Dec 21 '20
Wut does it have that Tkinter and Pyqt5 doesn't? I wanna know from someone who used it so i consider switching
5
u/Retropunch Dec 21 '20
As it says in the article, the biggest difference is that its drawing the gui each frame (like a video game).
As others have pointed out, it's only really for small GUIs and last time I checked in they still had a really odd/non-scalable way of handling layouts. It's definitely good for small GUIs a d does have promise though.
5
u/cubic_unit Dec 22 '20
My two cents: DPG shines in its development speed. You can make GUIs that handle a LOT of dynamic data, without next-to-zero fuss. If your job involves building or maintaining lots of internal tools, this library is amazing. If you need to deploy your app to the public, I wouldn't recommend this toolkit (yet).
I'm excited to see DPG reach v1.0 because my experience with it has been overwhelmingly positive.
7
u/Username_RANDINT Dec 21 '20
I usually find these "simple" GUI libraries ok for very simple applications, but if you need some finer control of the widgets/UI, a more complex UI, custom widgets, etc, they become limiting really fast and nothing beats a proper framework like Qt or GTK. Also they look ugly.
3
u/reddittestpilot Dec 22 '20
Compared to Tkinter, it's more modern and fast. Dear PyGui is an extended wrapper around Dear ImGui which is written in C++ and uses the GPU. Dear ImGui is used for interfaces for game development, so speed is everything. An example of this would be its dynamic plotting. Dear PyGui provides bindings for Python and adds functionality, so that it is getting more functionality of a traditional GUI while maintaining its speed.
Compared to PyQt, one main difference is the license. Dear PyGui has an MIT license. Qt has a dual license and is crazy expensive if you use it commercially. I agree with most comments here. Dear PyGui is not nearly as polished or feature rich as Qt, but it is fast and bloat-free. On Windows, it's only 1Mb.
For me personally, it's just really easy to understand. No OOP or classes are required. They started development about half a year ago, using Dear Imgui as a starting point, and development is going at a rapid pace with weekly releases, adding functionality and fixes quickly. The developers and community on Discord are friendly and helpful, usually responding within hours (often minutes) after asking questions.
See this technical comparison of Python GUI frameworks for details.
3
u/LightShadow 3.13-dev in prod Dec 21 '20
FYI you can use omegaconf without hydra, which is what we do. It has really good parsers for config-like files and one of the best dot-dictionary implementations. omegaconf.DictConfig is synonymous with "config object" in our code.
2
u/hackthewhat Dec 21 '20
Thanks for the list! Must say PyCaret is very easy to understand, thanks to it's user friendly documentation. I took 1 day to learn what I can do with it in terms of classification and started using this at work, must also say it's really efficient.
2
u/evan54 Dec 21 '20
any thoughts on PySimpleGUI vs DearPyGui?
2
u/reddittestpilot Dec 22 '20
I haven't used PySimpleGUI, but it seems like it's a wrapper around Tkinter, Qt and WxPython to make it easier to work with those GUI frameworks. So, focus is on ease of use for developers.
Therefore, the differences between Dear PyGui and PySimpleGui are the same as the differences between Dear PyGui and Tkinter, Qt and WxPython itself as I outlined in another comment in this thread.
2
u/amitness Dec 22 '20
Thank you for sharing. I have a personal curation of libraries here: https://amitness.com/toolbox/ but it's targeted towards machine learning projects.
2
u/toyg Dec 22 '20
Diagrams is cool, I just wish it had more generic icons. Its origins show a bit too much, there is a world of diagrams beyond cloud networks... hopefully it will get more shapes with time.
0
u/Kevin_Jim Dec 21 '20
This is a great list but I struggle to see how Poetry is not even an honorable mention.
8
u/dekked_ Dec 21 '20
Because it doesn't satisfy the conditions listed at the beginning of the post: it's much older.
It was actually featured in our 2018 edition of the same post!
1
1
1
u/HornyAttorney Dec 22 '20
I'm looking at these and looking at my project with tkinter and matplotlib and I want to burn my laptop..
Great list, thanks a lot.
1
u/jpflathead Dec 22 '20
I'm liking typer, at the moment, at the very least, it's seems a shitload better documented than click and I vastly prefer the typing over the decorators
1
u/lambdaq django n' shit Dec 22 '20
might pick up few libraries in eBPF as well. It could be the next corner stone of Python eco system in the next decade.
1
1
u/ru5ter Dec 23 '20
Honestly, the machine learning technology has gone so far that sometimes make me worry...
1
0
u/Flame2212 Dec 21 '20
11
u/Username_RANDINT Dec 21 '20
I've seen this in a few comment sections already. This is one of the worst ideas they had.
2
2
0
Dec 21 '20
[deleted]
1
Dec 22 '20
I'm relatively new to programming. Is Rich effectively a syntax highlighter for running python with terminal?
0
u/iiMoe Dec 22 '20
No, it enables u to style ur terminal so ur CLI tools r much prettier with colors n lots of cool stuff
0



129
u/ErGo404 Dec 21 '20
I feel like you should have a separate category for machine learning oriented libraries, because they are very specific and most python devs don't need them.