blues-lib
Python library writed by Blues Liu.
blues-lib | 版本:1.19.3
简介
blues-lib 是一个以 Web 自动化 为核心的 Python 库,提供浏览器操作(Selenium/WebDriver)、LLM 调用、数据预处理(DPP)、文件/数据库/消息等能力,并以 MCP 风格工具(ww_*)统一封装,通过 ww CLI 或 AbilityClient 执行自动化任务。
安装
pip install blues-lib
本地开发(推荐 uv):
uv sync
CLI
安装后提供 ww 与 webwork 两个全局命令:
ww -v # 查看版本
ww help # 查看可用命令
ww run -m <meta_path> [-b <bizdata_path>] # 执行 meta/task/flow
ww dash <bizdata_path> # 快速执行(读取/填充模式)
ww tool list # 列出所有 ww_* 工具及 schema
ww config / mysql / sqlite / ftp / ssh / webdriver / email / ding / llm ...
详见 readme-cli.md。
示例
from blues_lib.runner import AbilityClient
# 执行一个 ww_* 工具
result = AbilityClient.run({
"name": "ww_time",
"options": {"action": "wait", "value": 0.5, "id": "t1"},
})
# 执行任务 / 流程(meta 内 name 为 ww_task / ww_flow 自动分发)
AbilityClient.run("tests/template/write/base/fillin-article.json5")
目录结构
src/blues_lib/
├── cli/ # ww / webwork CLI(run/dash/config/... 16 个命令)
├── services/
│ ├── dpp/ # 数据预处理职责链(Read/Write/Persist)
│ ├── schema/ # 工具 schema(基于 pydantic)
│ ├── webdriver/ # WebDriver 工厂与 CFT 自动下载
│ └── llm/ # LLM 客户端
├── ability/ # 能力定义层
│ ├── base/ # WwBase(公共基类)+ AbilityScanner(发现器)
│ ├── atom/ # 原子能力(webdriver/sql/llm/file …)
│ └── composite/ # 组合能力(loop/task/flow)
├── runner/ # 执行层:AbilityClient / AbilityExecutor / Facade / context
└── types/schemas/ # 工具入参 pydantic 模型(TOOL_ADAPTERS)
测试
uv run pytest # 全部测试
uv run pytest tests/tools/ # 指定目录
uv run pytest --cov=src/blues_lib --cov-report=term-missing # 覆盖率
相关文档
readme-cli.md— CLI 使用说明CHANGELOG.md— 版本历史src/blues_lib/services/dpp/readme.md— DPP 职责链设计src/blues_lib/services/webdriver/readme.md— WebDriver 配置与自动下载src/blues_lib/ability/readme.md— 工具机制(发现/注释/Schema/测试)
Metadata
Release files for blues-lib 1.31.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| blues_lib-1.31.4.tar.gz | 1.8 MB | Without provenance | Details for blues_lib-1.31.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| blues_lib-1.31.4-py3-none-any.whl | Python 3 | none | any | Details for blues_lib-1.31.4-py3-none-any.whl |
Total release size: 4.2 MB
Release files / blues_lib-1.31.4.tar.gz
| Download URL | blues_lib-1.31.4.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0644ec60367c4752091066f5b5b3e373d578c5262862edd4d002f12f6f5ddcd
|
|
BLAKE2b-256 checksum How to use checksums |
8d6452ce1f9205d4b48c93f54ea2b02841dd8c5ed3395514dafbbe538b3b928f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / blues_lib-1.31.4-py3-none-any.whl
| Download URL | blues_lib-1.31.4-py3-none-any.whl |
|---|---|
| Size | 2.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e128239e021839b917b70d35c3892e668007be82c8a4695b47d526eb4c8ca99f
|
|
BLAKE2b-256 checksum How to use checksums |
c02f8cd3c7607ce7dfdb9355a787d8f54b5414cc702f27fe4e5620ff662778e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for blues-lib 1.31.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.