Skip to main content

mailprep converts vCard data into physical labels from SVG templates

Project description

mailprep status

Table of Contents


mailprep converts vCard data into physical labels with a Dymo LabelWriter 4XL.


$ mailprep --help

  --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


System Dependencies


Testing requires pdftotext and tox

$ apt-get install poppler-utils tox

Automatic Tests

Automatic tests can be run via any of the following methods depending on your workflow

$ python test
$ hatch test
$ tox

HitL Tests

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.

Formatted name

{{ 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.

Test data

The vCard test data is from Wikipedia and is licensed as Creative Commons Attribution-ShareAlike.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailprep-0.1.1.tar.gz (11.6 kB view hashes)

Uploaded source

Built Distribution

mailprep-0.1.1-py3-none-any.whl (12.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page