df['Db']='XXX'
df['Kind']='XXX'
df['Type']='XXX'
df['Company']='XXX'
n = len(df)+1
nlist = range(1,n)
df['Id'] = nlist #新增ID
context=df.to_dict(orient='records')
tpl = DocxTemplate('模板.docx')
tpl.render({'dic':context})
tpl.save('模板.docx')
序号 |
数据资源名称 |
数据项名称 |
数据格式 |
数据类型 |
来源系统 |
更新周期 |
源提供单位 |
是否接入 |
{%tr for c in dic%} | ||||||||
{{c.Id}} |
{{c.Table}} |
{{c.Note}} |
{{c.Kind}} |
{{c.Type}} |
{{c.Db}} |
|
{{c.Company}} |
|
{%tr endfor %} |