15 Python Libraries You Should Know About in 2023

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
a while back I posted a message here on YouTube asking you to share some of the coolest python libraries that you're using and that you think more people should know about so today I'm going to share 15 libraries that are really awesome I'm sure there's at least a few that you don't know about these libraries can make your life easier your code is to read and your projects more fun yes so let's dive in first library that I want to talk about is pendulum and this is a really cool utility to help you deal with dates and times actually dealing with dates and times can be really a pain with different time zones daylight savings leap years etc etc so what pendulum actually does is it provides you with an easy interface to deal with dates and times and also computations of dates and times like Computing differences between dates and things like that it's really easy to manipulate dates and times for example here you see that you can define a particular date in Europe Paris and then you can change the time zone very easily you can convert it to different daytime formats depending on your need you can shift by adding days and things like that what's cool about pendulum is that it offers human readable dates like what you see here for example or you can even do that for date and time differences like this and being a human myself I really appreciate this next Library I want to talk about is pi PDF and this is a free open source python PDF Library Pi PDF can read PDF can split them merge them it can even add custom data or watermarks and you can even add passwords to your PDF files which is really neat I like this Library a lot because it allows me to automate work where I have to deal with PDFs think of contracts or invoices and Pi PDF can handle those with ease next library is ice cream now I don't know why this is called ice cream I haven't figured that out yet if you have an idea why it's called like that post it in thoughts ice cream is a library to make debugging easier and what's really nice about this well apart from the beautiful image right here obviously is that instead of using print it's going to be bug or log you can actually use ice cream and you write simply IC so it's also a bit shorter and what's nice about this is that the output is syntax highlighted and that is actually really cool and the second thing that it does is that it actually inspects itself so normally if you would use prints and you would print the results of a function like so then you would just get the results right but what ice cream does that it actually inspects the argument so if you have this example it's not just going to print the result of that particular function call but it's actually also going to print the function and the arguments that will pass to the function so this is incredibly useful for debugging and it also does that for data types in this case we have a dictionary and if we print the dictionary then you can also see what is actually being printed or if you have a class with an attribute then it also prints the name of the class and the name of the attributes so I'll be using ice cream for debugging save a bunch of time printing very bonus really easy next library is low Guru I hope I'm pronouncing that correctly this is a library for logging but simplified one thing in particular that simplifies that you don't have to create a logger object you can simply import the logger from local and then use that so that makes it almost as easy to use as just a simple print statement what's nice about the guru is that it has some built-in things that are really neat such as being able to automatically add colors to be a log if your terminal supports that you can simply Define your favorite Style by using markup tags and then that actually works there's other things as well such as being able to deal with date times better than the standard logging package and also has built-in functionality to more easily view the entire stacked Trace by the way if you're enjoying these libraries so far you might also be interested in joining my free Weekly Newsletter in newsletter I share the latest news from the python world as well as some other content that I don't share on the YouTube Channel just go to rmcodes.com to subscribe for free if you don't like it you can unsubscribe at any time next library that I want to talk about is Rich and this is a python library to write Rich text with color and style to the terminal what I really like about rich is that it can actually render markdown so you can write your markdown text and then it can write that to the console and then it's going to be styled nicely and this even renders code blocks in markdown with full syntax highlighting so it's really cool it can do way more things like for example displaying tables it can show in progress display and you can even do some basic styling like adding padding the next Library I want to talk about is Arc bars and this is actually the only standard library that I'm including in this list Arc bars I've been using myself quite a lot to build simple command line interface and it's really powerful for that it has really a lot of capabilities basically with just a few lines of code you can create a command line interface with a name description a help page it's very easy to add arguments either positional or an option that expects value then you can simply parse them and use them in your python script next library is tqdm which apparently means progress in Arabic I didn't know that and it's even an abbreviation for I love you so much in Spanish what tqdm does is that it gives you a progress bar which is very helpful and you can link this progress bar with anything that's happening in your code for example processing a panelist data frame or collecting data from the Internet or anything that you need to do that requires monitoring the progress it's super lightweight and it easily integrates with a wide variety of projects I'm just wondering how many of you are actually building command line interfaces regularly and what do you typically use them for let me know in the comments next Library I want to talk about is X-ray and this is sort of a panda spot for multi-dimensional arrays and this is designed to make working with multi-dimensional labeled data easily and fun if you somehow think that dealing with multi-dimensional data is fun which I'm not really sure that it is so what can use this for well it's great for scientific Computing data analysis these kinds of things it also interoperates very well with the Scientific Python ecosystem like numpy and Palmas and matplotlib x-ray has a lot of feature like for example the possibility to interpolate data you can group and Bin data and you also have very good support for multi-dimensional time series data so if you're dealing with complex multi-dimensional data x-ray is really good choice for you next up is polars and this is a data frame Library that's really optimized for Speed it's written in Rust but you can also use it in Python and it's going to use that same Performance Engine underlying both of these implementations polars isn't particularly helpful if you deal with really large data sets because it can handle those much better than something like pandas it's blazingly fast it can also be used with multi-threading so this is a great joy choice for heavy computational tasks next is Seaborn which is a library for statistical data visualization so this is built on top of mass plot lip and the nice thing about this is that it can create these beautiful looking charts and graphs very easily without having to provide tons and tons of options so it comes out of the box with a nice style if you want to plot something you just provide the data and a couple of settings depending on what you want but it's pretty limited and you're going to get beautiful charts automatically what's nice about Seabourn is that it has themes and color palettes for example if you have a function like this and then plot that with matplot lib then you're going to get something that looks like this with Seaborn you simply set a theme and then it's going to already look a lot better but then you can actually choose different themes for example here's a dark style there's a white Style there is a ticks style so it has a lot of different options you can even choose different color palettes so that the charts and graphs also easily fit within the style of your application the next library that I want to mention is result and this is a kind of an outlier because it's a pretty basic idea but the idea of the result is that it allows you to do so-called railroad oriented programming and I talked about that in a video a long time ago which if you want to watch that I'll put a link at the top but the idea is that this is an alternative to handling errors using exceptions so normally or what most people would do is that if you have a problem in your program like you can't find file or something or network connection closers or whatever or your input values are wrongly formatted you raise an error right and you use Python's exception framework for that not everybody likes that because that creates sort of a control flow that's outside of your main program an alternative way of doing that and this is an idea that comes from the functional programming domain is that instead of returning just a result value and optionally raising an error that you actually have a result value that can either be okay and in that case you get the value or it can be an error and in that case you get an error so that leads to like two parallel paths in your function calling and that's why it's also called railroad oriented programming and then basically as long as everything's fine you just on the OK path but as soon as there's a problem well then you go to the error path and the result Library provides some tooling and types to help you do that more easily so there's a result type that gets basically the value that you expect from this particular function and an error value in this case uses a string and then in the code itself you simply handle those cases so for example if there is no user then we're going to return an error if the user is not active we're also going to return the error and otherwise we're going to return the actual user and then you can use an if statement check which of these things you have to deal with and if using a recent version of python then you can even use match case statements to deal with the different types of returns that you could get from this function I do think that it would be even better if this was integrated more into the language itself but if you don't like exceptions then this might be a nice option for you next one this Library you probably know is called pedantic and pedantic is a really cool data validation library for python you can use this to validate data on the Fly and basically catch errors before they become bugs in your program what's cool about this is that pedantic is used by quite a few different libraries in the python ecosystem and it also works well with type annotations now one library in particular that it works really well with is fast API and that's actually the next library on our list which you probably also know now first API is modern web framework for building back-end apis with python it's really easy to get started with it I'll much prefer fast API over flask because I think it has just better tooling and overall it has more support for modern python features so for example it supports concurrency and async await out of the box and also use type annotations to Define return types for the API and uses that also for validation of input arguments and what's really cool about fast API is that it automatically serves a documentation so I'd use an either the Swagger UI or redoc now if you're building a full application a tool like Fast API is just one of the tools you probably need if you want to learn more about how to design a complete application from scratch I have a free guide for you you can get this at ion.com design guide this contains the seven steps that I take whenever I design a new piece of software and hopefully it helps you avoid some of the problems that I made in the past so our node codes design guide to get your copy for free just enter your email address and you'll get it in your I've also put the link in description of the video next library that I want to mention that integrates really well with fast API is SQL model and this is built on both pedantic and SQL Alchemy SQL model is an Oram on object relational mapping library and that allows you to use objects classes and methods to manipulate objects in the database so this allows you to connect your fast API applications to databases like SQL Lite MySQL and more and what's really cool about this is that this is built on similar ideas as fast API so it's uses modern python type annotations in particular so you don't need to learn any new syntax and the way that this is set up is really intuitive you can simply define a class that inherits from SQL model so this defines the table and you provide the fields that should be in the table and one thing that's also nice about SQL model is that it has an easy way to define relationships you see an example of a team table and a hero table a hero is part of a team so it has a team ID and we can indicate right in a model that this ID is a foreign key and refers to the ID of 18. not the stones of other features in SQL model as well if you want me to do a full video about this let me know in the comments final Library I want to talk about is HTTP X if you've used requests you know that there are some limitations especially when dealing with asynchronous requests the request package doesn't really support it all that well now httpx is a Next Generation HTTP client and this supports a ton of extra features for example it has async support it's also fully type annotated you can do lots of things including Boolean connections streaming it has lots of features before I finish the video I just want to give you a bonus library and that is python. I use python.nf all the time in my application to read key value pairs from a.n file then you can simply access them using environment variables in my code what I like a lot about that is that it gives me a lot of flexibility and then I have lots of ways in which provide environment variables when running my code so for example if I run it in the cloud I might decide to define those environment variables somewhere else and my code will still work and locally I can work with a DOT end file with the right key value pairs or I could even run the application in different contacts simply by switching the dot end file or the values in the Dot N file and finally this also promotes that you shouldn't put those things directly in your code but put them in a different place for security purposes so I hope you enjoyed this list if you have any other suggestions for libraries that are interesting to people just post them in the comments below so for some of the libraries I mentioned I have a more in-depth video on my channel for example fast API if you're not using that yet definitely should you can watch this video next to get all the details about how to use it thanks for watching and take care
Info
Channel: ArjanCodes
Views: 265,902
Rating: undefined out of 5
Keywords: python libraries 2023, best python libraries 2023, best python libraries, best python libraries to learn, top python libraries, python library, python, python libraries, python programming, python libraries explained, python libraries to learn, popular python libraries, python libraries tutorial, python libraries for data analysis, top python libraries 2023, python libraries and their uses, top python libraries to learn, top 10 python libraries, programming libraries python
Id: o06MyVhYte4
Channel Id: undefined
Length: 14min 54sec (894 seconds)
Published: Fri Sep 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.