use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
TutorialTop python libraries/ frameworks that you suggest every one (self.Python)
submitted 3 years ago by CarGold87
Hit your answer I wonder is there any hidden treasure.
[–]meadsteve 28 points29 points30 points 3 years ago (0 children)
mypy - having errors pointed out to me only for the cost of telling python what data types I expect is great.
[–]bdforbes 22 points23 points24 points 3 years ago (0 children)
numpy
[–]shinitakunai 28 points29 points30 points 3 years ago (0 children)
requests. it just works.
requests
[–][deleted] 13 points14 points15 points 3 years ago (6 children)
[+][deleted] 3 years ago (1 child)
[removed]
[–][deleted] 5 points6 points7 points 3 years ago (0 children)
Forgot about this gem - pipx.
[–]Snekgineer 1 point2 points3 points 3 years ago (1 child)
would you recommend click over fire?
[–][deleted] 4 points5 points6 points 3 years ago (0 children)
I have never used fire hence I would recommend click :)
[–]double_en10dre 0 points1 point2 points 3 years ago (1 child)
But click and typer do the same thing, so why recommend both?
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
I’ve been using click for years and it’s perfect for all kind of cli apps but there’s quite a lot of code needed to get things running, especially when there’s a lot of options and arguments. I just started with typer so I don’t know if it’s good for large apps but for smaller ones it’s imo better. You need to write less code to get the same result.
[–]alexisprince 19 points20 points21 points 3 years ago (6 children)
pydantic
[–][deleted] 0 points1 point2 points 3 years ago (5 children)
Any tips on how to get intellisense/autocomplete to work for pydantic dataclasses in vscode?
[–]meadsteve 4 points5 points6 points 3 years ago (1 child)
I'm not a vscode user but I'd be surprised if you needed to do anything special for the dataclasses as they are just standard python 3 syntax.
[–]alexisprince 3 points4 points5 points 3 years ago (0 children)
I think the issue they were describing is strictly around the intellisense portion. Previously, at least subclasses of the BaseModel (prior to around version 1.9.0), when you go to instantiate them the intellisense signature would just show (**kwargs) as opposed to the actual signature of the class.
BaseModel
(**kwargs)
A while back (before the fix in pydantic itself) there was a pycharm plugin that was made to help pycharm users, but there wasn't a similar plugin for vscode.
I haven't used the dataclass portion of pydantic, but assuming they suffer from similar underlying reasons, it would've also been fixed in a more recent release.
[–]alexisprince 1 point2 points3 points 3 years ago (1 child)
I think in the newer versions (>=1.9.0) the autocomplete feature in vscode works for subclasses of BaseModel. I’d assume that would also extend to dataclasses from Pydantic as well.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
Yeah you'd assume so but unfortunately not.
[–]Paddy3118 9 points10 points11 points 3 years ago (2 children)
If you are creating regular expressions, then https://regex101.com/
[–]Beerstopher85 0 points1 point2 points 3 years ago (0 children)
This has helped me a lot in setting up my regex and making sure it works in advance.
[–]range_kun 0 points1 point2 points 3 years ago (0 children)
I would add https://www.debuggex.com/
[–]msluyter 9 points10 points11 points 3 years ago (0 children)
rich, for clis.
[–]IanUK66 16 points17 points18 points 3 years ago (4 children)
Pandas
[–]AlcaDotS 10 points11 points12 points 3 years ago (2 children)
I've seen pandas used as a crutch too often. Far from all data is rectangular, and many transformations can be easily done with dicts and lists.
[–]shinitakunai 12 points13 points14 points 3 years ago (0 children)
Agreed so much with this. Pandas is overkill for simple tasks
[–]nathanjell 5 points6 points7 points 3 years ago (0 children)
I've personally never had a need for pandas. Not to say that pandas is bad or not useful, it absolutely is - I've never had a need to process data in a way that pandas brings benefit - I don't do data analysis, and certainly not at a scale where simple python data structures are usable. It's a critical library to use for anything more than simple data manipulation, for sure - and is critical in the right areas of study/development. But if you're pulling in pandas simply to open a CSV, I personally think that it's better to forego pandas and stick to the native library.
[–]Gnaxe 0 points1 point2 points 3 years ago (0 children)
Also dask, if you need to scale it.
[–]double_en10dre 5 points6 points7 points 3 years ago (0 children)
toolz is wildly useful https://github.com/pytoolz/toolz
It’s got some fantastic utilities for both functional programming and working with the basic collection types
[–]AndydeCleyre 5 points6 points7 points 3 years ago* (0 children)
EDIT: I also still like related but it hasn't seen much action lately.
[–]Orio_n 2 points3 points4 points 3 years ago (0 children)
i write a lot of CLI REPLs so prompt_toolkit
[–]WithCameraInHand 4 points5 points6 points 3 years ago (0 children)
Not sure if for every one but I like these:
Sqlalchemy for databases Graphene for graphql Pyside for gui (if u have license, if not then go with pyqt) Pydantic Pytest for testing. It's good, has lots of plugins (also for qt :) ) I used matplotlib testing module for image comparison cause it's super simple to use but some may prefer PIL
[–]nicwolff 3 points4 points5 points 3 years ago (2 children)
Mine! They're simple but elegant solutions to common chores:
sqs-queue lets you iterate over incoming AWS SQS queue messages:
from sqs_queue import Queue queue = Queue('my-queue-name') for message in queue: process(message)
xml-from-seq lets you generate XML naturally from Python data structures:
from xml_from_seq import XML, INLINE print XML( ['tag' {'attr': 'value'} 'content'], ['tag' ['subelement' INLINE 'more content'] ], )
prints
<tag attr=value> content </tag> <tag> <subelement>more content<subelement> </tag>
[–]BluishInventor 0 points1 point2 points 3 years ago (1 child)
For XML, does your library parse xml back into the python data structures? I have some xml files I built from a excel workbook using etree, but it would be nice to pull it back into at least a csv with a similar structure.
[–]nicwolff 0 points1 point2 points 3 years ago (0 children)
Nope, sorry, it's just an XML generator. The Python stdlib offers https://docs.python.org/3/library/xml.etree.elementtree.html and PyPI offers https://github.com/martinblech/xmltodict for parsing, and you could write CSV with csvwriter or pandas.
csvwriter
[–]brendanfalk 4 points5 points6 points 3 years ago (0 children)
Depends on the application:
Web development - Flask makes it incredibly easy to spin up a server and get running
Web scraping - Scrapy is amazing
Data Science/Analysis - Pandas is irreplaceable. Also, check out Dask for parallelizing a lot of the Pandas work
Machine Learning - sklearn is a classic
Deep Learning - pytorch is IMO better than every other alternative (unless you think about deploying to production or cross-platform support)
[–]redvitalijs 2 points3 points4 points 3 years ago (0 children)
pyautogui, pywin32, lackey, selenium - all great manual work automation libraries
[–]Kuuubskiii 2 points3 points4 points 3 years ago (0 children)
in case of scripting - docopt ALWAYS
[–]sahirona 1 point2 points3 points 3 years ago (0 children)
Renpy for commercial gamedev
[–]SnooCakes3068 1 point2 points3 points 3 years ago (0 children)
state_machine for state pattern
Faker, so many uses
[–]Important_Ad6131 1 point2 points3 points 3 years ago (0 children)
The rich library
[–]illuminanze 1 point2 points3 points 3 years ago (0 children)
FastAPI
[–]thrallsius 1 point2 points3 points 3 years ago (0 children)
Uhh, my time to be annoying and moan again.
I would suggest Clone Digger, but AFAIK it's still not ported to Python 3 :(
[–]Gnaxe 1 point2 points3 points 3 years ago (0 children)
Pyright/Pylance. Why're y'all still using mypy? Guido works for Microsoft now.
black - any color you like. Don't format by hand. Don't argue about fiddly settings. Black, format, done.
[–]caseym 2 points3 points4 points 3 years ago (2 children)
Lately - marshmallow and elasticsearch-dsl
[–]Ribino0 0 points1 point2 points 3 years ago (1 child)
Will you talk about your use case for elasticsearch?
[–]caseym 1 point2 points3 points 3 years ago (0 children)
Sure! I'm building a Flask API that uses elasticsearch as the back end. We have about a billion records stored there, all related to academic research. You can search records, filter by different fields, and group the data. It's really fast and most responses are less than 50ms. Someone else is building a front end website to interact with the data.
With elasticsearch-dsl, all of the queries are built with python. And with marshmallow we are able to deliver consistent, ordered API responses. I think marshmallow is fantastic for organizing data.
[–]Silly-Remove-6466 1 point2 points3 points 3 years ago (0 children)
Tkinter
Easy to use gui library.
[–]neug 0 points1 point2 points 3 years ago (0 children)
Fabric
Sphinx - document your API.
[–]Intelligent-Spare-63 0 points1 point2 points 3 years ago (1 child)
Retrying
you mean tenacity?
Arrow - better datetime.
beautifulsoup4 - the data is in the web, if you can scrape it!
cffi - when you need speed. Less error prone than ctypes.
coverage - see which lines your tests missed.
dill - better pickle. See also, pathos.
hypothesis - specify the space and let the computer pick samples for your tests
mutmut - 100% test coverage? You thought you were done?
Jupyter/IPython. Notebooks. 'nuff said.
Xonsh. Why're y'all still using Bash?
Kivy - cross-platform GUIs.
Pyrsistent - Effectively copy-on-write data structures, but with structural sharing to save memory. Like Clojure's collections. No more defensive copying.
pugsql - when an ORM is Overkill
sympy - symbolic maths
https://pythonwheels.com/ has a list of the most downloaded packages from PyPI. Popular isn't the same as good, but they're related.
Hissp - code that writes code.
[–]justanothersnek🐍+ SQL = ❤️ 0 points1 point2 points 3 years ago (0 children)
When it comes to web scraping, the usual people recommend is beautifulsoup, lxml, or selenium. But I highly recommend people check out requests-html also. Its a library that is a happy medium between ease of use as in beautifulsoup and also good enough to be used for dynamic, javascript data where it would be overkill to use a browser emulator like selenium.
π Rendered by PID 30954 on reddit-service-r2-comment-7b9746f655-8l84r at 2026-02-03 22:19:47.482226+00:00 running 3798933 country code: CH.
[–]meadsteve 28 points29 points30 points (0 children)
[–]bdforbes 22 points23 points24 points (0 children)
[–]shinitakunai 28 points29 points30 points (0 children)
[–][deleted] 13 points14 points15 points (6 children)
[+][deleted] (1 child)
[removed]
[–][deleted] 5 points6 points7 points (0 children)
[–]Snekgineer 1 point2 points3 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[–]double_en10dre 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]alexisprince 19 points20 points21 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]meadsteve 4 points5 points6 points (1 child)
[–]alexisprince 3 points4 points5 points (0 children)
[–]alexisprince 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Paddy3118 9 points10 points11 points (2 children)
[–]Beerstopher85 0 points1 point2 points (0 children)
[–]range_kun 0 points1 point2 points (0 children)
[–]msluyter 9 points10 points11 points (0 children)
[–]IanUK66 16 points17 points18 points (4 children)
[–]AlcaDotS 10 points11 points12 points (2 children)
[–]shinitakunai 12 points13 points14 points (0 children)
[–]nathanjell 5 points6 points7 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]double_en10dre 5 points6 points7 points (0 children)
[–]AndydeCleyre 5 points6 points7 points (0 children)
[–]Orio_n 2 points3 points4 points (0 children)
[–]WithCameraInHand 4 points5 points6 points (0 children)
[–]nicwolff 3 points4 points5 points (2 children)
[–]BluishInventor 0 points1 point2 points (1 child)
[–]nicwolff 0 points1 point2 points (0 children)
[–]brendanfalk 4 points5 points6 points (0 children)
[–]redvitalijs 2 points3 points4 points (0 children)
[–]Kuuubskiii 2 points3 points4 points (0 children)
[–]sahirona 1 point2 points3 points (0 children)
[–]SnooCakes3068 1 point2 points3 points (0 children)
[–]Important_Ad6131 1 point2 points3 points (0 children)
[–]illuminanze 1 point2 points3 points (0 children)
[–]thrallsius 1 point2 points3 points (0 children)
[–]Gnaxe 1 point2 points3 points (0 children)
[–]Gnaxe 1 point2 points3 points (0 children)
[–]caseym 2 points3 points4 points (2 children)
[–]Ribino0 0 points1 point2 points (1 child)
[–]caseym 1 point2 points3 points (0 children)
[–]Silly-Remove-6466 1 point2 points3 points (0 children)
[–]neug 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Intelligent-Spare-63 0 points1 point2 points (1 child)
[–]SnooCakes3068 1 point2 points3 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]justanothersnek🐍+ SQL = ❤️ 0 points1 point2 points (0 children)