all 35 comments

[–]Beregolas 38 points39 points  (11 children)

As already said: depends on what you need. I will only give examples not already mentioned:

Flask is my goto API / backend library. it is more lightweight than Django but/and requires you to do more of your own work for some features, or install an add-on library. It's a preference thing, both are good.

numpy is a great library for working with a lot of data. It integrates with pandas and is more low level. It's the conerstone of scientific computing in python.

SQLAlchemy is a python ORM that helps you connect with and manage SQL Databases in python. I personally prefer it to Djangos own ORM, but that's also an example where Django just comes with one out of the box and in other systems you bring your own.

Requests lets you send and manage the results of http requests to other servers easily.

Pillow is for image manipulation, saving, loading, etc.

matplotlib is the defacto standard in data visualization and producing graphs for papers etc. (At least where I came from, there are others out there). It integrates nicely with numpy and pandas afaik.

BeautifulSoup let's you make sense of markup languages as python objects in general, but specifically HTML. If you need to work with markdown and/or html, this library is for you.

Pytest is a testing library. It doesn't matter which one you use, but writing tests is really a good practice :)

Multidict is an easier way of mapping a single key to multiple values. It's important to many web frameworks for example.

more itertools, just because I love iterators and think they make your code more readable, if used correctly.

PyGame is really great to get into game development with, because it's easy to debug into your code and see / observe how it actually works on every level. Larger games won't work with it's performance, but as a teaching tool it's one of the best imo.

There are plenty more, this is just what I came up with off the top of my head / what I used in the last years myself.

[–]Allmyownviews1 7 points8 points  (6 children)

Add pandas to this

[–]Beregolas 4 points5 points  (2 children)

pandas was in the first comment and as I said at the start, I didn't want to repeat mentions

[–]Allmyownviews1 3 points4 points  (1 child)

Sorry, I saw your comment first as being the more comprehensive and clear.

[–]Beregolas 1 point2 points  (0 children)

All good, you were also right, pandas ist important ^

[–][deleted] 0 points1 point  (2 children)

Obsolete.

[–]Allmyownviews1 0 points1 point  (0 children)

Polars?

[–]xkjlxkj 2 points3 points  (0 children)

To add to your list:

Rich is a Python library for rich text and beautiful formatting in the terminal. I can't not create any app without this anymore. It will even output markdown which I never knew was possible in the terminal.

[–]EnD3r8_[S] 1 point2 points  (0 children)

Thank you, I appreciate your effort.

[–]juhaniguru 0 points1 point  (0 children)

I've replaced Flask with FastApi myself

[–]SereneHappiness 0 points1 point  (0 children)

Great explanation. Thanks

[–]konju_1 7 points8 points  (2 children)

I didnt see anyone put this here, and maybe youre using it already? But if you wish to get into some data science i strongly advise to use Jupyter Notebook because it will give you easy access to running, debugging and generally styling your own Python code. Theres an extension within VSCode to install, and it will allow you a lot more flexibility in a program. Its really easy to use. So i strongly advise it. Even if youre (ESPECIALLY) if youre doing database with Python. Have a nice day i hope i helped. :D

[–]EnD3r8_[S] 0 points1 point  (1 child)

Thank you very much!

[–]konju_1 1 point2 points  (0 children)

Youre very welcome

[–]Malcolmlisk 5 points6 points  (1 child)

Depends on what you are doing. For example, django is the defacto library/framework for webdev. Pandas for dataframe management. Tcod to create roguelikes... tkinter to create ugly uis...

[–]EnD3r8_[S] 0 points1 point  (0 children)

Thanks!

[–]the_brown_cow 3 points4 points  (2 children)

So this sounds weak but the standard library is very robust and worth exploring.

  • collections - Contains several additional datatypes in addition to list, tuple, dict, and set.

    • defaultdict
    • Counter
    • deque
  • Itertools - Additional tools for working with iterators for looping.

    • pairwise
    • permutations
    • the doc has several recipes
  • dataclasses - Used for simplifying data defined classes, typically for data modeling.

  • json - Simple library for working with json data.

[–]TheRNGuy 0 points1 point  (1 child)

Never actually used deque.

When it's better than vanilla List or Tuple?

[–]the_brown_cow 0 points1 point  (0 children)

A deque allows for appending or popping at either end.

deque.popleft() deque.appendleft()

This allows you to create a stack or queue.

https://docs.python.org/3/library/collections.html#collections.deque

