Metadata-Version: 2.4
Name: pyagentbrowser
Version: 0.31.1rc2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
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
Classifier: Programming Language :: Rust
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
Classifier: Typing :: Typed
Requires-Dist: websockets>=15.0 ; extra == 'cdp'
Requires-Dist: pillow>=12.0 ; extra == 'images'
Provides-Extra: cdp
Provides-Extra: images
License-File: LICENSE
License-File: NOTICE
Summary: Python SDK for controlling the native agent-browser engine in-process
Keywords: agent-browser,browser automation,evidence,refs,snapshots
Author-email: Péter Ferenc Gyarmati <dev.petergy@gmail.com>
License-Expression: Apache-2.0
Requires-Python: >=3.11, <3.15
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/peter-gy/pyagentbrowser#readme
Project-URL: Homepage, https://github.com/peter-gy/pyagentbrowser
Project-URL: Issues, https://github.com/peter-gy/pyagentbrowser/issues
Project-URL: Repository, https://github.com/peter-gy/pyagentbrowser
Project-URL: Upstream agent-browser commit, https://github.com/vercel-labs/agent-browser/commit/ed2e105
Project-URL: agent-browser CDP mode, https://agent-browser.dev/cdp-mode
Project-URL: agent-browser commands, https://agent-browser.dev/commands
Project-URL: agent-browser docs, https://agent-browser.dev/

# pyagentbrowser

[![PyPI](https://img.shields.io/pypi/v/pyagentbrowser.svg?label=pip&logo=PyPI&logoColor=white)](https://pypi.org/project/pyagentbrowser/)
[![Release Check](https://github.com/peter-gy/pyagentbrowser/actions/workflows/check-release.yml/badge.svg)](https://github.com/peter-gy/pyagentbrowser/actions/workflows/check-release.yml)
[![License](https://img.shields.io/github/license/peter-gy/pyagentbrowser)](LICENSE)

Python SDK for the native Rust [`agent-browser`](https://github.com/vercel-labs/agent-browser) engine.

Use it to launch Chrome, inspect pages, act on snapshot refs, capture artifacts, and call Chrome DevTools Protocol from Python.

```bash
uv add pyagentbrowser
# or
python -m pip install pyagentbrowser
```

```python
import agentbrowser as ab

browser = ab.configure()
browser.page.open("https://github.com/peter-gy/pyagentbrowser")
browser.capture.screenshot(full_page=True)
```

Local Chrome launches use an installed Chrome or Chromium executable. When none is found, pyagentbrowser prepares Chrome for Testing through the bundled native installer.

## API

- `browser.page`: navigation, content, waits, and readable page extraction
- `browser.agent`: accessibility snapshots with action-ready refs
- `browser.find`: CSS, XPath, text, role, label, and test-id locators
- `browser.capture`: screenshots, PDFs, and action evidence
- `browser.tabs`: tab creation, listing, and switching
- `browser.network`: request logs, routing, HAR, and proxy credentials
- `browser.cdp`: frames, targets, execution contexts, and raw CDP calls

`AsyncBrowser` mirrors the same surface with awaitable methods.

## Extras

```bash
python -m pip install "pyagentbrowser[images]"
python -m pip install "pyagentbrowser[cdp]"
```

- `images` adds Pillow helpers for screenshot objects.
- `cdp` adds WebSocket-backed frame, target, and execution-context evaluation.

## Links

- [Install](docs/install.md)
- [Quickstart](docs/quickstart.md)
- [API reference](docs/api-reference.md)
- [Examples](examples/)
- [agent-browser docs](https://agent-browser.dev/)

## Development

```bash
make install
make check
```

Use `make package` for wheel and sdist smoke checks.

## License

Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).

