Easy command line mailmerge csv -> pdf tool.
Project description
pdf-mailmerge
Mailmerge to a pdf or html file. Adds csv data to an html jinja template. Can be configured to generate filenames and subdirectories as well as sort order from columns in the csv.
Install
pip install pdf-mailmerge
Usage
Requires a config.yml
file in your directory containing:
data: Some.csv
template: "Some_jinja.html"
identifier_columns:
- "col1"
- "col2"
filename_columns:
- "col3"
- "col4"
output_folders:
- "col1"
- "col5"
sort:
- "col2"
- "col3"
Required Configuration Fields
data
: csv file with the data you wish to mailmerge
template
: jinja template being used for the mailmerge
identifier_columns
: columns used to construct a primary key for the data. If a column already contains the primary key, list it but only it. A mailmerge document will be created for every unique value or unique value combination of the identifier columns.
filename_columns
: columns used to construct the filename for the document. Name will be "col1_col2_" etc.
Optional Configuration Fields
output_folders
: columns used to construct output subdirectories. All files placed in either html
or pdf
directory. Additional folder nesting levels based on order of output folders. Sample file path pdf/col1/col5
.
sort
: columns used to sort documents within their output folder. If multiple options, sort precedence given in order of list.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pdfmailmerge-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e524e9b4804697cbdbf80ae85c05e52e9a904e9f392b13ae61229501c10bf78 |
|
MD5 | e3e6ae6986876c4e6c85e4a400c09f52 |
|
BLAKE2b-256 | abbcebc27f4119398d8375b1b33670f2f73d32e4e314c169e9a28d975fc4fcbd |