Skip to main content

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   # 覆盖率

相关文档

Metadata

Release files for blues-lib 1.31.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blues-lib 1.31.5
File Size Uploaded Provenance Actions
blues_lib-1.31.5.tar.gz 1.9 MB Without provenance Details for blues_lib-1.31.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for blues-lib 1.31.5
File Interpreter ABI Platform Actions
blues_lib-1.31.5-py3-none-any.whl Python 3 none any Details for blues_lib-1.31.5-py3-none-any.whl

Total release size: 4.3 MB

Release files / blues_lib-1.31.5.tar.gz

Download URL blues_lib-1.31.5.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
d49d44bc80683fc27217015b63e6566989de3c9bb716bfa4b833fafb79e2e474
BLAKE2b-256 checksum
How to use checksums
e98f6981bfd3791726ae1a7d666d126bf1920d24ad022043150811edd7e682a6
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.5-py3-none-any.whl

Download URL blues_lib-1.31.5-py3-none-any.whl
Size 2.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ea24d7f0a13dda8d1c629574df404a5994731ebb4606ca377b98595eb2f2256f
BLAKE2b-256 checksum
How to use checksums
b4387a1f528c35ede02d01520a9d34497e3b70c8caad64f51b802fa9e6f94dd9
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.5

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.

Release history Release notifications | RSS feed

This release

1.31.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page