Files
skills/multi-source-stock-query/TOOLS.md
T
hmo 04db423416 Initial commit: skills library
- 70 skills with code and documentation
- Add .gitignore (ignore __pycache__, output/, temp/, venv/)
- Clean up test intermediates and caches
2026-04-26 19:27:40 +08:00

1.8 KiB

股票数据分析工具集合

此目录包含多个股票数据分析相关的Python工具脚本,它们为多源股票查询技能提供支撑。

工具列表

1. XLS文件处理工具

  • read_with_xlrd.py - 读取.xls格式股票持仓文件
  • read_with_xlrd_fixed.py - 修复版本,支持中文编码
  • read_xls_proper.py - 正确的.xls文件处理脚本
  • convert_xls_to_xlsx.py - 将.xls转换为.xlsx格式
  • correct_holdings.py - 修正持仓数据解析脚本

2. 编码处理工具

  • detect_encoding.py - 检测文件编码
  • convert_to_utf8.py - 转换为UTF-8编码
  • parse_holdings.py - 解析持仓数据
  • parse_holdings_correct.py - 修正版持仓解析

3. 核心查询工具

  • read_holdings.py - 读取持仓文件
  • read_latest_*.py - 读取最新持仓文件(不同日期版本)
  • check_file_format.py - 检查文件格式

使用说明

文件读取工具

python read_with_xlrd_fixed.py <xls_file_path>

优先使用xlrd库处理.xls格式文件,自动处理中文编码。

转换工具

python convert_xls_to_xlsx.py <input.xls> <output.xlsx>

将旧版.xls文件转换为现代.xlsx格式以便进一步处理。

持仓分析工具

python parse_holdings_correct.py <holdings_file>

从持仓文件中提取准确的股票数据,避免编码问题。

适用场景

  1. 股票持仓分析 - 读取.xls格式的持仓文件
  2. 中文编码处理 - 正确处理WPS/Excel中文编码问题
  3. 数据验证 - 验证持仓数据准确性
  4. 格式转换 - 将旧格式转换为现代格式

注意事项

  1. 部分脚本可能需要安装xlrd: pip install xlrd
  2. 中文文件路径可能存在编码问题
  3. 建议优先使用带有"fixed"或"correct"的脚本
  4. 所有工具已整合到multi-source-stock-query技能中