Skip to content

Commit db2a615

Browse files
committed
Initial commit: 个股深度分析系统 v2.2
- 三层架构(数据采集 + AI分析 + HTML生成) - 8步分析框架(宏观/产业链/质量/弹性/风险/估值/对标/跟踪) - 专业HTML报告(双主题/响应式/ECharts图表) - 基于akshare免费数据源 - 含终验自检清单防御4类已知Bug - MIT License
0 parents  commit db2a615

26 files changed

Lines changed: 10816 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Create Release
15+
uses: actions/create-release@v1
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
tag_name: ${{ github.ref }}
20+
release_name: Release ${{ github.ref }}
21+
draft: false
22+
prerelease: false

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.8', '3.9', '3.10', '3.11']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Lint with flake8
30+
run: |
31+
pip install flake8
32+
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
33+
34+
- name: Test import
35+
run: |
36+
python -c "from main import StockAnalyzer; print('✅ Import OK')"

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# 虚拟环境
24+
venv/
25+
ENV/
26+
env/
27+
28+
# IDE
29+
.vscode/
30+
.idea/
31+
*.swp
32+
*.swo
33+
*~
34+
35+
# 输出文件
36+
output/
37+
cache/
38+
*.log
39+
logs/
40+
41+
# 配置文件(包含敏感信息)
42+
config.local.yaml
43+
.env
44+
.env.local
45+
46+
# API Keys(重要!)
47+
*_api_key.txt
48+
secrets.yaml
49+
50+
# 知识库(可能包含敏感信息)
51+
knowledge_base/
52+
53+
# 临时文件
54+
*.tmp
55+
*.bak
56+
.DS_Store
57+
Thumbs.db
58+
59+
# 测试文件
60+
test_output/
61+
*.test.json

.mcp.json.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"mcpServers": {
3+
"zhipu": {
4+
"command": "npx",
5+
"args": ["-y", "@zhipu-ai/mcp-server"],
6+
"env": {
7+
"ZHIPU_API_KEY": "your-zhipu-api-key-here"
8+
}
9+
},
10+
"tavily": {
11+
"command": "npx",
12+
"args": ["-y", "@tavily/mcp-server"],
13+
"env": {
14+
"TAVILY_API_KEY": "your-tavily-api-key-here"
15+
}
16+
}
17+
}
18+
}

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# 更新日志
2+
3+
## [1.0.0] - 2026-05-01
4+
5+
### 新增
6+
- ✨ 完整的8步分析框架
7+
- ✨ 专业HTML报告(双主题)
8+
- ✨ 真实K线数据(含MA均线)
9+
- ✨ 产业链SVG可视化
10+
- ✨ 5维度质量评分
11+
- ✨ 情景分析(悲观/基准/乐观)
12+
- ✨ 风险信号列表
13+
- ✨ 对标分析
14+
15+
### 文档
16+
- 📝 完整的README
17+
- 📝 使用指南
18+
- 📝 设计规范
19+
- 📝 分析框架文档
20+
21+
### 已知问题
22+
- ⚠️ 财务指标数据可能不完整
23+
- ⚠️ 移动端适配待优化
24+
- ⚠️ 对标公司需手动指定
25+
26+
---
27+
28+
## [Unreleased]
29+
30+
### 计划新增
31+
- 🔜 自动对标分析
32+
- 🔜 行业知识库
33+
- 🔜 技术指标(MACD、KDJ)
34+
- 🔜 多周期切换
35+
- 🔜 数据导出功能

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# 贡献指南
2+
3+
感谢你对本项目的关注!
4+
5+
## 如何贡献
6+
7+
### 报告Bug
8+
9+
[Issues](https://github.com/yourusername/stock-analysis/issues) 中提交,请包含:
10+
- 问题描述
11+
- 复现步骤
12+
- 预期行为
13+
- 实际行为
14+
- 环境信息(Python版本、操作系统)
15+
16+
### 提交功能建议
17+
18+
[Issues](https://github.com/yourusername/stock-analysis/issues) 中提交,请说明:
19+
- 功能描述
20+
- 使用场景
21+
- 预期效果
22+
23+
### 提交代码
24+
25+
1. Fork本仓库
26+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
27+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
28+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
29+
5. 提交Pull Request
30+
31+
### 代码规范
32+
33+
- 遵循PEP 8
34+
- 添加必要的注释
35+
- 更新相关文档
36+
- 添加测试用例
37+
38+
## 开发环境
39+
40+
```bash
41+
# 克隆仓库
42+
git clone https://github.com/yourusername/stock-analysis.git
43+
cd stock-analysis
44+
45+
# 创建虚拟环境
46+
python -m venv venv
47+
source venv/bin/activate # Windows: venv\Scripts\activate
48+
49+
# 安装依赖
50+
pip install -r requirements.txt
51+
52+
# 运行测试
53+
python -m pytest tests/
54+
```
55+
56+
## 提交规范
57+
58+
- `feat`: 新功能
59+
- `fix`: 修复bug
60+
- `docs`: 文档更新
61+
- `style`: 代码格式(不影响功能)
62+
- `refactor`: 重构
63+
- `test`: 测试
64+
- `chore`: 构建/工具
65+
66+
示例:
67+
```
68+
feat: 添加自动对标分析功能
69+
fix: 修复K线数据获取失败的问题
70+
docs: 更新使用指南
71+
```
72+
73+
## 行为准则
74+
75+
- 尊重他人
76+
- 建设性反馈
77+
- 专注于问题本身
78+
- 保持友好和专业

0 commit comments

Comments
 (0)