Generate a professional, interactive HTML financial daily report covering A-shares, Hong Kong stocks, and major global indices. The report follows Chinese stock market conventions (red for up, green for down) and uses AKShare for free real-time data.
Trigger this skill when the user asks for:
Before running the script, ensure dependencies are installed:
bash
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple akshare pandas --trusted-host pypi.tuna.tsinghua.edu.cn
Use the managed Python runtime at C:/Users/PC/.workbuddy/binaries/python/versions/3.13.12/python.exe and create/use a venv if needed.
Execute the main script to generate the report:
bash
python scripts/generate_report.py [--output <path>] [--date YYYY-MM-DD]
Options:
--output: Output HTML file path (default: current working directory finance_daily_report_YYYY-MM-DD.html)--date: Target date in YYYY-MM-DD format (default: today). Note: only historical dates work for complete data; today may have incomplete real-time data.After generation, present the HTML file to the user using present_files. The report is a self-contained interactive HTML file that opens directly in the browser.
The generated report includes 6 modules:
The script uses the following AKShare data sources (v1.18+ optimized for China network):
ModuleAPISourceA-share indicesak.stock_zh_index_spot_sina()Sina (reliable in China)HK indicesak.stock_hk_index_spot_sina()SinaIndustry sectorsak.stock_board_industry_summary_ths()TongHuaShun (THS)North-bound flowak.stock_hsgt_hist_em(symbol='沪股通')EastMoneyTurnoverCalculated from stock_zh_index_spot_sina()SinaForexak.fx_spot_quote()-Commoditiesak.futures_global_spot_em()EastMoneyNewsak.stock_news_em()EastMoney
See references/akshare_apis.md for detailed API mappings and column schemas.
On Windows, always set PYTHONIOENCODING=utf-8 when running the script to avoid GBK encoding errors:
bash
PYTHONIOENCODING=utf-8 python scripts/generate_report.py --date 2026-06-16
stock_zh_index_spot_sina, stock_hk_index_spot_sina) are preferred over EastMoney for reliability in China