Search

PythonReactSEOPDF
OpenClaw

tushare

Fetch Chinese stock and futures market data via Tushare API. Supports stock quotes, futures data, company fundamentals, and macroeconomic indicators. Use when the user needs financial data from Chinese markets. Requires TUSHARE_TOKEN environment variable.

alphafactor0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install alphafactor/tushare

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Tushare 金融数据接口

获取中国 A 股市场和期货市场的实时及历史数据。

前提条件

1. 注册 Tushare 账号

访问 https://tushare.pro/register 注册账号并获取 API Token。

2. 配置 Token
# 添加到 ~/.zshrc
export TUSHARE_TOKEN="your-api-token-here"

然后执行:

source ~/.zshrc
3. 安装依赖
pip3 install tushare pandas --user

快速开始

获取股票列表
python3 scripts/market.py stock_basic
获取日线行情
python3 scripts/market.py daily --ts_code 000001.SZ --start_date 20240101 --end_date 20240131
获取实时行情
python3 scripts/market.py realtime 000001

股票数据

股票基础信息
python3 scripts/market.py stock_basic
python3 scripts/market.py stock_basic --exchange SSE  # 仅上交所
python3 scripts/market.py stock_basic --exchange SZSE  # 仅深交所
日线行情
# 获取单只股票近期数据
python3 scripts/market.py daily --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py daily --ts_code 600519.SH --start_date 20240101 --end_date 20240131

# 获取指定交易日全市场数据
python3 scripts/market.py daily --trade_date 20240115
周线行情
# 获取周线数据
python3 scripts/market.py weekly --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py weekly --ts_code 600519.SH --start_date 20230101 --end_date 20240131
月线行情
# 获取月线数据
python3 scripts/market.py monthly --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py monthly --ts_code 600519.SH --start_date 20200101 --end_date 20240131

股票代码格式:

  • 深交所:000001.SZ, 000002.SZ, 300001.SZ (创业板)
  • 上交所:600000.SH, 600519.SH, 688001.SH (科创板)
实时行情
python3 scripts/market.py realtime 000001
python3 scripts/market.py realtime 600519
资金流向
# 获取指定股票资金流向
python3 scripts/market.py moneyflow --ts_code 000001.SZ

# 获取指定日期全市场资金流向
python3 scripts/market.py moneyflow --trade_date 2024...

Source information

Source
github
Repository
openclaw/skills
Path
skills/alphafactor/tushare
Version
—
Commit
41eca08a06336cdef2b24a93ef4eafb2e578b8e8
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# Tushare 金融数据接口

获取中国 A 股市场和期货市场的实时及历史数据。

## 前提条件

### 1. 注册 Tushare 账号

访问 https://tushare.pro/register 注册账号并获取 API Token。

### 2. 配置 Token

```bash
# 添加到 ~/.zshrc
export TUSHARE_TOKEN="your-api-token-here"
```

然后执行:
```bash
source ~/.zshrc
```

### 3. 安装依赖

```bash
pip3 install tushare pandas --user
```

## 快速开始

### 获取股票列表

```bash
python3 scripts/market.py stock_basic
```

### 获取日线行情

```bash
python3 scripts/market.py daily --ts_code 000001.SZ --start_date 20240101 --end_date 20240131
```

### 获取实时行情

```bash
python3 scripts/market.py realtime 000001
```

## 股票数据

### 股票基础信息

```bash
python3 scripts/market.py stock_basic
python3 scripts/market.py stock_basic --exchange SSE  # 仅上交所
python3 scripts/market.py stock_basic --exchange SZSE  # 仅深交所
```

### 日线行情

```bash
# 获取单只股票近期数据
python3 scripts/market.py daily --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py daily --ts_code 600519.SH --start_date 20240101 --end_date 20240131

# 获取指定交易日全市场数据
python3 scripts/market.py daily --trade_date 20240115
```

### 周线行情

```bash
# 获取周线数据
python3 scripts/market.py weekly --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py weekly --ts_code 600519.SH --start_date 20230101 --end_date 20240131
```

### 月线行情

```bash
# 获取月线数据
python3 scripts/market.py monthly --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py monthly --ts_code 600519.SH --start_date 20200101 --end_date 20240131
```

**股票代码格式**:
- 深交所:`000001.SZ`, `000002.SZ`, `300001.SZ` (创业板)
- 上交所:`600000.SH`, `600519.SH`, `688001.SH` (科创板)

### 实时行情

```bash
python3 scripts/market.py realtime 000001
python3 scripts/market.py realtime 600519
```

### 资金流向

```bash
# 获取指定股票资金流向
python3 scripts/market.py moneyflow --ts_code 000001.SZ

# 获取指定日期全市场资金流向
python3 scripts/market.py moneyflow --trade_date 2024...

Related skills

OpenClaw

13-Day Sprint Method

galizki

Productivity system based on Maya calendar with 13 natural tones for project management and personal development

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.