Live data from Hacker News

Httpx: A next-generation HTTP client for Python

python-httpx.org

11–20 of 119 posts

Re: Httpx: A next-generation HTTP client for Python

#14
post #13

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?

FastAPI - https://github.com/tiangolo/fastapi

Re: Httpx: A next-generation HTTP client for Python

#15
post #13

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?

I've been using 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 and in my experience they consistently put out quality stuff.

Re: Httpx: A next-generation HTTP client for Python

#16
post #13

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?

fwiw:

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.

Re: Httpx: A next-generation HTTP client for Python

#17
post #13

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?

sanic 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.

Re: Httpx: A next-generation HTTP client for Python

#19
post #13

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?

> 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.

Re: Httpx: A next-generation HTTP client for Python

#20
> Fully type annotated.

This is a huge win compare to requests. AFAIKT requests is too flexible (read: easier to misuse) and difficult to add type annotation now. The author of requests gave a horrible type annotation example here [0].

IMO at this time when you evaluate a new Python library before adopting, "having type annotation" should be as important as "having decent unit test coverage".

[0]: https://lwn.net/Articles/643399/

Post reply on HN