Skip to content

Commit de2c62a

Browse files
committed
docs: 更新 README 和 pyproject.toml,补充安装/特性说明
- 添加 PyPI 徽章和 pip install 安装说明 - 补充 Demo 菜单选项 7(更新动态库)和记住环境 ID 说明 - 修正 pyproject.toml build-backend 为 setuptools.build_meta - Homepage 改为 https://www.brosdk.com/
1 parent 71e22f5 commit de2c62a

2 files changed

Lines changed: 43 additions & 7 deletions

File tree

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
# brosdk-sdk-python
22

3+
[![PyPI version](https://img.shields.io/pypi/v/brosdk-sdk)](https://pypi.org/project/brosdk-sdk/)
4+
[![Python 3.8+](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
5+
36
Python 语言绑定库 + 交互式命令行 Demo。
47

58
通过 `ctypes` 动态加载平台 DLL/dylib,暴露安全、符合 Python 惯用法的 API。
69

10+
## 安装
11+
12+
```bash
13+
# 从 PyPI 安装(推荐)
14+
pip install brosdk-sdk
15+
16+
# 从源码安装
17+
git clone https://github.com/browsersdk/brosdk-sdk-python.git
18+
cd brosdk-sdk-python
19+
pip install .
20+
```
21+
722
## 项目结构
823

924
```
@@ -12,7 +27,8 @@ brosdk-sdk-python/
1227
│ ├── __init__.py # 公共 API 导出
1328
│ ├── ffi.py # 原始 C ctypes 绑定
1429
│ ├── manager.py # 高级安全封装 + 事件回调
15-
│ └── api.py # REST API 客户端
30+
│ ├── api.py # REST API 客户端
31+
│ └── console.py # Windows DLL 控制台输出修复
1632
├── libs/
1733
│ ├── brosdk.dll # Windows x64 原生库
1834
│ └── brosdk.dylib # macOS arm64 原生库
@@ -58,11 +74,15 @@ python demo.py --verbose
5874

5975
### Demo 使用流程
6076

61-
1. **选择 `1`** → 输入 API Key → 自动获取 userSig → 初始化 SDK
77+
1. **选择 `1`** → 输入 API Key → 自动获取 userSig → 初始化 SDK(API Key 会自动记住)
6278
2. **选择 `2`** → 查看环境列表(SDK 接口或 REST API)
6379
3. **选择 `3`** → 选择内核版本(可选代理)→ 创建新环境
64-
4. **选择 `4`** → 启动浏览器环境(异步,等待 SDK 事件回调
80+
4. **选择 `4`** → 启动浏览器环境(有记住的环境 ID 时会询问是否复用
6581
5. **选择 `5`** → 关闭浏览器环境
82+
6. **选择 `6`** → 查看 SDK 信息
83+
7. **选择 `7`** → 更新动态库(从 GitHub Releases 自动下载)
84+
85+
> Demo 会自动记住最后一次使用的环境 ID 和 API Key,下次启动无需重复输入。
6686
6787
## 库使用方式
6888

@@ -200,8 +220,18 @@ pytest
200220

201221
# 构建发布包
202222
python -m build
223+
224+
# 上传到 PyPI
225+
twine upload dist/*
203226
```
204227

228+
## 特性
229+
230+
- **记住环境**:自动保存最后一次使用的环境 ID 和 API Key(`~/.brosdk-demo.json`
231+
- **动态库更新**:一键从 GitHub Releases 下载并安装最新版本动态库
232+
- **跨平台**:支持 Windows(x64)、macOS(arm64)、Linux(x64)
233+
- **零强制依赖**:核心库无第三方依赖,requests/colorama 为可选增强
234+
205235
## 协议
206236

207237
MIT

pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = ["setuptools>=61", "wheel"]
3-
build-backend = "setuptools.backends.legacy:build"
3+
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "brosdk-sdk"
@@ -9,6 +9,9 @@ description = "Python bindings for the Brosdk Browser SDK"
99
readme = "README.md"
1010
requires-python = ">=3.8"
1111
license = { text = "MIT" }
12+
authors = [
13+
{ name = "browsersdk" },
14+
]
1215
keywords = ["browser", "sdk", "automation", "fingerprint"]
1316
classifiers = [
1417
"Development Status :: 4 - Beta",
@@ -25,9 +28,12 @@ classifiers = [
2528
"Topic :: Software Development :: Libraries",
2629
]
2730

28-
dependencies = [
29-
# requests 是可选依赖(REST API 客户端会自动降级到 urllib)
30-
]
31+
dependencies = []
32+
33+
[project.urls]
34+
Homepage = "https://www.brosdk.com/"
35+
Repository = "https://github.com/browsersdk/brosdk-sdk-python"
36+
Changelog = "https://github.com/browsersdk/brosdk-sdk/releases"
3137

3238
[project.optional-dependencies]
3339
requests = ["requests>=2.28.0"]

0 commit comments

Comments
 (0)