r/Python • u/Business-Feedback635 • 1d ago
Discussion I compared the libraries Python projects used from 2018 to 2026
PyPI's BigQuery table lists the dependencies of every uploaded file. I counted how many projects require each library in every year from 2018 to 2026, then split the 2026 projects into new ones (first upload in 2026) and older ones.
New projects pick the newer library
- Typer 15,442 vs Click 13,057
- httpx 34,876 vs requests 21,190
- FastAPI 10,852 vs Django 2,221
Older projects keep what they had
- Click 6,209 vs Typer 3,078
- requests 16,210 vs httpx 5,673
- FastAPI 2,416 vs Django 2,293 (close)
Almost nobody switches. Of the projects that required the old library in 2024 and released again in 2026:
- Click → Typer: 32 of 2,654 (1.2%)
- requests → httpx: 161 of 7,765 (2.1%)
- pandas → Polars: 23 of 6,182 (0.4%)
- Django → FastAPI: 0 of 1,214
Some old libraries keep their lead anyway
- pandas 28,787 vs Polars 3,012
- Matplotlib 18,488 vs Plotly 2,974
- PyTorch 10,298 vs TensorFlow 713 (TensorFlow fell from 1.6% of projects in 2020 to 0.3%)
"Isn't this just LLM projects?" Partly. 17% of the new projects with dependencies require an LLM SDK, and about a third of new httpx and FastAPI projects do. But two thirds of them require none.
Limits: these are declared dependencies, not imports. Optional extras are left out. Every project counts once, popular or not. 2026 runs to 2 December.
Charts per pair, the BigQuery query to check your own libraries, and the full switching table: https://py-code.org/blog/python-library-adoption-pypi/
- If you maintain a project on requests, Click or pandas, what would it take for you to switch? Or is "it works" reason enough to stay?
- If you did migrate an existing project (requests → httpx, pandas → Polars, Flask → FastAPI), was it worth the effort?
- For new projects, what made you pick httpx or Typer over the old default?
48
u/deceze 1d ago
Very nice, but hardly surprising. Switching libraries comes with a cost, and unless the new thing is substantially better in some specific aspect, a switch is hardly worth it. Especially for fundamental things like Django vs. FastAPI; you ain’t gonna rewrite your entire server just because.
15
u/kenflingnor Ignoring PEP 8 21h ago
Are people still using httpx? Last I saw that project was pretty much shut down because the maintainer had a mental episode, and most major frameworks have migrated to httpx2
6
u/Gugalcrom123 19h ago
Why did you compare FastAPI to Django and not to Flask?
4
u/Business-Feedback635 1d ago edited 1d ago
Two things you would like to know:
12
u/Ill-Flan3285 21h ago
The 0.4% pandas to Polars migration rate tells you everything about how much developers enjoy rewriting working code.
12
u/mortenb123 1d ago
And still people choose httpx over requests when there is a way better kid in town: https://pypi.org/project/niquests/ I've replaced 40+ requests projects with a oneliner: 'import niquests as requests', for httpx is little more job, but performance is better.
9
u/billsil 1d ago
Polars doesn’t have error messages as good as pandas. At least it’s an option though, plotly vs matplotlib? What good reason is there to switch? The syntax isn’t even similar. On click vs typer, what’s wrong with argparse?
Going even further back, I’m still on unittest. I started with unittest, did nose, then nose2, and back to unittest. It works and isn’t likely to require a refactor ever.
2
u/ali_the_bettor_34 17h ago
one data point from a small market data project of mine: httpx for the rest calls, websockets for the live stream, plotly for the charts, plain argparse for the cli, and no dataframe library at all, prices stay in decimal and the stats come from the stdlib statistics module. so httpx and plotly fit your new projects pattern, but the gap your table can't show is projects that skip both pandas and polars, would be curious how many new projects requiring httpx declare neither
3
u/unapologeticjerk 21h ago
lol @ rich not on there.
Also, I hate scraper bots and I hate Fastly and I hate how even my own personal
pip searchthat quietly snatched and used the JS token got fucked within 24 hours after like two uses. AI or Scum of the Fucking Earth Auto Scrapers: which will end humanity first?2
u/Pro_Strikerr 17h ago
The 0 of 1,214 for Django to FastAPI is the real headline. Nobody rewrites a working server for a nicer framework. For new projects httpx mostly wins because async is built in, so there is no second client to add later
1
u/russellvt 8h ago
Needs more pixels
1
u/darylvp 5h ago
Understandable no Django users want to switch to FastAPI.
-3
u/vesnikos 1d ago
I feel that polars is more suitable for data wrangling or data transformations and pandas more for data analytics, data science