· via Hacker News – Front Page (native)
Pydantic launches HTTPX2, a maintained continuation of the HTTPX Python client
Pydantic has launched HTTPX2, taking stewardship of the HTTPX Python client after slowed upstream development, promising security updates, HTTP/2 support, sync and async APIs and a CLI.
Pydantic takes stewardship of HTTPX as HTTPX2
Pydantic, the company behind the eponymous Python validation library, has announced HTTPX2, a Python HTTP client presented as the continuation of HTTPX. The project surfaced on the front page of Hacker News, linking to its GitHub repository under the pydantic organisation. According to the repository's README, the move comes because upstream HTTPX development has been quiet lately, and Pydantic is adopting the project under a new name so that users have dependable upkeep — prompt security fixes above all — for a library that handles outbound traffic for many production systems.
The README frames HTTPX2 as a handover rather than a rewrite. It credits the original author, referred to as @lovelydinosaur, and the wider HTTPX contributor community for the groundwork, and commits to preserving the existing design, avoiding breakage for current users, and developing the library conservatively from there.
What the library provides
Feature-wise, HTTPX2 mirrors what HTTPX users already know. The API is closely modelled on requests, covering familiar ground such as sessions with cookie persistence, connection pooling and keep-alive, browser-style certificate verification, basic and digest authentication, automatic decompression and content decoding, streaming downloads, multipart uploads, proxy support, .netrc handling and chunked requests.
Beyond that, the README lists several headline capabilities:
- A standard synchronous interface plus async support when needed.
- HTTP/1.1 support out of the box and HTTP/2 via an optional install.
- The ability to call WSGI or ASGI applications directly, without a live network hop.
- Timeouts enforced throughout rather than left as opt-in defaults.
- Full type annotations and, per the project's claim, complete test coverage.
- An integrated command-line client, installed as an optional extra, with click and rich among its dependencies.
Basic usage stays as expected: importing httpx2 and issuing a get request returns a response object exposing status codes, headers and body text, much like requests.
Packaging and dependencies
The base package installs with pip as httpx2, with feature extras for HTTP/2, the CLI, SOCKS proxies, brotli decoding and zstd decoding. One Python-version nuance the README calls out: from Python 3.14 onward, zstd decoding uses the standard library's compression.zstd module where available, and the zstd extra then installs nothing.
The transport layer is httpcore2, which handles HTTP/1.1 through h11; concurrency support runs on anyio so both asyncio and trio backends work. SSL verification leans on truststore, which uses the operating system's trust store, and international domain names are handled by idna. The project is BSD licensed and acknowledges requests for its API layout and urllib3 for lower-level networking design ideas. Documentation is published at httpx2.pydantic.dev.
Observability out of the box
The most commercially telling detail is first-class integration with Pydantic Logfire, the company's OpenTelemetry-based observability platform. Installing logfire with HTTPX instrumentation and calling logfire.instrument_httpx() traces every request — timings, status codes and spans — with no further code changes, according to the README. Instrumentation also works for explicit httpx2.Client and httpx2.AsyncClient instances, can be scoped to a single client, and a capture_all flag extends capture to request and response headers and bodies.
Why it matters
HTTPX became one of the standard ways Python code talks to the web, and a slowdown in its maintenance left a dependency gap in a lot of production stacks. A company-backed steward offering continuity, compatibility and rapid security response addresses that directly, and the decision to keep the API requests-shaped lowers the migration cost for teams already invested in either library.
The open questions are ecosystem ones. A rename means every project pinning httpx now faces a decision about if and when to move, and HTTPX2's credibility will rest on whether its compatibility promises hold over time. The deep Logfire integration signals the commercial logic behind the stewardship, which some will read as a benefit and others as a vendor tie-in. The Hacker News attention suggests the community is watching closely either way.
- #python
- #http-client
- #open-source
- #pydantic
- #http2