# scripts/ — 自动化脚本 **生成:** 2026-06-05 **分支:** main ## OVERVIEW Python/JS 工具和自动化脚本。招标公告抓取 + direv 平台发布 + 图片处理 + 开发工具。 ## STRUCTURE ``` scripts/ ├── tender-fetcher/ # 招标公告抓取(由 CrawlerService execSync 调用) │ ├── fetch-v1.2.js # 中电建 │ ├── fetch-xkgroup.py # 新矿集团 │ ├── fetch-cnncecp.py # 中核集团 │ └── lead_evaluation_report.py ├── direv-publish/ # direv 平台全链路发布(10 个 .py) │ ├── publish.py / batch_publish*.py │ ├── auto_audit.py / auto_publish.py │ ├── wait_login*.py / check_direv_login.py │ └── extract_notes.py ├── search_image.py # Bing 图片搜索(Playwright) ├── process_image.py # 图片处理(去水印/裁剪/白底合成) ├── parse_products.py # Excel/CSV → JSON ├── start-dev.sh # nohup 后台启动 dev server └── stop-dev.sh # 根据 PID 停止 dev server ``` ## WHERE TO LOOK | 任务 | Location | Notes | |------|----------|-------| | 新增采集器 | `tender-fetcher/fetch-xxx.py` | 输出到 `~/Desktop/招标公告//xxx_downloaded.json` | | direv 发布 | `direv-publish/auto_publish.py` | 完整流程:读公告→发 direv→飞书通知 | ## CONVENTIONS - Python 脚本用 `#!/usr/bin/env python3` + `if __name__ == '__main__'` - 所有 Python/JS 脚本通过后端 `execSync()` 调用,非 import 导入 - 输出结果写到文件,非 stdout - 图片处理脚本输出到 `public/uploads/library/` ## ANTI-PATTERNS - 不要用 `print()` 输出结构化数据(结果走文件) - 不要依赖 `node_modules` 外的系统级 Python 包(用 requirements.txt)