README.md

    Automation Report

    中文文档

    Automation report is a set can solve many areas of industry involves the report generation requirements, the project is the first purpose is to simplify the manual process inside the company of a link, the main purpose is to the plane of the laboratory tests show data results combined with the corresponding report template batch generate a report(.pdf)。

    The project running environment is suitable for all major operating systems, the author mainly introduces the production environment is Linux, use Python compiled languages, using PDFTK, WKHTML format conversion software format on the processing; Using Jinja2 template engine and MarkupSafe templates for HTML escape and tags automatically, at the same time efficient transform source into Python bytecode, speed up the template execution time;The existing table data batch rapidly into a database and combined with the Java file upload download page data, and other functions of system development.Finally realize the detecting data and combined with the matching report template, and generate the final report in PDF format.

    Steps

    1、To convert data source after the csv file (file - save as file type (csv (comma separated) (*.csv) - save), with special programming code editor will confirm for utf-8 (in the case of the notebook, file - coding - utf-8 - save), csv file to be included in the data folder;

    show_1

    2、cd <program path>

    Enter the report file path (< program path > program path, such as:/home/jlcao/TP53/report);

    show_2

    3、virtualenv -p <path> <file name>

    (such as:/usr/local/bin/python3.5 report)In the current directory to create the report folder, the folder is created in the virtual environment.Just create once;

    show_3

    4、source report/bin/activate

    Activate the virtual environment(virtualenv);

    show_4

    5、pip install -r requirements.txt

    With pip installation depends on the environment, operation requirements.txt, just run once;

    show_5

    6、python gen_report.py --result-dir results data/xxx.csv

    (xxx.csv data file for the data folder,such as:TP53-10个口腔拭子交付报告-20170710.csv) Executing this command, you can in the results folder to generate xxx.csv specified in the patients with all reports, report is stored in a separate folder, the folder name and read xxx.csv data source name.

    show_6

    show_7

    show_8

    After input the above command execution:

    show9

    Warning

    • Read from the data source, "NO, the name, number" in the header of the data does not have any openings;
    • The Data in the file name can't name repetition;
    • The test data in the data folder can only be used for the objective of the test data, cannot be used for any other commercial way!!!!!!
    • Templates, TP53_pdf_templates two folders in the report template can only be used for the project report template, cannot be used for any other commercial way!!!!!!

    About

    Hey, I'm Jack Cao, Java engineer, such as the Apache & Alibaba open source contributor, found in all the year round lot, Github, Gitee, zhihu, jianshu. At present is mainly responsible for group App backend development and maintenance, micro services infrastructure, infrastructure construction, Had the opportunity with Alibaba Health & PICC participate in large-scale project development; and my first studio was founded in 2017, solve all kinds of company 「incurable diseases」, to achieve the demand of 「imagination」.Have been torn between the demand and development of struggle, as in a line of powerhouse, is still in development.

    home:https://caojiele.com

    jianshu:https://www.jianshu.com/u/faa01fa59ea3

    zhihu:https://www.zhihu.com/people/wang-le-6-62/activities

    imooc:https://www.imooc.com/u/4024769/articles

    segmentfault:https://segmentfault.com/u/xiaomage_5c10d17d26987

    Wechat: xiaomage_freestyle

    Wechat

    More details, please scan qrcode:

    qrcode

    Resources

    项目简介

    Automation report是一款可以解决很多行业领域中设涉及到报告生成的需求,本项目最开始的初衷是为公司内部简化人工流程的一个环节,主要实现目的是将实验室检测得出的下机数据结果与对应的报告模版批量结合生成报告(.pdf)。

    发行版本

    当前项目没有发行版本

    贡献者 2

    开发语言

    • HTML 60.9 %
    • Python 24.9 %
    • CSS 14.2 %