Metadata-Version: 2.4
Name: cloudtab
Version: 0.1.4
Summary: Signed Selenium and Playwright connectors for remotely hosted browser sessions
License-Expression: MIT
Keywords: selenium,playwright,webdriver,remote-browser,hmac
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: selenium<5,>=4.18
Requires-Dist: playwright<2,>=1.55
Dynamic: license-file

# CloudTab Python SDK

Python connectors for HMAC-signed remote Selenium and Playwright sessions.

## Install

Install from PyPI:

```powershell
python -m pip install cloudtab
```

For local development, install this source directory:

```powershell
python -m pip install .
```

## Use

```python
import os
from cloudtab.selenium import connect

driver = connect(
    os.environ["CLOUDTAB_BASE_URL"],
    os.environ["CLOUDTAB_API_KEY"],
    os.environ["CLOUDTAB_SESSION_ID"],
)

try:
    driver.get("https://example.com")
finally:
    driver.quit()
```

Recommended `.env` values:

```dotenv
CLOUDTAB_BASE_URL=https://api.solbounty.fun
CLOUDTAB_API_KEY=replace-with-account-bearer-token
CLOUDTAB_SESSION_ID=replace-with-session-id
```

The same bearer token can select any session owned by that CloudTab account;
the session ID chooses which saved browser profile to open. Never commit bearer
tokens or session IDs to source control.

## Playwright

Playwright is included with the normal `cloudtab` installation.

```python
import os
from cloudtab.playwright import connect

with connect(
    os.environ["CLOUDTAB_BASE_URL"],
    os.environ["CLOUDTAB_API_KEY"],
    os.environ["CLOUDTAB_SESSION_ID"],
) as session:
    page = session.browser.contexts[0].pages[0]
    page.goto("https://example.com")
    print(page.title())
```

This uses an authenticated, one-time CDP bridge. Closing the context manager
detaches Playwright and closes the remote browser session.

## One SDK, two automation engines

`cloudtab` is one package. Choose the engine through its module:

```python
from cloudtab import connect_selenium, connect_playwright
```
