šŸŽ Get the FREE AI Skills Starter Guide — Subscribe →
BytesAgainBytesAgain
šŸ¦€ ClawHub

lin

by @lin-shiwu

Generate annual insurance welfare Word reports from `gh_hg_bscyearall_dues` in OpenClaw format. The packaged Python entry extracts the target year, inspects...

Versionv1.0.0
Downloads676
TERMINAL
clawhub install annual-insurance-word-report

šŸ“– About This Skill


name: annual-insurance-word-report-openclaw description: Generate annual insurance welfare Word reports from gh_hg_bscyearall_dues in OpenClaw format. The packaged Python entry extracts the target year, inspects MySQL column comments, maps business fields into the bundled Word template, and writes the final .docx report.

Annual Insurance Word Report

What this package does

  • Resolves the target year from year or from request_text
  • Queries gh_hg_bscyearall_dues
  • Reads INFORMATION_SCHEMA.COLUMNS comments before rendering
  • Fills the bundled yearly Word template without depending on Word COM
  • Writes the finished .docx file to outputs/ by default
  • Inputs

  • request_text: optional natural-language request, for example åø®ęˆ‘ē”Ÿęˆ2023å¹“äøšåŠ”ęŠ„å‘Š
  • year: optional explicit year, for example 2023
  • template_path: optional custom .docx template path
  • output_path: optional custom output .docx path
  • db_host: optional, default 127.0.0.1
  • db_port: optional, default 3306
  • db_user: optional, default root
  • db_password: optional, default root
  • database: optional, default test_db
  • table_name: optional, default gh_hg_bscyearall_dues
  • charset: optional, default utf8mb4
  • mysql_cli: optional fallback path to mysql CLI if PyMySQL is 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-.docx.
  • The default template is stored as text in assets/beijing_office_annual_template.docx.base64.txt and is restored to a temporary .docx at runtime.
  • The package keeps the original business mapping: å›¢ę„ć€å­å„³ć€å„³å·„ć€é‡ē–¾ć€č½»ē—‡ć€ä½é™¢ć€ę“„č““ć€č”„å……ć€äø¤ē™Œć€ē»¼åˆAć€ē»¼åˆBć€åˆč®”.
  • If PyMySQL is not installed, the entry falls back to the mysql CLI when mysql_cli is provided or mysql is on PATH.
  • šŸ“‹ Tips & Best Practices

  • The default output path is outputs/annual-insurance-report-.docx.
  • The default template is stored as text in assets/beijing_office_annual_template.docx.base64.txt and is restored to a temporary .docx at runtime.
  • The package keeps the original business mapping: å›¢ę„ć€å­å„³ć€å„³å·„ć€é‡ē–¾ć€č½»ē—‡ć€ä½é™¢ć€ę“„č““ć€č”„å……ć€äø¤ē™Œć€ē»¼åˆAć€ē»¼åˆBć€åˆč®”.
  • If PyMySQL is not installed, the entry falls back to the mysql CLI when mysql_cli is provided or mysql is on PATH.