httpx-pycurl
httpx-pycurl provides an httpx transport that executes requests with
pycurl. It combines the goodness of curl with
the familiar httpx API, including support for http/2 and even non-http
protocols built into curl. AsyncPyCurlTransport performs better than
httpx's default AsyncHttpTransport with http2=True, taking about 78% of
the time to issue 128 requests in parallel. Under heavier usage httpx-pycurl
appears to pull further ahead of alternative libraries, without replacing all of
httpx; just httpx's transport.
Usage
AsyncPyCurlTransport is the focus of this package. It uses the curl
multi_socket
interface to integrate curl with the asyncio event loop.
import httpx
from httpx_pycurl import AsyncPyCurlTransport
transport = AsyncPyCurlTransport(timeout=10.0)
async with httpx.AsyncClient(transport=transport) as client:
responses = await asyncio.gather(*(client.get(url) for url in urls))
AsyncPyCurlTransport delegates SSL/TLS handling to curl and does not use
Python's builtin ssl module. By default it calls
certifi.where() to set root
certificates. It is also possible to pass a custom path to the root certificates
with AsyncPyCurlTransport(cainfo=ca_cert_path).
PyCurlTransport is not the focus of this project and is less likely to work.
In the future it may delegate to AsyncPyCurlTransport.
import httpx
from httpx_pycurl import PyCurlTransport
transport = PyCurlTransport(timeout=10.0)
with httpx.Client(transport=transport) as client:
response = client.get("https://example.com")
print(response.status_code)
print(response.text)
debug_transport = PyCurlTransport(
verbose=True,
debug_callback=lambda info_type, data: print(info_type, data),
)
Installation
pip install httpx-pycurl
Or with conda,
conda install -n base conda-pypi
conda pypi install httpx-pycurl
Performance
httpx-pycurl is in early development but it passes most httpx tests and has
good performance. Our tests/bench.py uses asyncio.gather() to make many
http/2 requests to https://httpbingo.org/get using httpx, niquests, and
httpx with httpx-pycurl's transport. httpx-pycurl is the fastest library
tested.
Running tests/bench.py [N] shows that the more efficient http/2 libraries
shine when performing large numbers of parallel requests, and are closer
together when only groups of 128 parallel requests are made.
2 groups of 512 requests each...
Time per group:
httpx: 0.679s ± 0.119s
niquests: 0.432s ± 0.140s
httpx_pycurl: 0.299s ± 0.056s
Paired t-test: httpx_pycurl vs niquests
t-stat: -2.249 (approx p < 0.05 if |t| > 2.365)
Speedup: 1.44x
4 groups of 256 requests each...
Time per group:
httpx: 0.378s ± 0.077s
niquests: 0.259s ± 0.064s
httpx_pycurl: 0.190s ± 0.034s
Paired t-test: httpx_pycurl vs niquests
t-stat: -4.208 (approx p < 0.05 if |t| > 2.365)
Speedup: 1.36x
8 groups of 128 requests each...
Time per group:
httpx: 0.215s ± 0.073s
niquests: 0.205s ± 0.038s
httpx_pycurl: 0.162s ± 0.033s
Paired t-test: httpx_pycurl vs niquests
t-stat: -8.949 (approx p < 0.05 if |t| > 2.365)
Speedup: 1.27x
Dependencies
httpx-pycurl uses curl to support http/2 instead of the h2, hpack and
hyperframe dependencies used by httpx.
$ pip install --dry-run httpx-pycurl
...
Would install anyio-4.13.0 certifi-2026.4.22 h11-0.16.0 httpcore-1.0.9 httpx-0.28.1 httpx-pycurl-0.0.4 idna-3.13 pycurl-7.45.7
$ pip install --dry-run httpx[http2]
...
Would install anyio-4.13.0 certifi-2026.4.22 h11-0.16.0 h2-4.3.0 hpack-4.1.0 httpcore-1.0.9 httpx-0.28.1 hyperframe-6.1.0 idna-3.13
Metadata
Release files for httpx-pycurl 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| httpx_pycurl-0.0.6.tar.gz | 26.0 kB | With provenance | Details for httpx_pycurl-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| httpx_pycurl-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for httpx_pycurl-0.0.6-py3-none-any.whl |
Total release size: 39.9 kB
Release files / httpx_pycurl-0.0.6.tar.gz
| Download URL | httpx_pycurl-0.0.6.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2de2559ee5ea7e11c9e541dccafbda1966e14ca83e42f5d7d490401a55fe9595
|
|
BLAKE2b-256 checksum How to use checksums |
aca8acc726cf1307796a12ff15c3cdfd83b975b6a4725b06b125f60a834cdf28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logRelease files / httpx_pycurl-0.0.6-py3-none-any.whl
| Download URL | httpx_pycurl-0.0.6-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b989b6cafb8cfbc1ea8d836ab0882954273b68368451b65883262c47e45ea6b
|
|
BLAKE2b-256 checksum How to use checksums |
3d3689138c6ac8578c7501e684352e519d92860920e6160a20c2d44ca3d1929d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logSecurity for httpx-pycurl 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for httpx_pycurl-0.0.6.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.