上市公司年报/研报自动抓取。覆盖巨潮资讯、东方财富等数据源,支持按公司代码/名称/年份/行业批量下载 PDF。内置反爬绕过、PDF 解析。
Documents
CNInfo Reports
Try itBatch-download formal A-share annual and semiannual report PDFs from CNInfo (巨潮资讯) using a stock-code CSV. Supports dry-run preview, resume on failure, force...
What it does
Batch-download formal A-share annual and semiannual report PDFs from CNInfo (巨潮资讯) using a stock-code CSV. Supports dry-run preview, resume on failure, force...
The skill document
CNInfo Report Downloader(巨潮资讯报告下载)
批量下载A股上市公司年报/半年报 PDF(数据源:巨潮资讯 cninfo.com.cn)。
When to activate
- User wants to download A-share annual or semiannual reports
- User mentions 巨潮、cninfo、年报下载、半年报、annual report
- User needs to batch-fetch report PDFs from a stock-code list
Prerequisites
pip install -r requirements.txt
Workflow
- Confirm that a stock CSV exists and that its first column contains stock codes (6-digit A-share codes).
- If unsure, run
--dry-runfirst to preview matches without downloading. - Run the command from the skill directory. The script tracks progress in SQLite and can resume after interruption.
- Check
runtime/manifest_.csvandruntime/logs/cninfo_.logafter the run. - Consult references/filter_rules.md only when adjusting title matching, naming, or reset behavior.
Commands
Normal download (default year 2025):
python scripts/run_cninfo_reports.py --stock-csv
Dry-run (preview only, no download):
python scripts/run_cninfo_reports.py --stock-csv --dry-run
Specify year:
python scripts/run_cninfo_reports.py --stock-csv --year 2024
Force redownload (ignore cache):
python scripts/run_cninfo_reports.py --stock-csv --force-redownload
Full CLI options:
| Argument | Default | Description |
|---|---|---|
--year | 2025 | Target report year |
--stock-csv | 上市公司基础信息.csv | CSV with stock codes in column 1 |
--output-dir | downloads/ | PDF output directory |
--runtime-dir | runtime | State, manifest, logs directory |
--page-size | 20 | Search results per page |
--sleep-seconds | 1.2 | Min delay between requests |
--timeout-seconds | 30 | HTTP timeout |
--max-retries | 5 | HTTP retry attempts |
--dry-run | false | Preview matches without downloading |
--force-redownload | false | Re-download even if file exists |
Features
- Smart title filtering — regex-based matching for formal annual/semiannual reports; auto-rejects summaries, English variants, ESG reports, notices, etc.
- Breakpoint resume — SQLite state tracks search progress and download status per announcement; resumes after interruption.
- Manifest output —
runtime/manifest_.csvwith full metadata for every eligible report. - Idempotent naming —
{code}_{year}_{kind}.pdffor primary files, extra variants get_{announcement_id}suffix.
Architecture
scripts/
run_cninfo_reports.py # Entry point
cninfo_annual_reports/
cli.py # Argument parsing & logging
config.py # AppConfig dataclass
service.py # Core orchestration logic
repository.py # SQLite state management
http_client.py # CNInfo API & file download
models.py # Data models
filters.py # Title evaluation & regex
references/
filter_rules.md # Detailed filter/reset docs
agents/
openai.yaml # Codex integration config
Reset
To restart from scratch, delete state files:
rm runtime/state.db runtime/state.db-wal runtime/state.db-shm
Related skills
生成A股个股深度投资报告。当用户要求撰写股票/公司投资报告、个股分析、估值分析时使用。支持批量生成多份报告。报告包含:公司概况、详细业务构成、财务分析与预测、分部估值(SOTP)、投资逻辑、交易计划、多维度深度分析(政策面/基本面/技术面/情绪面/消息面/资金面)、风险提示、总结。用户只需提供公司名称列表即可触发。
Use when a client needs to estimate China individual income tax on overseas brokerage or bank statements, prepare documents for the tax bureau, or offset annual stock gains and losses from local agent chats such as WorkBuddy or 豆包 Work.
财报 PDF(年报/半年报/季报,A 股 + 港股 IFRS)内容理解与按需可溯源提取。双轨转换(Docling FAST + PyMuPDF 有框线表格接管 + ACCURATE 报表页精修)→ 可提取性 meta → adapt-plan 提取剧本 → 全表 records 预提取 → materialize 分表 → 定型晋升 + 质量门(勾稽校验/数值存在性/quote 回验)→ review-extract 独立审核。每个数值带页码与原文 quote 溯源,无 quality.json / review.json 不得给下游。Standalone——`fetch --pdf-url` 无需任何 API key 即可全链路运行;可选接入 WinMale 平台启用 symbol 模式。Use when the user asks to extract or locate data in a financial report PDF (annual/semi-annual/quarterly), e.g. 货币资金、前十大股东、分红方案、全量核心数据、第 N 页内容。
Resolve a China A-share stock name or code in pure Node.js, fetch daily historical bars from Eastmoney HTTP APIs, and archive them as local JSON files. Use w...
Auto-generates and pushes six A-share market reports on a cron schedule, with 6-dimension sentiment scoring and AI outlook.