Docx file validator based on python-docx
- Clone validocx:
git clone https://github.com/tivaliy/validocx.git
- Create isolated Python environment
virtualenv venv
and activate itsource venv/bin/activte
- Install
validocx
with all necessary dependencies:
pip install -r requirements.txt .
- Specify file with requirements in YAML or JSON format
---
styles:
heading1:
font:
unit: pt
attributes:
- 12.0
- cs_bold
- Times New Roman
paragraph:
unit: cm
attributes:
alignment: 0
sections:
- unit: cm
attributes:
right_margin: 4.4
start_type: 2
top_margin: 5.2
footer_distance: 4.1
header_distance: 0.0
left_margin: 4.4
bottom_margin: 5.2
orientation: 0
page_height: 29.7
page_width: 21.0
- Run validation from CLI:
usage: validocx [-h] -r REQUIREMENTS [--log-file LOG_FILE] [-q | -v] docx-file
- positional arguments:
- docx-file Docx file to be validated.
- optional arguments:
-h, --help show this help message and exit -r REQUIREMENTS, --requirements REQUIREMENTS File with the requirements. In YAML or JSON format. --log-file LOG_FILE Log file to store logs. -q, --quiet Decrease output verbosity. -v, --verbose Increase output verbosity.