Using data provided on a Google spreadsheet, generate docx files replacing the data.
To replace variables, set them with the name ${variable_name}
on the docx model.
This repo uses python-docx-replace and python-docx
For more info check their documentations.
git clone https://github.com/andrebrener/replace_docx.git
Go in the directory of the repo and run:
pip install -r requirements.txt
touch .env
SHEET_ID
= Google spreadsheet idSHEET_NAME
= Name of the sheet inside google sheetsFILE_NAME_MODEL
= Name of the docx model to replace
- Run docx_replace.py.
- When the script finishes, files will be created under the
results
directory