Some scripts to link the two worlds: Spreadsheets (OpenDocumentXML) and vCards.
The code is built upon the two libraries openpyxl and vobject.
I was asked if it is possible to convert a Excel based contacts list to business cards, as you know them from mobile phones. In the internet I found no tool, which does not mean that there is none. So I started to practice something with python.
The column layout of our sample file:
A | B | C | D | E | F | G | H | I |
---|---|---|---|---|---|---|---|---|
Name | Address | Mobile phone | Home phone | Work phone | Mail address | Birthday | Group | Notes |
World, Hello | Street, zipcode city | +1234 | +1234 | +1234 | [email protected] | Excel date value | A | lorem ipsum |
2nd Street, another city |
The address value could have multiple formats:
- city
- street, city
- street, zipcode city
The birthday value could be a Excel datetime or only a date without year in the german "dd.mm." format.
If a row has no name value the script guess, that the data belongs to the previous row and combines boths records.
After processing the first data row from the example table the rendered vCard could look like:
Note: Because I live in Germany, my script prefixes phone numbers with +49. You could change it to your home country.