Skip to main content
ClaudeWave
Skill12k estrellas del repoactualizado today

tushare

Tushare is a financial data interface package that provides standardized API access to market data including stocks, funds, futures, and cryptocurrencies, along with fundamental data such as company financials and fund manager information. Use this skill when building trading systems or financial analysis applications that require real-time or historical market data from Chinese exchanges and need unified data access through Python.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/tushare && cp -r /tmp/tushare/agent/src/skills/tushare ~/.claude/skills/tushare
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Tushare

## 概述

tushare是一个财经数据接口包,拥有丰富的数据内容,如股票、基金、期货、数字货币等行情数据,公司财务、基金经理等基本面数据。该模块通过标准化API方式统一了数据资产的对外服务方式,以帮助有需要的技术用户更实时、简洁、轻量的使用相关数据。

## 快速上手

- 安装python运行环境(推荐python3.7+),并安装tushare依赖包(推荐从清华pypi镜像安装)。

```bash
pip install tushare -i https://pypi.tuna.tsinghua.edu.cn/simple
```

- Tushare官网注册,获取token,并配置环境变量。 [注册地址](https://tushare.pro/register)

```bash
export TUSHARE_TOKEN=your_token
```

- 查询Tushare接口文档,找到对应的接口。 [在线数据接口文档](https://tushare.pro/document/2)
- 根据接口文档,使用python代码获取数据。(如**股票列表**接口)

```python
import os
import tushare as ts

# 读取环境变量中的token, 或者读取本地记录的token
token = os.getenv('TUSHARE_TOKEN') or ts.get_token()

# 初始化pro接口实例
pro = ts.pro_api(token)

# 查询数据接口(*股票列表*),获取上市交易的股票列表
df = pro.stock_basic(list_status='L', fields='ts_code,symbol,name,area,industry,list_date')
print(df)
```

## 参数格式说明

- 日期:YYYYMMDD(如 20241231)
- 股票代码:ts_code 格式(如 000001.SZ, 600000.SH)
- 返回格式:pandas DataFrame

## python脚本示例

- [股票数据获取示例](scripts/stock_data_example.py)
- [基金数据获取示例](scripts/fund_data_example.py)

## 数据接口列表


|  ID | 接口名             | 标题(详细文档)                                                                                           | 分类                              | 描述                                                                                                                                                                                                                                                                                                                 |
| ----: | :------------------- | :--------------------------------------------------------------------------------------------------------- | :---------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 416 | rt_min             | [ETF实时分钟](references/ETF专题/ETF实时分钟.md)                                                         | ETF专题                           | 获取ETF实时分钟数据,包括1~60min                                                                                                                                                                                                                                                                                     |
| 400 | rt_etf_k           | [ETF实时日线](references/ETF专题/ETF实时日线.md)                                                         | ETF专题                           | 获取ETF实时日k线行情,支持按ETF代码或代码通配符一次性提取全部ETF实时日k线行情                                                                                                                                                                                                                                        |
| 387 | stk_mins           | [ETF历史分钟](references/ETF专题/ETF历史分钟.md)                                                         | ETF专题                           | 获取ETF分钟数据,支持1min/5min/15min/30min/60min行情,提供Python SDK和 http Restful API两种方式                                                                                                                                                                                                                      |
| 386 | etf_index          | [ETF基准指数](references/ETF专题/ETF基准指数.md)                                                         | ETF专题                           | 获取ETF基准指数列表信息                                                                                                                                                                                                                                                                                              |
| 385 | etf_basic          | [ETF基本信息](references/ETF专题/ETF基本信息.md)                                                         | ETF专题                           | 获取国内ETF基础信息,包括了QDII。数据来源与沪深交易所公开披露信息。                                                                                                                                                                                                                                                  |
| 199 | fund_adj           | [ETF复权因子](references/ETF专题/ETF复权因子.md)                                                         | ETF专题                           | 获取基金复权因子,用于计算基金复权行情                                                                                                                                                                                                                                                                               |
| 127 | fund_daily         | [ETF日线行情](references/ETF专题/ETF日线行情.md)                                                         | ETF专题                           | 获取ETF行情每日收盘后成交数据,历史超过10年                                                                                                                                                                                                                                                                          |
| 408 | etf_share_size     | [ETF份额规模](references/ETF专题/ETF份额规模.md)                                                         | ETF专题                           | 获取沪深ETF每日份额和规模数据,能体现规模份额的变化,掌握ETF资金动向,同时提供每日净值和收盘价;数据指标是分批入库,建议在每日19点后提取;另外,涉及海外的ETF数据更新会晚一些属于正常情况。                                                                                                                          |
| 322 | bc_otcqt           | [柜台流通式债券报价](references/债券专题/柜台流通式债券报价.md)                                          | 债券专题                          | 柜台流通式债券报价                                                                                                                                                                                                                                                                                                   |
| 305 | cb_rate
vibe-tradingSkill

Professional finance research toolkit — backtesting (7 engines + benchmark comparison panel), factor analysis, Alpha Zoo (452 pre-built alphas across qlib158/alpha101/gtja191/academic), options pricing, 77 finance skills, 29 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 7 data sources (tushare, yfinance, okx, akshare, mootdx, ccxt, futu).

adr-hshareSkill

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

akshareSkill

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

alpha-zooSkill

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

ashare-pre-st-filterSkill

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

asset-allocationSkill

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 4 optimizers and rebalancing rules.

backtest-diagnoseSkill

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

behavioral-financeSkill

Behavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies.