Tushare logo

Tushare

Organization
lzwme
tushare

Tushare 专业金融数据平台,提供A股行情、历史K线、财务数据、宏观数据、指数数据等,覆盖全面、数据质量高。当用户提及 Tushare、获取A股数据、查询财务报表、下载宏观数据,或需要高质量、多维度金融数据时使用。与 baostock(免费但功能有限)和 jqdatasdk(需注册但有积分门槛)不同,tushare 数据最全但需注册获取 Token。免费替代方案可用 baostock 或 akshare。

Overview

Publisherlzwme
Repositoryfinance-quant-skills
Skill nametushare
Stars
461
Forks
85
Bundled files
6
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lzwme on GitHub. Read the source before you install it.

Installation

Install the Tushare AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lzwme/finance-quant-skills/tree/main/skills/tushare
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lzwme/finance-quant-skills.git /tmp/finance-quant-skills
mkdir -p .claude/skills
cp -r /tmp/finance-quant-skills/skills/tushare .claude/skills/tushare
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tushare in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Tushare on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Tushare is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Tushare 数据获取

任务目标

  • 本 Skill 用于:通过 Tushare 数据接口获取 A 股市场数据、财务指标和宏观数据
  • 能力包含:实时行情、历史K线、财务数据、指标数据、股票信息、宏观数据、指数数据
  • 触发条件:用户提及 Tushare 或需要获取 A 股数据、财务信息、宏观数据时

前置准备

  • 依赖说明:安装 tushare 库(已包含在 dependency 中)
  • 凭证配置:需配置 Tushare Token(凭证名: TUSHARE_TOKEN,环境变量: TUSHARE_TOKEN)
  • 账号申请:访问 https://tushare.pro/ 注册账号并获取 API Token(详见 references/tushare_quickstart.md)

操作步骤

  • 标准流程:
    1. 确定数据需求 — 智能体理解用户意图(行情/K线/财务/宏观/指数等)
    2. 调用对应脚本 — 根据数据类型选择脚本
    3. 解析结果 — 智能体分析返回的 JSON 格式数据
  • 脚本调用映射:
    • 行情/K线/复权数据 → python scripts/market_data.py --type daily --ts_code 000001.SZ --start_date 20240101 --end_date 20240131
    • 财务数据/利润表/资产负债表 → python scripts/financial_data.py --type financial --ts_code 000001.SZ --period 2023
    • 股票列表/交易日历 → python scripts/stock_info.py --type stock_basic
    • 指数数据/宏观数据 → python scripts/macro_index_data.py --type index_daily --ts_code 000001.SH --start_date 20240101 --end_date 20240131
  • 可选分支:
    • 当需要多只股票数据:使用 --ts_code 参数逗号分隔
    • 当需要复权数据:使用 --type adj_factor 获取复权因子
    • 当需要指定报告期:使用 --period 参数(YYYY 或 YYYYMM)

使用示例

  • 示例1:获取股票日K线数据
    • 场景/输入:用户说"查看平安银行最近一个月的K线数据"
    • 预期产出:返回日期、开盘价、最高价、最低价、收盘价、成交量等OHLCV数据
    • 关键要点:调用 python scripts/market_data.py --type daily --ts_code 000001.SZ --start_date 20240301 --end_date 20240331
  • 示例2:查询财务数据
    • 场景/输入:用户说"获取招商银行2023年的财务指标"
    • 预期产出:返回ROE、ROA、毛利率、净利率等财务指标
    • 关键要点:调用 python scripts/financial_data.py --type fina_indicator --ts_code 600036.SH --period 2023
  • 示例3:获取指数数据
    • 场景/输入:用户说"查询上证指数最近的走势"
    • 预期产出:返回上证指数的日期、收盘价、成交量等数据
    • 关键要点:调用 python scripts/macro_index_data.py --type index_daily --ts_code 000001.SH --start_date 20240301 --end_date 20240331

快速参考

常用代码示例

python
import tushare as ts
import pandas as pd

# 设置 Token(需先设置环境变量 TUSHARE_TOKEN)
ts.set_token(os.environ.get('TUSHARE_TOKEN', ''))
pro = ts.pro_api()

# 获取日K线数据
df = pro.daily(ts_code='000001.SZ', start_date='20240101', end_date='20241231')

# 获取财务指标
df = pro.fina_indicator(ts_code='600036.SH', period='2023')

# 获取指数数据
df = pro.index_daily(ts_code='000001.SH', start_date='20240101', end_date='20241231')

与其他数据源对比

特性tusharejqdatasdkbaostockakshare
费用免费/付费需注册积分免费免费
注册要求✅ 需要✅ 需要❌ 不需要❌ 不需要
数据范围全面(含宏观)A股+因子A股为主全面
宏观数据✅ 丰富❌❌✅
调用频率免费有限制有无限制无限制

资源索引

注意事项

  • 脚本执行需配置 Tushare Token,首次使用需先完成凭证配置
  • Tushare 股票代码格式:上海市场为 XXXXXX.SH,深圳市场为 XXXXXX.SZ
  • 部分数据(如财务数据)可能有延迟,建议在交易日9:30-15:00之外获取
  • 脚本返回 JSON 格式数据,智能体负责解析并转换为用户友好的展示
  • 调用频率有限制,免费账户每分钟最多120次调用(详见 Tushare 官方文档)
  • 首次使用建议先读取 tushare_quickstart.md 完成认证配置

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Tushare AI skill do?

Tushare 专业金融数据平台,提供A股行情、历史K线、财务数据、宏观数据、指数数据等,覆盖全面、数据质量高。当用户提及 Tushare、获取A股数据、查询财务报表、下载宏观数据,或需要高质量、多维度金融数据时使用。与 baostock(免费但功能有限)和 jqdatasdk(需注册但有积分门槛)不同,tushare 数据最全但需注册获取 Token。免费替代方案可用 baostock 或 akshare。

Why use Tushare on TypingMind?

Because you install it once and use it with any model. Tushare is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Tushare in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lzwme/finance-quant-skills/tree/main/skills/tushare. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Tushare?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Tushare?

As many as you like. As long as a model supports skills, you can use Tushare with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Tushare AI skill free?

It is published on GitHub by lzwme. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