← Back to Skills Marketplace
341
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install investment-data-1-0-0
Description
获取高质量 A 股投资数据,基于 investment_data 项目。支持日终价格、涨跌停数据、指数数据等。每日更新,多数据源交叉验证。触发词:股票数据、A股数据、金融数据、量化数据、历史行情。
README (SKILL.md)
A 股投资数据获取 Skill
基于 investment_data 项目,提供高质量 A 股投资数据。
🎯 核心功能
- 数据下载 - 自动下载最新数据集
- 数据查询 - 查询股票历史数据
- 数据更新 - 每日自动更新
- 多格式支持 - Qlib、CSV、JSON
📊 数据类型
- 日终价格 - 开高低收、成交量、成交额
- 涨跌停数据 - 涨跌停价格、涨跌停状态
- 指数数据 - 主要指数价格和权重
- 复权数据 - 前复权、后复权价格
🚀 快速开始
1. 下载最新数据
python scripts/download_data.py --latest
2. 查询股票数据
from scripts.data_client import InvestmentData
# 初始化客户端
client = InvestmentData()
# 查询单只股票
df = client.get_stock_data("000001.SZ", start_date="2024-01-01", end_date="2024-12-31")
# 查询指数成分
weights = client.get_index_weights("000300.SH")
# 查询涨跌停
limits = client.get_limit_data("000001.SZ", date="2024-12-01")
3. 批量查询
python scripts/query_batch.py --stocks "000001.SZ,000002.SZ" --start 2024-01-01 --end 2024-12-31 --output csv
📖 详细文档
🔧 配置
环境变量
# 数据存储路径(可选)
export INVESTMENT_DATA_DIR=~/.qlib/qlib_data/cn_data
# Tushare Token(可选,用于实时更新)
export TUSHARE_TOKEN=your_token_here
配置文件
编辑 config/config.yaml:
data:
# 数据存储路径
data_dir: ~/.qlib/qlib_data/cn_data
# 自动更新
auto_update: true
update_time: "09:00"
# 数据源优先级
sources:
- final
- ts
- ak
- yahoo
query:
# 默认输出格式
output_format: csv
# 日期格式
date_format: "%Y-%m-%d"
📝 使用示例
Python API
from scripts.data_client import InvestmentData
client = InvestmentData()
# 查询股票日 K 线
df = client.get_stock_daily("000001.SZ", "2024-01-01", "2024-12-31")
print(df.head())
# 查询指数数据
index_df = client.get_index_daily("000300.SH", "2024-01-01", "2024-12-31")
# 查询股票列表
stocks = client.get_stock_list(date="2024-12-31")
# 查询退市股票
delisted = client.get_delisted_stocks()
命令行
# 查询单只股票
python scripts/query.py --stock 000001.SZ --start 2024-01-01 --end 2024-12-31
# 批量查询
python scripts/query_batch.py --file stocks.txt --start 2024-01-01 --output json
# 更新数据
python scripts/update_data.py --daily
# 导出数据
python scripts/export.py --stock 000001.SZ --format excel
🔄 自动化
定时更新
使用 OpenClaw cron 自动更新:
# 每天早上 9:00 更新数据
schedule:
cron: "0 9 * * *"
task: "python scripts/update_data.py --daily"
批量处理
# 批量导出多只股票
python scripts/batch_export.py --stocks stocks.txt --output ./data/
⚠️ 注意事项
- 数据延迟:每日更新,T+1 数据
- 存储空间:需要约 5GB 存储空间
- 网络要求:需要访问 GitHub 和 DoltHub
- Tushare Token:实时更新需要 token
📊 数据质量
- ✅ 多源验证:交叉验证多个数据源
- ✅ 完整性好:包含退市公司数据
- ✅ 修正错误:自动修正数据异常
- ✅ 每日更新:自动化 CI/CD 流程
📚 相关资源
- GitHub:https://github.com/chenditc/investment_data
- DoltHub:https://www.dolthub.com/repositories/chenditc/investment_data
- 原始文档:https://github.com/chenditc/investment_data/blob/master/docs/README-ch.md
🤝 贡献
欢迎贡献代码、报告问题或提出建议!
📄 许可证
Apache 2.0
Usage Guidance
This skill appears to implement the advertised dataset/downloader functionality, but several mismatches and missing declarations mean you should be careful: 1) Verify the source repository and release assets (the package references multiple GitHub URLs and a different clone URL in README). 2) Inspect any tar.gz downloaded from GitHub before extraction (run in an isolated environment or container). 3) Be aware the skill may use an optional TUSHARE_TOKEN — only provide a token you trust and rotate it if you later stop using the skill. 4) The SKILL metadata lists wget/tar but the code uses Python requests/tarfile; ensure your environment has the expected Python setup and review requirements.txt for additional deps (pyyaml, openpyxl). 5) If you plan to enable automated updates (cron), confirm the update/download behavior and where data is stored (~/.qlib/qlib_data/cn_data) so it doesn't overwrite important files. If you want greater assurance, ask the author for the canonical source repo/verified release URL and a signed release, or run the skill in a sandbox first.
Capability Analysis
Type: OpenClaw Skill
Name: investment-data-1-0-0
Version: 1.0.0
The skill implements a mechanism to download and extract a remote tarball (`qlib_bin.tar.gz`) from a third-party GitHub repository (`github.com/chenditc/investment_data`) within `scripts/download_data.py`. It also utilizes `subprocess.run` in `scripts/data_client.py` to execute local scripts for data updates. While these actions are consistent with the tool's stated purpose of managing financial datasets, the automated fetching and extraction of external binary artifacts pose a high risk of remote code execution or supply chain compromise. No explicit malicious intent or data exfiltration logic was identified.
Capability Assessment
Purpose & Capability
Name/description, scripts and APIs all align with an investment-data skill, but the declared required binaries (wget, tar) and the SKILL metadata differ from what the code actually uses (requests and Python's tarfile). Several README links point to different GitHub repos (chenditc vs StanleyChanH) which is an incoherence in source attribution.
Instruction Scope
Runtime instructions tell the agent to download releases from GitHub and to run local scripts (download_data.py, query.py). The SKILL.md and scripts reference optional environment variables (INVESTMENT_DATA_DIR, TUSHARE_TOKEN) and external endpoints (GitHub, DoltHub) — SKILL metadata did not declare these env vars. The download script constructs a GitHub releases URL and will extract archives to the user's data directory, so users should validate the tar contents before trusting them.
Install Mechanism
There is no registry-level install spec, but SKILL.md includes a pip install step for dependencies. The SKILL.md's pip list (pandas, numpy, requests) is smaller than requirements.txt (which also lists pyyaml, openpyxl). The download mechanism fetches artifacts from GitHub releases (a common pattern) — no arbitrary IP/pastebin downloads were observed.
Credentials
The skill declares no required environment variables but the documentation and code reference INVESTMENT_DATA_DIR and an optional TUSHARE_TOKEN (a sensitive API token). TUSHARE_TOKEN is not declared as a required credential; users could inadvertently supply a token without realizing the skill will use it for network calls.
Persistence & Privilege
always is false and the skill does not request persistent platform-wide privileges. It writes data under a user data directory (~/.qlib/...) and logs to a local file — expected for a dataset tool and scoped to its own files.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install investment-data-1-0-0 - After installation, invoke the skill by name or use
/investment-data-1-0-0 - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of investment-data providing high-quality A-share investment data.
- Supports daily stock prices, limit-up/down data, index data, and ex/adjusted prices.
- Offers data querying, daily automatic updates, and multiple data formats (Qlib, CSV, JSON).
- Batch query and export functions available via both Python API and command-line tools.
- Cross-verifies data from multiple sources to ensure accuracy and completeness.
- Includes setup instructions, configuration options, and automation support for scheduled updates.
Metadata
Frequently Asked Questions
What is Investment Data 1.0.0?
获取高质量 A 股投资数据,基于 investment_data 项目。支持日终价格、涨跌停数据、指数数据等。每日更新,多数据源交叉验证。触发词:股票数据、A股数据、金融数据、量化数据、历史行情。 It is an AI Agent Skill for Claude Code / OpenClaw, with 341 downloads so far.
How do I install Investment Data 1.0.0?
Run "/install investment-data-1-0-0" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Investment Data 1.0.0 free?
Yes, Investment Data 1.0.0 is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Investment Data 1.0.0 support?
Investment Data 1.0.0 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Investment Data 1.0.0?
It is built and maintained by chan (@chayjan); the current version is v1.0.0.
More Skills