使用一组jinja模板快速创建html报告
reports的Python项目详细描述
Python version: | Python 2.7, 3.4 and 3.5 |
---|---|
Online documentation: | |
On readthedocs | |
Issues and bug reports: | |
On github |
这是一个使用jinja模板轻松构建html报告的简单包。
安装
pip install reports
示例
下面是一个简单的示例,它基于generic创建一个空报告 提供的模板:
from reports import Report r = Report() r.create_report(onweb=True)
下一步是将模板复制到一个新目录中,并对其进行编辑 并填写jinja属性以满足您的需要:
from report import Report r = Report("myreport_templates") r.jinja["section1"] = "<h1></h1>" r.create_report()
有关详细信息,请参见Sphinx文档