Table of Contents
mailprep converts vCard data into physical labels with a Dymo LabelWriter 4XL.
$ mailprep --help
Usage: mailprep [OPTIONS] VCF_FILEPATH [TEMPLATE_FILEPATH]
Options:
--printer TEXT Printer Name
--count INTEGER number of labels to print
--simulate Generate output PDF without printing
--help Show this message and exit.
The default template is designed for 2.25" × 1.25" Uline S-12996 labels.
mailprep is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 3.5+ and PyPy.
$ pip install mailprep
The DYMO printer driver can be installed with
$ apt-get install printer-driver-dymo
Testing requires pdftotext
and tox
$ apt-get install poppler-utils tox
Automatic tests can be run via any of the following methods depending on your workflow
$ python setup.py test
$ hatch test
$ tox
Human/Hardware in the Loop tests can be run manually if xdg-open
can find a pdf reader and a printer is connected.
$ hatch test --test-args "--hitl"
$ tox -- --hitl
Templates are stored as SVG and are evaluated using the Moustache template syntax. Currently the template processing is US-centric, but pull requests and test data is appreciated.
{{ fn }}
in the template is replaced with the formatted name from the vCard.
Currently mailprep
generate labels from the vCard ADR Type Definition. In the future it may make more sense to use the LABEL Type Definition but it is unclear which produced more consistent results.
{{ adr_street }}
{{ adr_city }}, {{ adr_region }}
{{ adr_code }}
mailprep is distributed under the terms of both
at your option.
The vCard test data is from Wikipedia and is licensed as Creative Commons Attribution-ShareAlike.