feat: 日报结构化入库(M10 前后端分离数据层)

- 新增 report_db 包: MySQL 连接/建表/幂等写入 (news_report/news_event, myquant 库)
- 新增 report_import 包: 历史 178 份日报 HTML 解析入库, 表头驱动列映射
- reporter.py 完全切换: generate_report 结构化入库, 不再生成/上传 HTML
- CLI: 新增 report-import 子命令
- 依赖: uv add pymysql; 配置: NEWS_DB_* / REPORT_HISTORY_DIR
- 文档: docs/report_db_design.md(实现逻辑), docs/db_schema.md(表结构供 API/前端)
- 测试: 24 个单测通过 (parser/builder/models/importer)
This commit is contained in:
2026-08-03 21:32:07 +08:00
parent f2c80c5a9c
commit 366e60e8a9
25 changed files with 1934 additions and 33 deletions
Generated
+11
View File
@@ -23,6 +23,7 @@ dependencies = [
{ name = "numpy" },
{ name = "openai" },
{ name = "pydantic" },
{ name = "pymysql" },
{ name = "pypdf" },
{ name = "python-dateutil" },
{ name = "python-dotenv" },
@@ -60,6 +61,7 @@ requires-dist = [
{ name = "numpy", specifier = ">=1.26" },
{ name = "openai", specifier = ">=1.40" },
{ name = "pydantic", specifier = ">=2.7" },
{ name = "pymysql", specifier = ">=1.2.0" },
{ name = "pypdf", specifier = ">=6.13.3" },
{ name = "python-dateutil", specifier = ">=2.9" },
{ name = "python-dotenv", specifier = ">=1.0" },
@@ -1983,6 +1985,15 @@ crypto = [
{ name = "cryptography" },
]
[[package]]
name = "pymysql"
version = "1.2.0"
source = { registry = "https://mirrors.aliyun.com/pypi/simple/" }
sdist = { url = "https://mirrors.aliyun.com/pypi/packages/c9/bc/1c6a92f385940f727daeecf3bacaf186e03875dff57197801046c583bcf0/pymysql-1.2.0.tar.gz", hash = "sha256:6c7b17ca686988104d7426c27895b455cdeea3e9d3ceb1270f0c3704fead8c33" }
wheels = [
{ url = "https://mirrors.aliyun.com/pypi/packages/c4/bd/2534e130295c8cfd4f0a2e31623baab7502278f1e97bcfe61db75656a77f/pymysql-1.2.0-py3-none-any.whl", hash = "sha256:62169ce6d5510f08e140c5e7990ee884a9764024e4a9a27b2cc11f1099322ae0" },
]
[[package]]
name = "pyopenssl"
version = "26.3.0"