MCPcopy Index your code
hub / github.com/0x676e67/wreq-python

github.com/0x676e67/wreq-python @v2.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.4.2 ↗ · + Follow
390 symbols 1,102 edges 82 files 40 documented · 10% updated 8d agov0.12.0 · 2026-06-04★ 1,3937 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

rnet

CI PyPI - License Python Version from PEP 621 TOML PyPI PyPI Downloads

🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub

A blazing-fast Python HTTP client with advanced browser fingerprinting that accurately emulates Chrome, Firefox, Safari, Opera, and OkHttp, with precise TLS/HTTP2 signatures, and powered by wreq for high performance, outperforming requests, httpx, and curl_cffi (see benchmark).

Features

  • Async and Blocking Clients
  • Plain bodies, JSON, urlencoded, multipart
  • Cookie Store
  • Header Order
  • Redirect Policy
  • Rotating Proxies
  • Connection Pooling
  • Streaming Transfers
  • Zero-Copy Transfers
  • WebSocket Upgrade
  • Async DNS Resolver
  • HTTPS via BoringSSL
  • Free-Threaded Safety
  • Automatic Decompression

Example

This asynchronous example demonstrates how to make a simple GET request using the rnet library. So you need install rnet and run the following code:

pip install asyncio rnet

And then the code:

import asyncio
from rnet import Impersonate, Client


async def main():
    # Build a client
    client = Client(impersonate=Impersonate.Firefox139)

    # Use the API you're already familiar with
    resp = await client.get("https://tls.peet.ws/api/all")

    # Print the response
    print(await resp.text())


if __name__ == "__main__":
    asyncio.run(main())

Additional learning resources include:

Platforms

  1. Linux

  2. glibc >= 2.34: x86_64, aarch64, armv7, i686

  3. musl: x86_64, aarch64, armv7, i686

  4. macOS: x86_64,aarch64

  5. Windows: x86_64,i686,aarch64

Building

  1. Install environment
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install maturin
pip install uv

uv venv
source .venv/bin/activate
  1. Development
maturin develop --uv
python3 examples/client.py
  1. Compile wheels

  2. Local Compilation

Install the BoringSSL build environment by referring to boring and boringssl.

maturin build --release
  • Musllinux

Make sure the Docker environment is installed. The provided image may be outdated, so you might need to build it yourself. Refer to rust-cross-musl and the upstream rust-cross/rust-musl-cross. Note that the upstream image lacks certain platform-specific linker environment variables, which you’ll need to add manually.

bash .github/musl_build.sh x86_64-unknown-linux-musl
bash .github/musl_build.sh aarch64-unknown-linux-musl
bash .github/musl_build.sh armv7-unknown-linux-musleabihf
bash .github/musl_build.sh i686-unknown-linux-musl
  • Manylinux

For Manylinux compilation, refer to manylinux.

Impersonate

In fact, most device models share the same TLS/HTTP2 configuration, with the main difference being the User-Agent.

Browser Versions
Chrome Chrome100, Chrome101, Chrome104, Chrome105, Chrome106, Chrome107, Chrome108, Chrome109, Chrome110, Chrome114, Chrome116, Chrome117, Chrome118, Chrome119, Chrome120, Chrome123, Chrome124, Chrome126, Chrome127, Chrome128, Chrome129, Chrome130, Chrome131, Chrome132, Chrome133, Chrome134, Chrome135, Chrome136, Chrome137
Safari SafariIos17_2, SafariIos17_4_1, SafariIos16_5, Safari15_3, Safari15_5, Safari15_6_1, Safari16, Safari16_5, Safari17_0, Safari17_2_1, Safari17_4_1, Safari17_5, Safari18, SafariIPad18, Safari18_2, SafariIos18_1_1, Safari18_3, Safari18_3_1, Safari18_5
Firefox Firefox109, Firefox117, Firefox128, Firefox133, Firefox135, FirefoxPrivate135, FirefoxAndroid135, Firefox136, FirefoxPrivate136, Firefox139
OkHttp OkHttp3_9, OkHttp3_11, OkHttp3_13, OkHttp3_14, OkHttp4_9, OkHttp4_10, OkHttp4_12, OkHttp5
Edge Edge101, Edge122, Edge127, Edge131, Edge134
Opera Opera116, Opera117, Opera118, Opera119

Documentation

For a comprehensive introduction to this library, refer to the DeepWiki documentation. This AI-generated guide, created by a third party, offers a solid overview and allows interaction with the AI to explore specific APIs.

Contributing

If you would like to submit your contribution, please open a Pull Request.

Sponsors

CapSolver leverages AI-powered Auto Web Unblock to bypass Captchas effortlessly, providing fast, reliable, and cost-effective data access with seamless integration into Colly, Puppeteer, and Playwright—use code RNET for a 6% bonus!

License

rnet © 0x676e67, Released under the GPL-3.0 License.

Extension points exported contracts — how you extend this code

PyBufferProtocol (Interface)
A trait to define common buffer behavior
src/buffer.rs

Core symbols most depended-on inside this repo

get
called by 43
src/client/blocking/mod.rs
text
called by 29
benchmark/bench.py
insert
called by 18
src/client/typing/header.rs
post
called by 17
src/client/blocking/mod.rs
json
called by 16
src/client/blocking/response/http.rs
append
called by 14
src/client/typing/header.rs
into_bytes_ref
called by 11
src/buffer.rs
request
called by 11
src/client/blocking/mod.rs

Shape

Method 215
Function 132
Class 37
Enum 5
Interface 1

Languages

Rust70%
Python30%

Modules by API surface

src/client/typing/header.rs28 symbols
src/client/async_impl/response/http.rs27 symbols
src/client/blocking/response/http.rs24 symbols
src/client/async_impl/response/ws/mod.rs23 symbols
src/client/async_impl/mod.rs20 symbols
src/client/blocking/mod.rs19 symbols
src/client/typing/cookie.rs17 symbols
src/client/blocking/response/ws.rs17 symbols
src/client/async_impl/response/ws/message.rs17 symbols
benchmark/bench.py17 symbols
tests/response_test.py11 symbols
tests/request_test.py11 symbols

For agents

$ claude mcp add wreq-python \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact