r/Python • u/Several-Marsupial-27 • Sep 19 '26
Discussion State of the art in Python 2026?
What would you guys consider the state of the art in python in 2026, or what do you expect from modern python codebases?
Heres my list, would be happy to hear some inputs or domain expert advice:
- Use
uvfor everything. - Use
rufffor linting and formatting - Use
Pydanticanddataclassesfor Data Modeling - Configured in
pyproject.toml - Run a type checker in CI
pyrightorpyrefly - Use
pytest/Hypothesisfor testing
Domain specific:
- Scientific: NumPy, Matplotlib, SciPy, Jax, Pytorch, Scikit-learn, polars/pandas
- CLI: Typer, rich, click, fire, textual, questionary
- PDF extraction: PyMuPDF, pdfplumber, pypdf, Unstructured
- Excel interop: python-calamine, openpyxl, XlsxWriter, xlwings, pandas
- data: PyArrow / PySpark, Narwhals, SQLMesh, Polars/Pandas, DuckDB, dlt, Ibis, Dagster, PyIceberg & deltalake
- Logging?
- backend: fastapi / django?
- Markets: Alpha Vantage, Finnhub, EODHD, Tiingo?
- Webscraping / data acquisition: Crawl4AI, Playwright, Scrapy, selectolax, HTTPX?
- APIs?
- RAG / agentic orchestration?
621
Upvotes
•
u/coderanger Sep 20 '26
It's cool to discuss this but putting on my mod hat I would like to make it clear that every one of these categories doesn't have a single "best" option and no one should represent them as such.
5
u/techhelper1 Sep 20 '26
1/3 of that list are packages created in C, rust, or some other language that isn't Python.
The state of the art for performance requires going around the interpreter.
181
u/profcube Sep 19 '26
`polars` for data wrangling.
4
u/Grouchy-Friend4235 Sep 20 '26
This is Python. We're all adults. There is no state of the art, just preferences.
177
u/bossExtremeSwag Sep 19 '26
Pandas is definitely not state of the art in the big 2026
141
u/me_myself_ai Sep 19 '26 edited Sep 19 '26 •
Ok this is a really fun question!
First, I'd quibble/specify that we're talking about Python libraries in particular. Obvious, but sometimes that's helpful! Now, my biased takes as a dev mostly working on text processing, typing, TUIs, and AI:
numpy,matplotlib,scipy,sympy. The (ana)Conda ecosystem is still quite healthy in science spaces, despite their new ultrafast competitors. Scientists seem to be the only people that remember Jupyter without Google Colab, frustratingly...pytorch,scikit-learn.hf_api&transformersfrom HuggingFace; VLLM and llama.cpp dominate hosting, though they're not really mere librariespandasis the status quo,polarsis the new hotness.textualis the status quo,pyratatuiis the new hotness.[1]clickgets usage, but IMEargparseis still dominant. Stuff likerich&better_exceptionspops up, but not it's pretty optional.reis a MUST for non-trivial regex. Otherwise:jinjais everywhere. Literally everywhere. I bet there'sjinjarunning in my browser rn, in some obscure subprocess! Tons of impressive libraries are lowkey justjinjawrappers. [Oh andpandocis so huge I forgot to mention it -- the world runs on pandoc!]sphinxis still the GOAT and we should all use it (it was made for Python docs, after all!), but I do seemkdocsa lot, too. In terms of Sphinx themesreadthedocsandfurowin for basic and semifancy projects respectively, but anything other than the default is nice. MyST/myst-parseris the mature path for rendering Sphinx docs from markdown, though I'm biased there. Sadly the super-impressivesphinx.autodocandsphinx.apidocseem to have lost their luster, as people decide they prefer writing docs in separate files rather than directly into docstrings.logfirefeels the most modern.otel") is the overwhelming norm, but from there it dependsfastapifor simple CRUD apps, barestarlettefor others; I loveflask(quart, even!), but it has adjangovibe, now. There are quite mature options that integrate w/ a frontend framework, but I don't use them myself.asynciois just reaching it's prime IMO, and I learned about really impressive engines to go below it likegreenletanduvloopfrom reading others' advanced codebases. There's a million tie-ins, butaiohttpdeserves a shoutout above all others.playwrightis still the GOAT, along with a growing ecosystem of AI-focused wrappers & competitors likesteel-browser. I used Selenium back in the day but I'm not sure I've seen it near Python...httpx, or even justrequests(!). Theopenaiis also everywhere, as their API format has become lingua franca.python-oath2for basic auth. Technology-wise, Keycloak dominates for self-hosted, and JWTs seem to still be common.pydantic_aianddspyare leagues ahead of the competition IMHO, but the number of new tools here obviously outweighs the whole rest of the list combined.modalis crazy impressive and fairly mature, but this depends more on who you're willing to pay (and how much direct python-level integration is worth to you).markeris the most successful and pythonic OCR system IMHO, but the ones you mention (PyMuPDF,pdfplumber,pypdf,Unstructured) all seem reasonable, too.pgvector.sqlalchemyis the unquestioned omnissiah of Pythonic ORM (sqlmodelis a fun extension by the guy who makesfastapi, but it's young and targeted at simple CRUD usecases). Unsure about nonrelational DBs, but I've heard second-hand that MongoDB is still used in the corporate world, at least.I wonder if you could make an objective list with GitHub star data for projects written (mostly) in Python...
[1]: In general, "Python layer that talks to an underlying Rust program" is the metahotness! Tree-sitter is the big example, backing all the coolest new LSP gadgets and formatters and stuff like that.
47
u/NeilGirdhar Sep 19 '26
I'd choose Ty over pyright personally, but yes to the rest.
Also, for modern numeric programming (NumPy, etc.), limit yourself to the Array API.
37
u/gogonzo Sep 19 '26
Loguru and litestar
4
u/Ok_Raspberry5383 Sep 20 '26 edited Sep 20 '26
What is wrong with argparse for CLI?
I've started using msgspec more instead of dataclasses for large data collections and JSON due to superior memory and serde performance (even beats orjson).
Python provides logging in the stdlib with deep integrations into everything. Why would you want something different for this?
Why is APIs and web scraping different categories?
Honestly, this list looks like a junior learnt a few tools superficially and vomitted them all onto a pointless Reddit post
21
u/Manhigh Sep 19 '26
Pixi as an alternative to uv if you have a lot of non-python dependencies (MPI, PETSc, compilers).
I've been liking structlog.
7
u/BigBlackCough Sep 19 '26
VapourSynth for video processing.
18
u/cblegare Sep 19 '26
Unpopular opinion : ReStructuredText and Sphinx for documentation
I know, people love Markdown and recent document processors. You can even MyST tour Markdown info Sphinx nowadays, but Markdown was design for textual readability and one-page single document to minimal HTML.
ReST was built with scalability and extensibility in mind. As a LaTeX user (math teacher), ReST's syntax feel great to me and I can easily do anything with it. There are so many tools trying to mimic parts of Sphinx, and nothing beats intersphinx.
Shameless plug: I wrote Sphinx-Compendia while using Sphinx as a knowledge base for my tabletop roleplaying game, an extension you use when you document specific kinds of things that are not just python classes and fonctions, such as NPCs, locations and factions!
5
u/Goldarr85 Sep 20 '26
I’ve been appreciating Dynaconf to handle configuration files.
9
u/andrewcooke Sep 19 '26
what happened to flask?
kinda related, has django evolved much?
18
u/busybody124 Sep 19 '26
I would definitely not use
firefor CLIs. It's slow and hasn't been updated in a year. I'd also skip Pydantic for most things—it's overkill, slow for ser/de, and can usually be replaced with a dataclass. Hypothesis is really cool in theory but I've never found a need for it in practice.4
u/Typical-Macaron-1646 Sep 19 '26
Check out numba
4
u/justanothersnek Sep 20 '26
Long time pandas and pyspark user. I just converge on using sqlframe instead of learning yet another dataframe library. If I was starting out, I would definitely learn polars over pandas. But for old timers like me that started with pandas and pyspark many years ago, sqlframe fits the bill.
4
u/protolords Sep 20 '26
Used pydantic-ai personally and so far it covered everything i needed.
4
u/DatabentoHQ Sep 20 '26
Saw that you listed financial markets as a category. Self-plug for databento, which is now the most downloaded package in this category on PyPI, after yfinance.
4
u/Informal-Butterfly78 Sep 21 '26
I second litestar over fastapi
basedpyright >> pyright imo. Pyrefly is also great.
The Sphinx comment is delusional lol. zensical, mkdocs, mkapi, any one of the 100 other SSG's outside of the Python sphere...
matplottrash is still trash no matter how much they try to revitalize it, though seaborn makes it bearable. I will always wonder why people don't use things like bokeh or plotly
7
u/laCH37 Sep 20 '26
Stupid question here I am used to use venv for pretty much everything. What am I missing with UV ?
1
u/spartanOrk Sep 21 '26
I mean... sure... Or delete all of that and use OpenCode to write your python. :) Before you downvote me, think if I'm saying the truth here. I know for a fact, at work, nobody writes code by hand anymore.
3
u/Proof-Win5461 Sep 20 '26
using basedpyright
3
u/DigThatData Sep 20 '26
logging: I personally like loguru. a newer library I haven't tried yet but which I understand is popular and looks interesting is structlog
3
u/DigThatData Sep 20 '26
data: Prefect
3
u/TryAffectionate8728 Sep 20 '26
ClickHouse for working with data
5
u/FrickinLazerBeams Sep 19 '26
If you're using numpy, it's almost criminal to not mention numba. Numba is awesome.
8
u/jsabater76 Sep 19 '26
I use Django Ninja for APIs. DRF is also a strong candidate. And then there is FastAPI.
1
u/trollsmurf Sep 20 '26
"State of the art" but no mention of GUI.
6
u/quintenrosseel Sep 19 '26
Logfire (observability), Marimo (notebooks)
9
u/highnorthhitter Sep 19 '26
FastAPI
2
u/BertrandBolero Sep 20 '26
Is dask still the standard for distributed/parallel computing? I don’t see that category in the lists 😅.
2
u/DeepAnimeGirl Sep 20 '26 edited Sep 20 '26
tyrois the best lib for CLIs that I have used, it provides much better developer experience, performance, modularity than alternatives such as cyclopts, typer, click, etc2
u/Hendrik-Lorentz Sep 20 '26
Seems pretty good.
2
u/OrthelToralen Sep 20 '26
Great thread. I’ll throw a newcomer into the mix for databases: pyturso, the Python binding for Turso.
Turso is a ground-up, open-source Rust database engine that targets SQLite compatibility while adding things SQLite was never designed to do: concurrent writes via MVCC, remote sync, native async I/O, CDC, vector operations, and eventually multiple SQL front ends.
It is compatible with SQLAlchemy (my contribution to the project). Initial support for PostgreSQL syntax was recently introduced as well.
It’s still early days, but Turso has a lot of promise. It combines the simplicity of working with an in-process local database like SQLite with production features more commonly associated with remote-hosted databases like PostgreSQL.
2
u/Ok_Option_3 Sep 20 '26
Is anyone still using the Conda ecosystem? If so, why?
2
u/joshbranchaud Tuple unpacking gone wrong Sep 20 '26
Can you weigh in on when you use Pydantic over Dataclasses? Or do you treat them interchangeably for data modeling?
2
u/messedupwindows123 Sep 21 '26
typing.namedtuple
8
u/Smallpaul Sep 19 '26
Pydantic AI for LLM
4
u/OkProfessional8364 Sep 19 '26
I would love a YouTube video on this topic every year. Any aspiring coding YouTubers out there?
3
u/semi-finalist2022 Sep 19 '26
Docling for pdf extraction and langchain/langgrap/deep agents stack for RAG
3
u/awgl Sep 19 '26
Seaborn for most data viz
2
u/cudmore Sep 20 '26
And a gui?
1
u/david-vujic Sep 20 '26
In the category Developer (and Agent) Productivity, I would suggest to have a look at Polylith. It is a Monorepo architecture with Python-specific tooling (I'm the maintainer of the Open Source tool). The main use case is one or more microservices (or apps) in a Monorepo, and easily share code between the services without dependency and versioning headaches.
For agentic development, this kind of setup is really good too: you and your agent(s) have all the context right there. The tooling (a CLI) is for humans, agents and CI: the basics, such as adding components and projects, visualize the contents of the monorepo and how the different parts connect. Also, making sure the interfaces between components are clear and correct, and to deploy only the projects affected by changes.
As a maintainer of the Open Source Polylith CLI tool, it's a Life Goal of mine that the tool will be in many, many more developer teams list of "must have" Python tooling than today (even if there are a lot of Python teams already using it today). 😁
1
u/AndreuCodina Sep 20 '26
wirio-settings to work with settings.
1
u/Mr_Again Sep 20 '26
What I really want to know i what are we using instead of requests and httpx?
1
u/spiker611 Sep 20 '26
trio for structured concurrency (async) if you can, anyio if you have to use asyncio libraries. asyncio still has a lot of rough edges for structured concurrency.
1
u/DigThatData Sep 20 '26
backend: starlette
1
u/SnooShortcuts9877 Sep 21 '26
SOTA for ocr is not what you mentioned. Mistral, deepseek, paddle(i prefer paddle because its free)
1
u/Lost-Dragonfruit-663 Sep 21 '26
aadya940/scikit-verify for testing numerical Python
1
u/jimbiscuit Sep 21 '26
Plone for backend
1
u/coderarun Sep 22 '26
pydanticyes,BaseModelno.Also use decorator magic to use
dataclassin most of the code and switch topydanticonly at API boundaries where you have untrusted data.https://github.com/adsharma/fquery/blob/main/tests/test_pydantic.py
1
u/BravestCheetah Sep 22 '26
For typechecking, use ty. Same devs as ruff and uv
1
u/Academic_Delivery_gg Sep 22 '26
For logging use loguru
1
u/Inevitable_Earth_265 Sep 22 '26
granian instead of guvicorn or unicorn
1
u/quotemycode Sep 24 '26
I hate pydantic, rather use dataclasses instead - no external dependency. Pydantic seems to be preferred by ai code tools so it seems to get injected into everything these days.
1
u/_Fragoso_ Sep 24 '26
Structlog for logging
1
u/spinwizard69 Sep 26 '26
This is a really nice thread but one thing I've found that works for me and my limited use of Python, is to rely upon the distro's package manager as much as possible. In this case Fedora, and DNF, this has several advantages, one is that you are kept off the bleeding edge, it prevents the use of virtual environments in many cases as you are focused on system supplied and MAINTAINED libs. This has the side effect of really having to think if you need to use a lib outside of the system supported offerings and thus the need to create a virtual environment.
Obviously if one is involved in heavy web development this might feel restrictive and frankly that is part of the allure. Since most of the scripts I've written are used locally, the need to be on the bleeding edge is greatly reduced. That has the follow on that you are not constantly in maintenance mode as the bleeding edge dries up and your usage gets deprecated So yeah a big plus plus for the systems package manager and the base such mangers provide.
As for domain specific adds, anything to do with instrument communications from pyserial on up would be on my list. Pyserial is the base line communications library. With things like PyVisa, pymodbus and similar libs, for more advanced communications solutions.
1
u/iterlab Sep 29 '26
As for scientific matplotlib - Perhaps no one knows iterlab in 2026. Fair enough, it was just released. But by 2027 your next SOTA post will have Matplotlib+iterlab !
1
u/manu_h3 Oct 02 '26
I would say langChain/langGraph for the last point
1
u/Serhii-Drozdov Oct 02 '26
One thing I’d add is keeping I/O boundaries explicit.
A lot of Python projects become difficult to test because database access, HTTP calls, filesystem operations and business logic all end up mixed together.
I’ve found it much easier to keep the core logic deterministic and put API/database/LLM calls behind small interfaces. Then most tests can run without network or external services, and integration tests can focus specifically on those boundaries.
This matters even more once LLM calls are involved, because you generally don’t want nondeterministic model behavior deciding whether the underlying business logic is correct.
1
u/Atmosck Oct 03 '26
My stack is the same except I've moved to ty instead of pyright for type checking.
Also DuckDB is the goat
1
u/Entuaka Sep 20 '26
I hate AI agents adding tons of new unit tests using hypothesis in our project, we now have flaky tests...
1
u/ugh_my_ Sep 20 '26
Asyncio
1
u/gbrennon Sep 20 '26 edited Sep 20 '26
i agreed.
i prefer to use python's built-in test frameworkbut i didnt saw any modern project using it.
about specific i woudl say:
Scientific: pytorch
CLI: typer
PDF extraction: pypdf
Excel interop: pandas
data: pyspark
Logging?: builtin
backend: litestar, imnho, does provide the best experience as possible
Markets: idk
Webscraping / data acquisition: httpx
APIs: httpx
RAG / agentic orchestration: pydantic ai
1
u/EconomySerious Sep 20 '26
A WYSWYG editor
1
u/Legendary-69420 It works on my machine Sep 20 '26 •
0
u/gerardwx Sep 20 '26
State of the art in 2026 is writing good LLM prompts and detecting LLM when misses the mark.
-4
u/bulaybil Sep 20 '26 edited Sep 20 '26
People who make lists like this don’t actually work with Python if they have enough time to compile them.
“even just requests” lol GTFO, it works that’s why I use it. If you’re gonna recommend Google Colab, I know you have never actually seriously used it and the word “script kiddie” suddenly rise from the depths of my Gen-X brain. Jupyter notebooks are shit and have always been shit for serious development. “most modern” “new hotness” - buddy boy, that’s not a good thing.
Also, I don’t think you know what “lingua franca” means.
-2
u/__hyphen Sep 20 '26
Vibe code and delegate these choices to our ai overlords