Files
yj_resume/service/format_template_resume.py
2025-12-05 16:34:01 +08:00

36 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from docxtpl import DocxTemplate
from pathlib import Path
context = {
'name': '张三',
'sex': '',
'nation': '汉族',
'brith': '1990-01-01',
'address': '北京市海淀区西二旗',
'education': '本科',
'degree': '学士',
# 籍贯
'origin': '山东',
'politics': '党员',
# 部门
'department': '数信部',
'position': '助理开发工程师',
'phone': '13812345678',
'title': '后端开发工程师',
'start_work_time': '2018-01-01',
# 身份证
'id_number': '500221199001010010101',
# 荣誉,交给大模型
'honor': '一等奖',
# 工作内容
'work_text': '''
2023.12-2024.10:负责《边缘计算+5G自组网的水电物联网系统建设与研究》项目异常检测算法和项目实施利用5G自组网技术、自建边缘计算单元等实际实现在线异常检测、时间序列趋势分析、模型轻量化等功能缓解通信带宽压力在观音岩、彭水、渝能等场站实施应用。完成项目科技成果凝练、项目报奖等工作。本项目工作获得第六届全国设备管理与技术创新成果一等奖、中电联职工创新成果二等奖。
2024.04-2025.至今:广西河池源网荷储一体化项目/大唐西藏玉曲河扎拉电厂可行性研究报告&方案编写、AI支持中心方案策划
'''
}
file_path = Path.cwd().joinpath('template.docx')
template = DocxTemplate(file_path)
template.render(context)
template.save('E://resu//output.docx')