Dynamically make docx files from a template | Data from CSV | docxtpl

Published: 04 March 2020
on channel: Python 360
2,419
29

Dynamically make docx files from a word doc template.
Each file is unique based on data from CSV

pip install docxtpl

As per previous video - except now fully working and getting the data from a csv - 1 row in the csv produces 1 docx file with those values.
To use this yourself you need :

1 x docx file to use as a "Template" +
1 x csv file with column names that match the {{txt}} txt in the braces.
1 x python code used here, get it from Github.

Make the template from scratch, or tweak an existing file. Same applies to the csv.

Then install "pip3 install docxtpl" (https://pypi.org/project/docxtpl/).
Big thankyou to Eric Lapouyade who made the module.

100 word docs in no time. What's all the fuss about!
I'll obviously say I made them all manually....

source code = https://github.com/DrPi101/Python/blo...
template = https://github.com/DrPi101/Python/blo...

ScraperAPI - promo code:
------------------------------------------
⭕ 10% off ScraperAPI : https://www.scraperapi.com?fpr=ken49
✅ Coupon Code: DRPI10

If you want to see how to web scrape a site heavy on JavaScript have a look at this video :
⭕    • Scraping Dynamic Sites with Scraper A...  

!! See the new version of this video for 2021 :    • Word DOCX From Template | Python  

#word #csv #python

Buy Dr Pi a Coffee...or Tea! : https://www.buymeacoffee.com/DrPi


Watch video Dynamically make docx files from a template | Data from CSV | docxtpl online, duration hours minute second in high quality that is uploaded to the channel Python 360 04 March 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,419 times and liked it 29 visitors.