← Back to Skills Marketplace
ugpoor

Dolphindb Init

by superStupidBear · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
169
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install dolphindb-init
Description
DolphinDB Python 环境初始化技能。自动检测并切换到已安装 DolphinDB SDK 的 Python 环境(含 Anaconda/Miniconda/系统 Python),若未找到则自动安装。**这是 DolphinDB 套件的前置依赖,所有 DolphinDB 相关操作必须首先执行此技能**。
README (SKILL.md)

DolphinDB 初始化技能

🎯 套件角色

这是 DolphinDB Skill 套件的前置依赖技能。

所有 DolphinDB 相关技能在执行前都必须先调用此技能:

任何 DolphinDB 请求
    ↓
[必须] dolphindb-init ← 你在这里
    ↓
环境检测 ✓
    ↓
调用功能技能
    ├─ dolphindb-core(连接、读写)
    └─ dolphindb-query(查询、分析)

触发条件

任何时候 用户提到 DolphinDB 并需要操作:

  • "连接 DolphinDB"
  • "查询 DolphinDB 数据"
  • "在 DolphinDB 中建表"
  • "DolphinDB 性能分析"
  • 任何 DolphinDB Python SDK 相关操作

核心流程

1. 环境检测(必须第一步)

# 加载环境检测器
source ~/.openclaw/skills/dolphindb-init/scripts/load_dolphindb_env.sh

# 查看环境信息
dolphin_env_info

# 使用统一的 Python 调用函数
dolphin_python your_script.py

2. 检测逻辑

检测脚本按以下顺序扫描:

  1. conda 环境列表 → 检查每个环境的 pip list,查找 dolphindb
  2. Anaconda/Miniconda 路径 → 检查 $CONDA_BASE_1, $CONDA_BASE_2
  3. 系统 Python 环境 → 检查 $SYS_PYTHON_1, $SYS_PYTHON_2
  4. 决策
    • 找到已安装 → 导出环境变量 DOLPHINDB_PYTHON_BIN
    • 未找到 → 自动安装到 Python 3.13 环境

3. 环境变量

加载后可用的环境变量:

$DOLPHINDB_PYTHON_BIN    # Python 二进制路径(统一调用入口)
$DOLPHINDB_SDK_VERSION   # DolphinDB SDK 版本
$DOLPHINDB_PYTHON_VER    # Python 版本
$DOLPHINDB_ENV_PATH      # 环境路径

4. 统一调用方式

# 运行 Python 脚本
dolphin_python script.py

# 安装包
dolphin_pip install package_name

# 直接使用环境变量
$DOLPHINDB_PYTHON_BIN script.py

示例:DolphinDB 连接

import dolphindb as ddb

# 创建连接
s = ddb.session()
s.connect("localhost", 8848, "admin", "password")

# 执行查询
result = s.run("select * from trade where date=2024.01.01")
print(result)

# 关闭连接
s.close()

使用加载器运行:

source ~/.openclaw/skills/dolphindb-init/scripts/load_dolphindb_env.sh
dolphin_python connect_dolphindb.py

隐私保护

所有路径都用变量符号表示,不暴露具体系统地址:

变量名 含义
$CONDA_BASE_1 第一个 anaconda/miniconda 路径
$CONDA_BASE_2 第二个 anaconda/miniconda 路径
$SYS_PYTHON_1 第一个系统 Python 路径
$PY13_CANDIDATE_1 Python 3.13 候选路径

故障排除

问题 1: 找不到环境

# 手动运行检测脚本查看详细信息
bash ~/.openclaw/skills/dolphindb-init/scripts/detect_dolphindb_env.sh

问题 2: SDK 版本不兼容

dolphin_pip uninstall dolphindb
dolphin_pip install dolphindb==3.0.4.2

问题 3: Python 版本不是 3.13

# 检查当前环境
dolphin_env_info

# 强制安装到特定路径
~/anaconda3/bin/python -m pip install dolphindb

相关文件

  • scripts/detect_dolphindb_env.sh - 核心检测脚本,输出可 eval 的 export
  • scripts/load_dolphindb_env.sh - 环境加载器,提供统一调用函数
  • scripts/find_dolphindb_env.sh - 详细检测脚本(带完整输出)

套件关系

  • 本技能 - dolphindb-init(环境初始化,前置依赖)
  • 核心操作 - dolphindb-core(连接、表操作、数据读写)
  • 高级查询 - dolphindb-query(聚合、时间序列、数据分析)

