项目作者: MrHeer

项目描述 :
Generate docx from csv file through .docx template.
高级语言: Python
项目地址: git://github.com/MrHeer/gendoc.git
创建时间: 2020-03-15T11:05:38Z
项目社区:https://github.com/MrHeer/gendoc

开源协议:MIT License

下载


gendoc

Generate docx from csv file through .docx template.

Usage

  1. usage: gendoc.py [-h] [-c CONFIG] [-t THREADS] [-v]
  2. Generate docx from csv file through .docx template.
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. -c CONFIG, --config CONFIG
  6. config file
  7. -t THREADS, --threads THREADS
  8. number of threads (max 20)
  9. -v, --version version info

Example of the config.json file

  1. {
  2. "tasks": [
  3. {
  4. "input_file": "./input/student.csv",
  5. "output_dir": "./output/",
  6. "template_file": "./template/Student.docx"
  7. },
  8. {
  9. "input_file": "./input/teacher.csv",
  10. "output_dir": "./output/",
  11. "template_file": "./template/Teacher.docx"
  12. }
  13. ]
  14. }

Note: the file_name field is necessary in the input_file.