mcpField
A
akshare-stock

akshare-stock

github.com/danonyvincitData & databases5956 installsUpdated 41w ago
Repository

About akshare-stock

akshare-stock is a skill for retrieving and analyzing Chinese A-share data with AKShare. It provides Python scripts for market, financial, and technical analysis, plus report generation, scheduling, and local caching.

Key features

  1. 01Fetch real-time quotes and historical K-lines
  2. 02Retrieve valuation, fund flow, financial, and shareholder data
  3. 03Score investments using multiple analysis dimensions
  4. 04Calculate MA, MACD, RSI, KDJ, and BOLL
  5. 05Cache data in SQLite and schedule reports

Use cases

  1. 01Check real-time quotes and historical trends for an A-share
  2. 02Combine valuation, growth, and fund-flow data for a stock
  3. 03Generate recurring stock monitoring reports

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/danonyvincit/akshare-stock-skill --skill akshare-stock

After installing, type/akshare-stockin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

config.yaml
references/
api_reference.md
official_docs.md
scripts/
analyze_investment.py
cache_manager.py
calc_technical.py
get_dividend.py
get_financial.py
get_fund_flow.py
get_history_kline.py
get_realtime_quote.py
get_shareholders.py
get_valuation.py
scheduler.py
stock_analyzer.py

Details

From the project README

AKShare A股数据分析 Skill

使用 AKShare 库获取中国 A 股市场数据并进行分析。AKShare 是免费开源的金融数据接口,无需注册或 Token。

快速开始

环境准备
pip install akshare pandas numpy pyyaml
使用脚本
cd e:\AIproJect\A_Share\.agent\skills\akshare-stock\scripts

# 智能投资分析(推荐)
python analyze_investment.py 002475

# 实时行情
python get_realtime_quote.py 002475

# 历史K线
python get_history_kline.py 002475 --days 60

# 技术指标
python calc_technical.py 002475

# 综合分析报告
python stock_analyzer.py 002475 -o report.md

脚本列表

数据获取脚本
脚本功能示例
get_realtime_quote.py实时行情python get_realtime_quote.py 002475
get_history_kline.py历史K线python get_history_kline.py 002475 --days 60
get_valuation.py估值指标python get_valuation.py 002475
get_fund_flow.py资金流向python get_fund_flow.py 002475 --days 10
get_financial.py财务数据python get_financial.py 002475
get_shareholders.py股东信息python get_shareholders.py 002475
get_dividend.py分红数据python get_dividend.py 002475
分析脚本
脚本功能说明
analyze_investment.py智能投资分析多维度评分 + 投资建议
calc_technical.py技术指标计算MA/MACD/RSI/KDJ/BOLL
stock_analyzer.py综合分析报告合并所有数据的完整报告
工具脚本
脚本功能说明
cache_manager.py数据缓存SQLite 本地缓存
scheduler.py定时任务自动获取数据和生成报告

核心功能

1. 智能投资分析
python analyze_investment.py 002475

自动分析:

  • 📊 估值分析(PE/PB/股息率)
  • 📈 成长性分析(营收/利润增速)
  • 💵 资金面分析(主力资金流向)
  • 📉 技术面分析(均线/MACD/RSI)
  • 综合评分 + 投资建议
2. 技术指标
python calc_technical.py 002475

支持指标:

  • MA: 5/10/20/60日均线
  • MACD: DIF, DEA, MACD柱
  • RSI: 6/12/24日
  • KDJ: K, D, J
  • BOLL: 上轨/中轨/下轨
3. 数据缓存

自动缓存避免重复请求:

  • 实时行情:1分钟
  • 日K线:1小时
  • 财务数据:7天
  • 股东数据:30天
4. 定时任务
# 立即执行
python scheduler.py --run-now

# 后台运行调度器
python scheduler.py

配置 config.yaml 设置监控股票和执行时间。

输出格式

所有脚本默认输出 Markdown 格式,可直接预览或保存:

python analyze_investment.py 002475 -o 分析报告.md

文件结构

akshare-stock/
├── SKILL.md                 # 本文档
├── config.yaml              # 配置文件
├── references/
│   ├── api_reference.md     # API 参考
│   └── official_docs.md     # 官方文档索引
└── scripts/
    ├── analyze_investment.py   # 智能分析
    ├── calc_technical.py       # 技术指标
    ├── cache_manager.py        # 数据缓存
    ├── scheduler.py            # 定时任务
    ├── stock_analyzer.py       # 综合分析
    ├── get_realtime_quote.py   # 实时行情
    ├── get_history_kline.py    # 历史K线
    ├── get_valuation.py        # 估值指标
    ├── get_fund_flow.py        # 资金流向
    ├── get_financial.py        # 财务数据
    ├── get_shareholders.py     # 股东信息
    └── get_dividend.py         # 分红数据

参考资源

Comments

Markdown supported