6 ms·
I know this is unrelated, but probably a lot of Pythonistas here and I've been wondering: what is the async web framework of choice for you guys today? As for D
by bbmario 7y ago
I know this is unrelated, but probably a lot of Pythonistas here and I've been wondering: what is the async web framework of choice for you guys today? As for DBs, still SQLAlchemy? What about a prettier (js) alternative?
- rtny4821 7y agoFastAPI - https://github.com/tiangolo/fastapi https://github.com/tiangolo/fastapi
- daze42 7y agoI've been using FastAPI https://github.com/tiangolo/fastapi https://github.com/tiangolo/fastapi which is built on top of Starlette as my main async framework and Uvicorn as my primary web server. Starlette and Uvicorn are both made by Encode https://github.com/encode https://github.com/encode and in my experience they consistently put out quality stuff.
- vpribish 7y agofwiw: I've moved to Trio over asyncio (I did plain old async for a couple years and Trio makes a ton of sense) Quart-trio over Flask (just to get a Trio-friendly flask-a-like server) - plain old aiohttp worked really well too. It takes a bit more roll-your-own work, but you get exactly what you want. peewee over SQLAlchemy (less committed to this change, but peewee has been fine so far and is much more streamlined) I'm mostly just using SQLite. the async version of the ORM looks pretty new, i'm not using it yet.
- workthrowaway 7y agosanic seems nice. also, sqlalchemy is an over-engineered system imo. i only go for it when i have no other choices. otherwise i use a database client directly.
- oefrha 7y ago> async web framework Not enough experience with async to comment. > DB peewee is good enough and more ergonomic compared to SQLA for a lot of use cases. > formatter black. To be clear it often produces truly horrendous code, but at least there’s no arguing and no fussing over options or details.
- jannotti 7y agoYeah, it's weird that I find code formatted by black much less aesthetically pleasing than js code from prettier. But we're still using it.
- carlosf 7y agoWent from Flask + FlaskRESTPlus to FastAPI. Can't recommend FastAPI enough. https://github.com/tiangolo/fastapi https://github.com/tiangolo/fastapi
- hyzyla 7y agoAiohttp + sqlalchemy
- fjp 7y agoAiohttp + Aiopg which uses sqlalchemy
- bwooster 7y agoHonestly I'm not so into async and more into Lambda with Flask. Here's what I'm using right now for that: https://spiegelmock.com/2020/01/04/python-2020-modern-best-practices/ https://spiegelmock.com/2020/01/04/python-2020-modern-best-p...
- deleted 7y ago[deleted]
- holler 7y agoIn the process of porting a Pyramid app to Starlette and very impressed. It's lightweight, well-documented, and a breeze to use.
- takeda 7y agoI used aiohttp and it is quite good and solid (I also like that it comes with type annotations, which enables autocomplete in PyCharm), I did not have chance to compare it to FastAPI. Regarding database access, my recommendation might not be popular, but I really like asyncpg[1]. They basically dropped DBAPI and instead created their own API that functionally matches PostgreSQL, giving you full control and increasing performance. As a result of that you probably won't be able to use ORMs (there's SQLAlchemy driver, but as I understand it is hacky and you are losing the performance benefits). Personally I compared my code with and without ORM and there's no change in number of lines. If you use PyCharm and configure it to connect to your database (I think that might be a pro feature) it will then automatically detect SQL in your strings provide autocomplete (including table and column names) and provide highlighting, removing all the advantages that ORM provided. [1] https://github.com/MagicStack/asyncpg https://github.com/MagicStack/asyncpg
- thijsvandien 7y agoI’ve been a very happy Tornado user for years.
- j88439h84 7y agoStarlette, by the same author as httpx. https://www.starlette.io/ https://www.starlette.io/
- rajasimon 7y agoDjango + Channels