Metadata-Version: 2.4
Name: chromint
Version: 0.3.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
License-File: LICENSE-MIT
License-File: LICENSE-APACHE
License-File: NOTICE
License-File: THIRD_PARTY_LICENSES.md
License-File: crates/browser/LICENSE
Summary: One Chrome identity for a stealth browser and a Chrome-accurate HTTP client: mint in the browser, replay over HTTP with the same TLS, HTTP/2 and headers.
Keywords: chrome,scraping,http,tls,fingerprint,browser-automation
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://gitlab.com/0xlearner-group/chromint

# chromint

One Chrome identity for a stealth browser and a Chrome-accurate HTTP client.

The browser does the expensive work once (cookies, tokens, a real request); the HTTP
client then replays it with the same Chrome on the wire: TLS ClientHello, HTTP/2
settings and priorities, header values and order, User-Agent and client hints. Both
halves also work on their own.

```python
from chromint.http import Client

async with Client(chrome="latest", os="windows") as client:
    page = await client.get("https://example.com/")
    api = await client.get(
        "https://example.com/api/items",
        kind="fetch",
        headers={"referer": "https://example.com/"},
    )
    print(api.status, api.json())
```

```python
from chromint.browser import Browser

async with Browser.launch(native_identity=True, headless=False) as browser:
    page = await browser.new_page("https://example.com/")
    print(await page.title())
```

Blocking code uses `SyncClient`, `SyncBrowser` and `SyncPage` with the same methods.

- **Identity.** `Identity.chrome(154, "windows")` computes the reduced User-Agent,
  `Sec-CH-UA` (Chromium's GREASE algorithm), client hints and header templates. No
  hand-copied strings.
- **Verified by capture.** A Chrome version counts as supported on an OS only when a
  capture of real Chrome matches the client field for field (JA4 and every TLS
  extension, HTTP/2 frames, header order). `Identity.is_verified` tells you;
  `Client(strict=True)` refuses anything else.
- **Wheels** for Linux, macOS and Windows, Python 3.11+. Chrome is not bundled:
  `chromint.browser` uses the installed Chrome.

`python -m chromint doctor` reports the local Chrome, its verified status and the
TLS/HTTP2 preset in use.

License: MIT OR Apache-2.0. The browser driver is based on
[eoka](https://github.com/shrimp-software/eoka) (MIT); Chrome TLS/HTTP2 presets are
ported from [wreq-util](https://github.com/0x676e67/wreq-util) (Apache-2.0).

