Metadata-Version: 2.4
Name: easybrowser-sdk
Version: 0.1.0
Summary: EasyBrowser local API SDK
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31
Requires-Dist: loguru>=0.7
Requires-Dist: patchright
Requires-Dist: PySocks>=1.7

# EasyBrowser SDK

EasyBrowser SDK is a small Python helper for the EasyBrowser local API. It can create or reuse browser environments, start the local browser, open tabs, connect through CDP, and provide simple human-like browser actions for test scripts.

Website: https://easybrowser.pages.dev/

## Install

```bash
pip install easybrowser-sdk
```

For local development:

```bash
pip install -e .
```

## Quick Start

```python
from easybrowser_sdk import EasyBrowserAPI

api = EasyBrowserAPI()
api.ensure_local_api_available()

env = api.ensure_container(
    name="TestEnv",
    defaultUrl="https://example.com",
)
print(env["id"])
```

## Requirements

- Python 3.10+
- EasyLauncher installed and running
- Patchright browser runtime installed when CDP automation is used

```bash
patchright install chromium
```

## Publish

```bash
python -m pip install build twine
python -m build
python -m twine upload dist/*
```

Use `__token__` as the username and your PyPI API token as the password.

---

# EasyBrowser SDK 中文说明

EasyBrowser SDK 是一个用于 EasyBrowser 本地 API 的 Python 小工具。它可以创建或复用浏览器环境、启动本地浏览器、打开标签页、通过 CDP 连接浏览器，并提供简单的拟人化浏览器操作能力，方便编写测试脚本。

官网：https://easybrowser.pages.dev/

## 安装

```bash
pip install easybrowser-sdk
```

本地开发安装：

```bash
pip install -e .
```

## 快速使用

```python
from easybrowser_sdk import EasyBrowserAPI

api = EasyBrowserAPI()
api.ensure_local_api_available()

env = api.ensure_container(
    name="TestEnv",
    defaultUrl="https://example.com",
)
print(env["id"])
```

## 依赖

- Python 3.10+
- 已安装并启动 EasyLauncher
- 使用 CDP 自动化时需要安装 Patchright 浏览器运行时

```bash
patchright install chromium
```

## 发布到 PyPI

```bash
python -m pip install build twine
python -m build
python -m twine upload dist/*
```

上传时用户名填写 `__token__`，密码填写 PyPI API token。
