5 pointsby mesahm4 hours ago1 comment
  • mesahm4 hours ago
    Hi HN,

    I'm the maintainer of Niquests.

    For years, Python's Requests library was the gold standard, but it has been under feature freeze. As the web moved on, the Python ecosystem fractured: we got aiohttp (async only) and httpx (great, but currently struggles in high throughput scenarii for years with no visible solution merged so far).

    I wanted the beautiful, ergonomic API of requests, but I wanted it to speak the modern web and solve most seen struggles around HTTP consumption. So I built Niquests as a drop-in replacement, you can literally do import niquests as requests. I didn't want to reinvent the wheel, I wanted to start on solid ground. Requests and urllib3 are both rock solid, so this was the starting point, learning from them and extend them for the modern web.

    Under the hood, it's a different beast. I've added:

    * HTTP/2 & HTTP/3 over QUIC out of the box * Multiplexing and full thread/task safety (fixed the old concurrency bottlenecks over thousands of TCP connections) * OS trust store support by default (no more certifi issues) * Both sync and async support (in one library) * Deep DNS control (DoH, DoQ, DoT, DNSSEC), "Happy Eyeballs" for fast connects * Integrated WebSocket extension over HTTP/1, HTTP/2, and HTTP/3 * Works in WASM (Pyodide), and compatible with ASGI/WSGI apps * And much more(...)

    Here’s a real-world benchmark: Niquests completes a 1000-request multiplexed workload in 0.55s, compared to httpx (2.08s) and aiohttp (1.35s). See https://gist.github.com/Ousret/9e99b07e66eec48ccea5811775ec1... to verify yourself. And yes it does scale as long as your server can take it.

    I've worked hard to make this the most advanced Python HTTP client. without losing the simplicity and readability we love from requests.

    Would love feedback, technical questions (especially around HTTP/2+ and multiplexing!), or discussion about the state of Python HTTP clients.

    • mesahm4 hours ago
      And most importantly, we managed to get almost every plugin/3rd party tool bound to Requests in a working condition with this fork.