Skip to main content

mailprep converts vCard data into physical labels from SVG templates

Project description

mailprep

builds.sr.ht status


Table of Contents

Overview

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

Usage

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

Installation

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

Debian

The DYMO printer driver can be installed with

$ apt-get install printer-driver-dymo

Testing

System Dependencies

Debian/Stretch

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 setup.py 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

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.

Address

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

License

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.

Filename, size & hash SHA256 hash help File type Python version Upload date
mailprep-0.1.1-py3-none-any.whl (12.8 kB) Copy SHA256 hash SHA256 Wheel py3
mailprep-0.1.1.tar.gz (11.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page