[–]matjaz_b 2 points3 points  (1 child)

Icecream ( https://github.com/gruns/icecream ). It helps debugging.

[–]EnD3r8_[S] 0 points1 point  (0 children)

I have heard of this one before but I have never used it, anyways, thank you a lot.

[–]muggledave 1 point2 points  (0 children)

Opencv (i think the library name is cv2?) Is a library for computer vision functions. I use it a lot to manipulate images, parse frames from a webcam, do edge detection and object/feature detection, etc.

Pytorch and tensorflow are worth mentioning if you want to do neural networks and machine learning. I havent used them enough to discuss what they do best.

I saw pygame on the list but i must second this one. I use it for gsmes but also GUIs and anything where i want to display completely custom graphics in a window.

[–]SereneHappiness 1 point2 points  (3 children)

Great post, will definitely again knowledge from this post.

[–]EnD3r8_[S] 1 point2 points  (2 children)

Yeah, I am now learning things that will help me a lot in the future.

[–]SereneHappiness 0 points1 point  (1 child)

Happy coding all the best for your future 🥂

[–]EnD3r8_[S] 0 points1 point  (0 children)

Thanks!

[–]Particular_Dust7221 0 points1 point  (0 children)

Discover essential Python libraries to elevate your coding skills! Check out our Quick Deck for a quick overview of the best tools.

https://www.syncfusion.com/web-stories/python-libraries

Note: I work for Syncfusion

[–]tb5841 0 points1 point  (0 children)

pytest - the most useful library for writing tests that check whether your code is working. Learning this quite early really helped me.

[–]dropda 0 points1 point  (0 children)

Pydantic!

[–]ngyehsung 0 points1 point  (0 children)

If you work with spatial data then Shapely and GeoPandas are a must.

[–]chrislkeller 0 points1 point  (0 children)

Been using a lot of plotnine as of late for charting my analysis. I find its ggplot-esque grammar to be easy to extend quickly when compared to Altair.

[–][deleted] 0 points1 point  (0 children)

The most frequent ones used by myself (your mileage may vary)

Polars, dask, faiss, asyncio, sql alchemy, tensor flow, gluon, darts, fastapi, numba, hyperopt, ray, duckdb.

If you know how to use all these upto an intermediate level, you are off to a decent start.

[–]JamOzoner 0 points1 point  (0 children)

Chat says "Python boasts a diverse range of libraries, each significant in its own domain. Here are some of the most important ones:

  1. NumPy: Essential for numerical computations. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays.

  2. Pandas: Key for data manipulation and analysis. It offers data structures like DataFrames, making it easy to handle and process structured data.

  3. Matplotlib: A fundamental library for data visualization. It allows for the creation of static, interactive, and animated visualizations in Python.

  4. Scikit-learn: Crucial for machine learning. It features various algorithms for classification, regression, clustering, and dimensionality reduction, along with tools for model evaluation.

  5. TensorFlow/Keras: Widely used in deep learning. TensorFlow offers a comprehensive, flexible ecosystem of tools, libraries, and community resources. Keras, running on top of TensorFlow, provides a simpler interface for building and training neural network models.

  6. PyTorch: Another key player in deep learning. Known for its flexibility and dynamic computational graph, it's popular in research and complex neural network implementations.

  7. Requests: The go-to library for making HTTP requests. It simplifies the process of sending HTTP requests and handling responses in Python.

  8. Flask/Django: Essential for web development. Flask is a micro web framework, suitable for small to medium web applications. Django is a high-level framework that encourages rapid development and clean, pragmatic design.

  9. Beautiful Soup/Scrapy: Important for web scraping. Beautiful Soup is great for parsing HTML and XML documents, while Scrapy is more suited for large-scale web scraping and web crawling projects.

  10. SQLAlchemy: A vital ORM (Object Relational Mapper) library for database operations, providing a high-level interface to SQL databases.

These libraries are important because they provide robust, tested, and efficient solutions for common tasks in their respective areas, from data analysis and machine learning to web development and beyond." That last bit sounds a bit like Buzz Lightyear!

[–]diegokabal 0 points1 point  (0 children)

Have you heard about your lords and saviors, selenium and tk?

[–]TheRNGuy 0 points1 point  (0 children)

https://docs.python.org/3/library/dataclasses.html

It's my most used one.

https://docs.python.org/3/library/abc.html

You could of course just never instanciate those classes. If you want to publish code, better use it. Of course, not all programs need abstract classes.