StanleyChanH

Tushare Finance — Data skill for Claude Code

Data community Intermediate

Chinese financial data with Tushare API.

How to install Tushare Finance

This entry records only its repository, not the path inside it, so there is no exact command to give. Open StanleyChanH/Tushare-Finance-Skill-for-Claude-Code and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Tushare Finance does

[](https://github.com/StanleyChanH/Tushare-Finance-Skill-for-Claude-Code) [](LICENSE) [](https://clawhub.com)

Alternatives in Data

  • Financial Services — Reference agents, skills, and data connectors for the financial-services workflows we see most — investment ba 34.5k ★
  • Financial Data — 财务数据获取与交叉验证规范 15.9k ★
  • Finance Skills Pack — Financial analysis and planning skills 5.3k ★

README

Tushare Finance Skill

[](https://github.com/StanleyChanH/Tushare-Finance-Skill-for-Claude-Code) [](LICENSE) [](https://clawhub.com)

获取中国金融市场数据的 OpenClaw Skill,支持 **220+ 个 Tushare Pro 接口**。

✨ 特性

  • 🚀 开箱即用 - 一键安装,无需复杂配置
  • 📊 全面覆盖 - A股、港股、美股、基金、期货、债券
  • 🔧 多种方式 - Python API、命令行工具、批量导出
  • 📈 实时数据 - 支持股票行情、财务报表、宏观经济
  • 🔄 OpenClaw 集成 - 无缝集成到自动化工作流
  • 📖 完整文档 - 220+ 接口完整索引和使用示例

📥 安装

方法 1:通过 ClawHub(推荐)

clawhub install tushare-finance

方法 2:手动安装

git clone https://github.com/StanleyChanH/Tushare-Finance-Skill-for-Claude-Code.git
cd Tushare-Finance-Skill-for-Claude-Code
pip install -r requirements.txt

🔑 配置

获取 Tushare Token

  1. 访问 Tushare Pro 注册账号
  2. 在个人中心获取 Token
  3. 配置环境变量:
export TUSHARE_TOKEN="your_token_here"

# 或添加到 ~/.bashrc
echo 'export TUSHARE_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc

🚀 快速开始

Python API

from scripts.api_client import TushareAPI

# 初始化客户端
api = TushareAPI()

# 查询股票日线行情
df = api.get_stock_daily("000001.SZ", "2024-01-01", "2024-12-31")
print(df.head())

# 查询公司基本信息
info = api.get_stock_info("000001.SZ")
print(info)

# 批量查询多只股票
stocks = ["000001.SZ", "000002.SZ", "600000.SH"]
data = api.batch_query(stocks, "2024-01-01", "2024-12-31")

命令行工具

# 查询单只股票
python scripts/quick_query.py --stock 000001.SZ --start 2024-01-01 --end 2024-12-31

# 批量查询
python scripts/quick_query.py --file stocks.txt --start 2024-01-01 --output result.csv

# 导出 Excel
python scripts/batch_export.py --stock 000001.SZ --start 2024-01-01 --end 2024-12-31 --format excel

📊 支持的数据类型

股票数据(39 个接口)

接口 说明 示例
daily 日线行情 api.get_stock_daily()
stock_basic 股票列表 api.get_stock_list()
fina_indicator 财务指标 api.get_financial_indicator()
income 利润表 api.get_income_statement()
balancesheet 资产负债表 api.get_balance_sheet()

指数数据(18 个接口)

...