注意事项

  1. 必须优先检测 - 不要假设 Python 环境已就绪
  2. 使用统一接口 - 始终通过 dolphin_python$DOLPHINDB_PYTHON_BIN 调用
  3. 版本兼容 - 优先使用 Python 3.13 环境
  4. 环境隔离 - 不同终端可能使用不同环境,必须每次检测
  5. 套件前置 - 所有 DolphinDB 技能依赖此技能,必须首先执行
Usage Guidance
This skill appears to do what it says: detect a Python environment with dolphindb and provide wrapper functions. Before running it: (1) inspect the included scripts yourself (they are small and human-readable); (2) be aware that if no existing SDK is found the skill will run pip install dolphindb (network download, environment change) — consider running in a virtualenv or container if you want isolation; (3) note the loader uses eval of the detector's output to export variables — ensure the files come from a trusted source and have not been tampered with; (4) if you prefer explicit consent, modify scripts to prompt before installing or to print the install command instead of running it automatically.
Capability Analysis
Type: OpenClaw Skill Name: dolphindb-init Version: 1.0.0 The skill bundle is designed to automate the initialization of a Python environment for the DolphinDB SDK. It scans for existing Conda or system Python environments containing the 'dolphindb' package and installs it via pip if not found (scripts/detect_dolphindb_env.sh). While it uses 'eval' to load environment variables in scripts/load_dolphindb_env.sh, this is a standard pattern for shell-based environment managers and is used here solely to set up the execution context for subsequent DolphinDB operations without any evidence of malicious intent, data exfiltration, or unauthorized access.
Capability Assessment
Purpose & Capability
Name/description match the actual files and behavior: the scripts search Conda and system Python installations for a dolphindb package, export a unified Python binary variable, and provide wrapper functions. Nothing requested or coded is unrelated to environment initialization.
Instruction Scope
SKILL.md and scripts stay within environment detection/setup. Two items to be aware of: (1) detect_dolphindb_env.sh emits export statements that load_dolphindb_env.sh evals — eval is used only to set environment variables generated by the included script, but evaluating generated shell output is a point where a tampered script could inject commands; (2) when no existing SDK is found the scripts run pip install dolphindb at runtime (quietly), which modifies the user's Python environment and downloads packages from PyPI.
Install Mechanism
There is no separate install spec in the registry (instruction-only), but the runtime behavior includes invoking pip to fetch and install the dolphindb package from the network. This is an expected mechanism for installing the SDK, but it will perform network downloads and modify the environment when executed.
Credentials
The skill requests no credentials, no config paths, and the environment variables it sets (DOLPHINDB_PYTHON_BIN, DOLPHINDB_SDK_VERSION, etc.) are appropriate for the stated purpose. The number and type of env vars are proportionate.
Persistence & Privilege
The skill is not forced-always, does not modify other skills, and does not request elevated privileges. It modifies the local Python environment only when it runs pip install (standard for package setup).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dolphindb-init
  3. After installation, invoke the skill by name or use /dolphindb-init
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
dolphindb-init 1.0.0 - 首次发布 DolphinDB Python 环境初始化技能。 - 自动检测并切换到已安装 DolphinDB SDK 的 Python 环境(支持 Anaconda/Miniconda/系统 Python),若未找到则自动安装。 - 提供统一的调用接口(如 dolphin_python、dolphin_pip),导出标准环境变量。 - 明确作为 DolphinDB 技能套件的前置依赖,所有 DolphinDB 操作需首先执行本技能。 - 包含环境检测、变量管理、故障排查指引等详细说明。
Metadata
Slug dolphindb-init
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Dolphindb Init?

DolphinDB Python 环境初始化技能。自动检测并切换到已安装 DolphinDB SDK 的 Python 环境(含 Anaconda/Miniconda/系统 Python),若未找到则自动安装。**这是 DolphinDB 套件的前置依赖,所有 DolphinDB 相关操作必须首先执行此技能**。 It is an AI Agent Skill for Claude Code / OpenClaw, with 169 downloads so far.

How do I install Dolphindb Init?

Run "/install dolphindb-init" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Dolphindb Init free?

Yes, Dolphindb Init is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Dolphindb Init support?

Dolphindb Init is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Dolphindb Init?

It is built and maintained by superStupidBear (@ugpoor); the current version is v1.0.0.

💬 Comments