WeasyMerge is a utility for doing mail merges from a CSV file to multiple PDF files. The PDF is generated by WeasyPrint and templates can be built using HTML and CSS with Jinja2 templating.
weasymerge.py --data guests.csv --template invite.html.j2 --output "pdfs/Invite {row_number} {row[Name]}.pdf"The first row of the CSV file is assumed to be the header row and the header is used as the key for the row dictionary.
HTML escaping is on by default in the Jinja2 template.
The row number for the first data row is 1.
WeasyMerge provides "safe" row data to the output filename template (ASCII letters, digits, space, underscore, hyphen, and dot). Non-ASCII letters are converted to their closest ASCII equivalent.