本技能用于分析招标数据并生成专业报告,支持:
Excel文件(.xlsx),需包含以下字段:
项目名称 - 招标项目名称项目主体 - 项目分类/类型成交金额(元) - 中标金额信息采集日期 - 招标日期(时间戳或日期格式)甲方名称 - 招标机构名称默认关键词: 人工智能、 AI、 智能、 大数据、 机器学习、 深度学习、 智慧
#FF8C42#00F5D4#7ED4FF#00D4FFpython
from bidding_analysis_report import BiddingReport
# 创建报告实例
report = BiddingReport(
data_path='招标数据.xlsx',
ai_keywords=['人工智能', 'AI', '智能', '大数据'],
output_format='word' # 或 'pdf'
)
# 生成报告
report.generate(
title='昆明高校近三年AI项目分析报告',
top_n=10, # TOP机构数量
detail_n=5 # 详细分析的机构数量
)
bash
python bidding_report.py \
--data 招标数据.xlsx \
--title "昆明高校AI招标分析报告" \
--output report.docx \
--top 10 \
--detail 5
每个机构包含:
text
pandas>=1.3.0
matplotlib>=3.5.0
python-docx>=0.8.11
openpyxl>=3.0.0
python
import matplotlib.pyplot as plt
# 优先使用微软雅黑,回退到系统支持字体
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei', 'Droid Sans Fallback', 'SimHei']
plt.rcParams['axes.unicode_minus'] = False
python
# 嵌套环形图
fig, ax = plt.subplots(figsize=(12, 8))
wedges1 = ax.pie(outer_vals, radius=1.3, colors=colors_outer,
wedgeprops=dict(width=0.35, edgecolor='white'))
wedges2 = ax.pie(inner_vals, radius=0.95, colors=colors_inner,
wedgeprops=dict(width=0.35, edgecolor='white'))
# 保存为PNG
plt.savefig('chart.png', dpi=150, bbox_inches='tight', facecolor='white')
python
from docx import Document
from docx.shared import Inches, Pt
doc = Document()
# 设置字体和行距
style = doc.styles['Normal']
style.font.name = 'Microsoft YaHei'
style.font.size = Pt(12)
# 插入图表
doc.add_picture('chart.png', width=Inches(5.5))
# 数据加粗显示
p = doc.add_paragraph()
p.add_run('总项目数:')
run = p.add_run('6,786')
run.bold = True
参数说明默认值data_path数据文件路径必填ai_keywordsAI项目识别关键词['人工智能','AI','智能',...]output_format输出格式'word'top_nTOP机构数量10detail_n详细分析机构数量5chart_dpi图表分辨率150line_spacing行距倍数1.5
.format() 或字符串拼接,避免 f-string 编码问题总体情况:
年度趋势:
TOP10高校:
作者: OpenClaw Team
许可: MIT License