Annual Insurance Word Report
What this package does
- Resolves the target year from
yearor fromrequest_text - Queries
gh_hg_bscyearall_dues - Reads
INFORMATION_SCHEMA.COLUMNScomments before rendering - Fills the bundled yearly Word template without depending on Word COM
- Writes the finished
.docxfile tooutputs/by default
Inputs
request_text: optional natural-language request, for example帮我生成2023年业务报告year: optional explicit year, for example2023template_path: optional custom.docxtemplate pathoutput_path: optional custom output.docxpathdb_host: optional, default127.0.0.1db_port: optional, default3306db_user: optional, defaultrootdb_password: optional, defaultrootdatabase: optional, defaulttest_dbtable_name: optional, defaultgh_hg_bscyearall_duescharset: optional, defaultutf8mb4mysql_cli: optional fallback path tomysqlCLI ifPyMySQLis unavailable
Run
Install dependencies:
pip install -r requirements.txt
Run with an explicit year:
python src/main.py --year 2023
Run with request text extraction:
python src/main.py --request-text "帮我生成2023年业务报告"
Custom database example:
python src/main.py --year 2023 --database test_db --db-user root --db-password root
Notes
- The default output path is
outputs/annual-insurance-report-<year>.docx. - The default template is stored as text in
assets/beijing_office_annual_template.docx.base64.txtand is restored to a temporary.docxat runtime. - The package keeps the original business mapping:
团意、子女、女工、重疾、轻症、住院、津贴、补充、两癌、综合A、综合B、合计. - If
PyMySQLis not installed, the entry falls back to themysqlCLI whenmysql_cliis provided ormysqlis onPATH.