Город МОСКОВСКИЙ
00:06:41

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

Аватар
Учим Ремонтировать
Просмотры:
26
Дата загрузки:
22.09.2023 11:36
Длительность:
00:06:41
Категория:
Технологии и интернет

Описание

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/blob/master/pdoc.py
template = https://github.com/DrPi101/Python/blob/master/template.docx

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 :
https://youtu.be/7WuHWiI9okM

!! See the new version of this video for 2021 : https://youtu.be/_jGVv_rvla8

#word #csv #python

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

Рекомендуемые видео