- 新增 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)
20 lines
530 B
Python
20 lines
530 B
Python
"""日报结构化入库(Milestone 10)。
|
||
|
||
职责:日报内容(finance/intl)结构化后写入 MySQL(news_report / news_event),
|
||
供用户另行实现的 API/前端读取。本项目不提供 API 与前端。
|
||
"""
|
||
|
||
from .db import connect, exists_report, fetch_report, init_schema, load_db_config, save_report
|
||
from .models import EventRow, ReportData
|
||
|
||
__all__ = [
|
||
"EventRow",
|
||
"ReportData",
|
||
"connect",
|
||
"exists_report",
|
||
"fetch_report",
|
||
"init_schema",
|
||
"load_db_config",
|
||
"save_report",
|
||
]
|