Powerful and fast Rust based HTTP client
Project Links
Meta
Author: Markus Sintonen
Requires Python: >=3.11
Classifiers
Development Status
- 4 - Beta
Programming Language
- Python
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
- Python :: Implementation :: GraalPy
- Rust
Intended Audience
- Developers
- Information Technology
Operating System
- POSIX :: Linux
- Microsoft :: Windows
- MacOS
Typing
- Typed
pyreqwest - Powerful and fast Rust based HTTP client. Built on top of and inspired by reqwest.
Why
- No reinvention of the wheel - built on top of widely used reqwest and other Rust HTTP crates
- Secure and fast - no C-extension code, no Python code/dependencies, no
unsafecode - Ergonomic and easy to use - similar API as in reqwest, fully type-annotated
- Testing ergonomics - mocking included, can also connect into ASGI apps
Using this is a good choice when:
- You care about throughput and latency, especially in high concurrency scenarios
- You want a single solution to serve all your HTTP client needs
This is not a good choice when:
- You want a pure Python solution allowing debugging of the HTTP client internals
- You use alternative Python implementations or Python version older than 3.11
Features
- High performance, see notes and benchmarks
- Asynchronous and synchronous HTTP clients
- Customizable via middlewares and custom JSON serializers
- Ergonomic as
reqwest - HTTP/1.1 and HTTP/2 support (also HTTP/3 when it stabilizes)
- Mocking and testing utilities (can also connect to ASGI apps)
- Fully type-safe with Python type hints
- Full test coverage
- Free threading, see notes
Standard HTTP features you would expect
- HTTPS support (using rustls)
- Request and response body streaming
- Connection pooling
- JSON, URLs, Headers, Cookies etc. (all serializers in Rust)
- Automatic decompression (zstd, gzip, brotli, deflate)
- Automatic response decoding (charset detection)
- Multipart form support
- Proxy support (also SOCKS)
- Redirects
- Timeouts
- Authentication (Basic, Bearer)
- Cookie management
Quickstart
# uv add pyreqwest
from pyreqwest.client import ClientBuilder, SyncClientBuilder
async def example_async():
async with ClientBuilder().error_for_status(True).build() as client:
response = await client.get("https://httpbun.com/get").query({"q": "val"}).build().send()
print(await response.json())
def example_sync():
with SyncClientBuilder().error_for_status(True).build() as client:
print(client.get("https://httpbun.com/get").query({"q": "val"}).build().send().json())
Context manager usage is optional, but recommended. Also close() methods are available.
Mocking in pytest
from pyreqwest.client import ClientBuilder
from pyreqwest.pytest_plugin import ClientMocker
async def test_client(client_mocker: ClientMocker) -> None:
client_mocker.get(path="/api").with_body_text("Hello Mock")
async with ClientBuilder().build() as client:
response = await client.get("http://example.invalid/api").build().send()
assert response.status == 200 and await response.text() == "Hello Mock"
assert client_mocker.get_call_count() == 1
Manual mocking is available via ClientMocker.create_mocker(MonkeyPatch).
Simple request interface
This is only recommended for simple use-cases such as scripts. Usually, the full client API should be used which reuses connections and has other optimizations.
# Sync example
from pyreqwest.simple.sync_request import pyreqwest_get
response = pyreqwest_get("https://httpbun.com/get").query({"q": "val"}).send()
print(response.json())
# Async example
from pyreqwest.simple.request import pyreqwest_get
response = await pyreqwest_get("https://httpbun.com/get").query({"q": "val"}).send()
print(await response.json())
Documentation
See docs
See examples
Compatibility with other libraries
0.13.0
Sep 05, 2026
0.12.4
Aug 12, 2026
0.12.3
Aug 07, 2026
0.12.2
Jul 23, 2026
0.12.1
Jul 23, 2026
0.12.0
May 09, 2026
0.11.8
Apr 26, 2026
0.11.7
Apr 19, 2026
0.11.6
Mar 12, 2026
0.11.5
Mar 09, 2026
0.11.4
Mar 07, 2026
0.11.3
Mar 07, 2026
0.11.2
Mar 06, 2026
0.11.1
Mar 01, 2026
0.11.0
Feb 14, 2026
0.10.1
Jan 19, 2026
0.10.0
Jan 18, 2026
0.9.0
Jan 09, 2026
0.8.1
Jan 03, 2026
0.8.0
Jan 02, 2026
0.7.0
Dec 29, 2025
0.6.0
Dec 26, 2025
0.5.1
Dec 13, 2025
0.5.0
Oct 12, 2025
Wheel compatibility matrix
Files in release
pyreqwest-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl (3.8MiB)
pyreqwest-0.13.0-cp311-cp311-macosx_11_0_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7MiB)
pyreqwest-0.13.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.3MiB)
pyreqwest-0.13.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (3.7MiB)
pyreqwest-0.13.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.6MiB)
pyreqwest-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0MiB)
pyreqwest-0.13.0-cp311-cp311-manylinux_2_28_ppc64le.whl (3.8MiB)
pyreqwest-0.13.0-cp311-cp311-musllinux_1_1_aarch64.whl (3.9MiB)
pyreqwest-0.13.0-cp311-cp311-musllinux_1_1_armv7l.whl (3.5MiB)
pyreqwest-0.13.0-cp311-cp311-musllinux_1_1_x86_64.whl (4.2MiB)
pyreqwest-0.13.0-cp311-cp311-win_amd64.whl (3.7MiB)
pyreqwest-0.13.0-cp311-cp311-win_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl (3.8MiB)
pyreqwest-0.13.0-cp312-cp312-macosx_11_0_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7MiB)
pyreqwest-0.13.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.3MiB)
pyreqwest-0.13.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (3.6MiB)
pyreqwest-0.13.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.6MiB)
pyreqwest-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0MiB)
pyreqwest-0.13.0-cp312-cp312-manylinux_2_28_ppc64le.whl (3.8MiB)
pyreqwest-0.13.0-cp312-cp312-musllinux_1_1_aarch64.whl (3.9MiB)
pyreqwest-0.13.0-cp312-cp312-musllinux_1_1_armv7l.whl (3.5MiB)
pyreqwest-0.13.0-cp312-cp312-musllinux_1_1_x86_64.whl (4.2MiB)
pyreqwest-0.13.0-cp312-cp312-win_amd64.whl (3.7MiB)
pyreqwest-0.13.0-cp312-cp312-win_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl (3.8MiB)
pyreqwest-0.13.0-cp313-cp313-macosx_11_0_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7MiB)
pyreqwest-0.13.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.3MiB)
pyreqwest-0.13.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (3.6MiB)
pyreqwest-0.13.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.6MiB)
pyreqwest-0.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0MiB)
pyreqwest-0.13.0-cp313-cp313-manylinux_2_28_ppc64le.whl (3.8MiB)
pyreqwest-0.13.0-cp313-cp313-musllinux_1_1_aarch64.whl (3.9MiB)
pyreqwest-0.13.0-cp313-cp313-musllinux_1_1_armv7l.whl (3.5MiB)
pyreqwest-0.13.0-cp313-cp313-musllinux_1_1_x86_64.whl (4.2MiB)
pyreqwest-0.13.0-cp313-cp313-win_amd64.whl (3.7MiB)
pyreqwest-0.13.0-cp313-cp313-win_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp314-cp314-macosx_10_12_x86_64.whl (3.8MiB)
pyreqwest-0.13.0-cp314-cp314-macosx_11_0_arm64.whl (3.6MiB)
pyreqwest-0.13.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7MiB)
pyreqwest-0.13.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.3MiB)
pyreqwest-0.13.0-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl (3.6MiB)
pyreqwest-0.13.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.6MiB)
pyreqwest-0.13.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0MiB)
pyreqwest-0.13.0-cp314-cp314-manylinux_2_28_ppc64le.whl (3.8MiB)
pyreqwest-0.13.0-cp314-cp314-musllinux_1_1_aarch64.whl (3.9MiB)
pyreqwest-0.13.0-cp314-cp314-musllinux_1_1_armv7l.whl (3.5MiB)
pyreqwest-0.13.0-cp314-cp314-musllinux_1_1_x86_64.whl (4.2MiB)
pyreqwest-0.13.0-cp314-cp314-win_amd64.whl (3.7MiB)
pyreqwest-0.13.0-cp314-cp314-win_arm64.whl (3.6MiB)
pyreqwest-0.13.0.tar.gz (4.4MiB)
No dependencies