mcpField
T
tushare-finance

tushare-finance

github.com/stanleychanhData & databases795.2k installsUpdated 20w ago
Repository

About tushare-finance

tushare-finance is a skill for financial data analysis that retrieves Chinese market data through the Tushare Pro API. It covers stocks, funds, macroeconomics, and other categories, with documentation pointers for finding interfaces.

Key features

  1. 01Retrieve data through the Tushare Pro API
  2. 02Cover more than 220 data interfaces
  3. 03Support stock, index, and fund data
  4. 04Provide macroeconomic and other categories
  5. 05Return results as pandas DataFrames

Use cases

  1. 01Query daily stock prices and listings
  2. 02Retrieve financial indicators and income statements
  3. 03Check fund net asset values and index prices
  4. 04Read macroeconomic data such as GDP and CPI

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/stanleychanh/tushare-finance-skill-for-claude-code --skill tushare-finance

After installing, type/tushare-financein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
metadata.json
.gitignore
LICENSE
QUICK_REFERENCE.md
.github/
SETUP.md
.github/workflows/
sync-docs.yml
sync-to-clawhub.yml
reference/
README.md
all_links.json
reference/接口文档/
ETF分钟行情.md
AH股比价.md
ETF份额规模.md
ETF日线行情.md
Hibor利率.md
ETF基准指数.md
ETF复权因子.md
ETF基本信息.md
Shibor利率.md
LPR贷款基础利率.md
ETF实时日线.md
Libor利率.md
IPO新股上市.md
上海黄金基础信息.md
上市公司管理层.md
Shibor报价数据.md
ST股票列表.md
业绩快报.md
上海黄金现货日行情.md
上市公司公告.md

Details

From the project README

Tushare 金融数据 Skill

本 skill 通过 Tushare Pro API 获取中国金融市场数据,支持 220+ 个数据接口。

快速开始

1. Token 配置

询问用户:是否已配置 Tushare Token?

如未配置,引导用户:

  1. 访问 https://tushare.pro 注册
  2. 获取 Token
  3. 配置环境变量:export TUSHARE_TOKEN="your_token"
2. 验证依赖

检查 Python 环境:

python -c "import tushare, pandas; print('OK')"

如报错,安装依赖:

pip install tushare pandas

常用接口速查

数据类型接口方法说明
股票列表pro.stock_basic()获取所有股票列表
日线行情pro.daily()获取日线行情数据
财务指标pro.fina_indicator()财务指标(ROE等)
利润表pro.income()利润表数据
指数行情pro.index_daily()指数日线数据
基金净值pro.fund_nav()基金净值数据
GDP数据pro.gdp()国内生产总值
CPI数据pro.cpi()居民消费价格指数

完整接口列表:查看 接口文档索引

数据获取流程

  1. 查找接口:根据需求在 接口索引 找到对应接口
  2. 阅读文档:查看 reference/接口文档/[接口名].md 了解参数
  3. 编写代码:
    import tushare as ts
    
    # 初始化(使用环境变量中的 Token)
    pro = ts.pro_api()
    
    # 调用接口
    df = pro.daily(ts_code='000001.SZ', start_date='20241201', end_date='20241231')
    
  4. 返回结果:DataFrame 格式

参数格式说明

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

接口文档参考

接口索引:reference/README.md

接口文档按类别组织:

  • 股票数据(39 个接口)
  • 指数数据(18 个接口)
  • 基金数据(11 个接口)
  • 期货期权(16 个接口)
  • 宏观经济(10 个接口)
  • 港股美股(23 个接口)
  • 债券数据(16 个接口)

参考资源

Comments

Markdown supported