Metadata-Version: 2.4
Name: pybrws
Version: 0.1.1
Summary: An HTTPS client that sends what Firefox 157 and Chrome 155 send over TLS and HTTP/2, and what Firefox 157 sends over HTTP/3
Author: Ernesto
License-Expression: MIT
Project-URL: Homepage, https://github.com/epcosta17/pybrws
Project-URL: Documentation, https://pybrws.readthedocs.io/
Project-URL: Source, https://github.com/epcosta17/pybrws
Project-URL: Issues, https://github.com/epcosta17/pybrws/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=50
Requires-Dist: hpack
Requires-Dist: brotli
Requires-Dist: publicsuffixlist
Requires-Dist: idna
Requires-Dist: certifi
Requires-Dist: zstandard; python_version < "3.14"
Provides-Extra: client
Provides-Extra: zstd
Provides-Extra: http3
Requires-Dist: aioquic<2,>=1.3; extra == "http3"
Provides-Extra: measure
Requires-Dist: httpx[http2]<1,>=0.28; extra == "measure"
Provides-Extra: docs
Requires-Dist: zensical<0.2,>=0.1.1; extra == "docs"
Requires-Dist: mkdocstrings-python; extra == "docs"
Provides-Extra: dev
Requires-Dist: aioquic<2,>=1.3; extra == "dev"
Requires-Dist: httpx[http2]<1,>=0.28; extra == "dev"
Dynamic: license-file

# pybrws

Python + browser: an HTTPS client that sends what a real browser sends

pybrws is written from scratch in Python. It sends what Firefox 157 and Chrome 155 send on the wire: the TLS ClientHello, the HTTP/2 start and the headers. It also sends Firefox's QUIC hello over HTTP/3. It is a learning and measurement tool that you can install, and it began as a way to see how browsers look on the wire.

It is not a replacement for [curl_cffi](https://pypi.org/project/curl-cffi/). For production use, use curl_cffi. pybrws makes no promise that any site will accept its requests.

## Install

```
pip install pybrws
```

Python 3.11 or newer. Two optional extras:

- `pip install "pybrws[http3]"` adds aioquic, for HTTP/3.
- `pip install "pybrws[measure]"` adds httpx, for the A/B controls of `pybrws ab`.

## Use it from Python

```python
from pybrws.client import get
from pybrws.profiles import chrome155

response = get("https://example.com/", profile=chrome155)
print(response.status, response.header("content-type"))
print(response.text()[:200])
```

The default profile is `firefox157`. `post` and `request` work the same way. HTTP/3 is `pybrws.h3.get(url)`, Firefox only.

## Use it from the command line

```
pybrws https://example.com/
pybrws verify --local
```

The first fetches a page like curl. The second compares the default profile's ClientHello with the browser capture shipped in the package, offline, and prints "same string as the capture". Other subcommands: `capture`, `read-quic`, `ja4`, `verify`, `probe`, `ab`, `isolate`, `waf`.

## More

- Documentation: https://pybrws.readthedocs.io/
- Source: https://github.com/epcosta17/pybrws
- Licence: [MIT](https://github.com/epcosta17/pybrws/blob/master/LICENSE)
