mailprep converts vCard data into physical labels from SVG templates
Project description
mailprep
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mailprep-0.1.1.tar.gz.
File metadata
- Download URL: mailprep-0.1.1.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81f3cf01d50bc12378ba81dc4b2c80089a60d3df0624f60ae371a723325c9717
|
|
| MD5 |
9833e6633530939593d245b1ca130d2c
|
|
| BLAKE2b-256 |
5c6906a7876788da1167072b7fe0082e70f89e2a261bd3d2d78b8116a63538de
|
File details
Details for the file mailprep-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mailprep-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ece3994743c96c0a53dbc7a301cf3ce3a2f3acead4226996cedeabdad437713b
|
|
| MD5 |
21d41eaac3c91201626b70f5ee86bc02
|
|
| BLAKE2b-256 |
4d0d300873422a2e126a54fa3e274c691b0f20ad22e3bde7e87aa70dcf646f54
|