Metadata-Version: 2.4
Name: wreqx
Version: 0.13.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Requires-Dist: pytest==9.1.1 ; extra == 'bench'
Requires-Dist: ry==0.0.101 ; extra == 'bench'
Requires-Dist: pyreqwest==0.14.0 ; extra == 'bench'
Requires-Dist: httpx[http2]==0.28.1 ; extra == 'bench'
Requires-Dist: aiohttp==3.14.4 ; extra == 'bench'
Requires-Dist: niquests==3.21.2 ; extra == 'bench'
Requires-Dist: curl-cffi==0.16.3 ; extra == 'bench'
Requires-Dist: requests==2.34.2 ; extra == 'bench'
Requires-Dist: pycurl==7.48.0 ; extra == 'bench'
Requires-Dist: zensical>=0.0.67 ; extra == 'docs'
Requires-Dist: mkdocs-material>=9.7.7 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=1.0.3 ; extra == 'docs'
Requires-Dist: mike>=2.0.0 ; extra == 'docs'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-asyncio ; extra == 'test'
Requires-Dist: pytest-rerunfailures ; extra == 'test'
Provides-Extra: bench
Provides-Extra: docs
Provides-Extra: test
License-File: LICENSE
Summary: An ergonomic, privacy-aware Python HTTP Client
Keywords: http,client,websocket,ja3,ja4
Author-email: 0x676e67 <gngppz@gmail.com>
License: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/CrawlSmith/wreqx
Project-URL: Repository, https://github.com/CrawlSmith/wreqx

# wreqx

An ergonomic, high-fidelity Python HTTP/TLS client with full-stack BoringSSL, HTTP/1.1, and HTTP/2 protocol customization, built on top of the open-source [wreq](https://github.com/0x676e67/wreq) stack.

## Key Enhancements in `wreqx`

- **Complete Chrome 154 – 159 Profiles**: Built-in `Profile.Chrome154`, `Chrome155`, `Chrome156`, `Chrome157`, `Chrome158`, and `Chrome159` aligned with real Chromium TLS (`server_padding` extension `4832`, sorted Trust Anchor IDs `51764`, `X25519MLKEM768`, `mldsa44/65/87`, ALPS `17613`), HTTP/2, and per-version headers (`image/jxl`, `Accept-Language` order, `Sec-CH-UA`).
- **Session-Scoped TLS Consistency**: `Emulation(..., session_id="...", server_padding=...)` locks connection pool, TLS session cache, and real Chrome Finch `server_padding` cohort per session while isolating different sessions.
- **Chromium-Aligned HPACK Literal Policy**: Falls back to 7-bit plaintext (`H=0`) when Huffman encoding does not strictly shorten short header values (`?0`, `?1`, `1`, `*/*`, etc.).
- **Automatic Per-Request HTTP/2 Stream Priority**: Dynamically maps `Priority` / `Sec-Fetch-Dest` / `Sec-Fetch-Mode` headers to Chromium stream weights (`256 / 220 / 183 / 147 / 110 / 74 / 37 / 1`) on reused HTTP/2 connections.
- **Consistent `http2=False` Handshake Downgrade**: Narrowing ALPN to `["http/1.1"]`, stripping ALPS extensions, and isolating H1/H2 connection pools & TLS session tickets.
- **RFC 6265 `Jar.matches(url)`**: Query all effective cookies scoped to a target URL (domain/host-only, path prefix boundary, `Secure`, expiration, preserving `http_only`).

## Installation

```bash
pip install wreqx
```

## Quick Start

```python
import asyncio
import wreqx
from wreqx.cookie import Jar
from wreqx.emulation import Emulation, Platform, Profile


async def main() -> None:
    emulation = Emulation(
        profile=Profile.Chrome159,
        platform=Platform.Windows,
        session_id="session-001",
    )
    jar = Jar()
    client = wreqx.Client(emulation=emulation, cookie_provider=jar)
    resp = await client.get("https://tls.peet.ws/api/all")
    print(resp.status, resp.version)
    print(await resp.text())


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

## License

Licensed under the Apache License, Version 2.0 ([LICENSE](./LICENSE)). Derived from [0x676e67/wreq-python](https://github.com/0x676e67/wreq-python).

