Metadata-Version: 2.4
Name: specters
Version: 2.0.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-asyncio ; extra == 'dev'
Requires-Dist: maturin ; extra == 'dev'
Provides-Extra: dev
Summary: Python bindings for Specter HTTP client with TLS/HTTP2/HTTP3 fingerprint control
Keywords: http,http3,fingerprint,tls,client,async
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# Specter

Python bindings for the Specter HTTP client - an HTTP client that accurately replicates Chrome's TLS and HTTP/2 behavior.

## Installation

```bash
pip install specters
```

## Features

- HTTP/1.1, HTTP/2, and HTTP/3 support
- Chrome 142 TLS fingerprint (BoringSSL)
- Chrome HTTP/2 fingerprint (SETTINGS, pseudo-header order, GREASE)
- Async/await interface
- Cookie jar with Netscape format support

## Usage

```python
import asyncio
from specter import Client, FingerprintProfile

async def main():
    client = Client(fingerprint=FingerprintProfile.Chrome142)

    response = await client.get("https://example.com")
    print(f"Status: {response.status}")
    print(f"Body: {response.text()}")

asyncio.run(main())
```

### Force HTTP version

```python
from specter import HttpVersion

# HTTP/2 only
response = await client.get(url, version=HttpVersion.Http2)

# HTTP/3 with fallback
response = await client.get(url, version=HttpVersion.Http3)
```

### Custom headers and cookies

```python
from specter import CookieJar

jar = CookieJar()
await jar.load_from_file("cookies.txt")

response = await client.get(url, cookies=jar)
jar.store_from_headers(response.headers, url)

await jar.save_to_file("cookies.txt")
```

## Validation

Specter fingerprints are validated against:
- ScrapFly (tools.scrapfly.io)
- Browserleaks (tls.browserleaks.com)
- tls.peet.ws
- Cloudflare

## License

MIT

