This simple Python script allows you to import Google Contacts into your /e/ cloud account while preserving contact photos.
- Go to your Google Contacts.
- Export your contacts as vCard (for iOS Contacts) into
contacts.vcf
. - Run this script as
e-vcard-gmail.py contacts.vcf contacts-e.vcf
. - Go to your /e/ cloud and import
contacts-e.vcf
.
If you already migrated your contacts, you can convert only those contacts
that have a photo on Google Contacts. Use option --with-photo
. After
importing, contacts have to be merged manually.
usage: e-vcard-gmail.py [-h] [-n] [-p] filein fileout
positional arguments:
filein input vCard file
fileout output vCard file
optional arguments:
-h, --help show this help message and exit
-n, --dry-run do not download anything
-p, --with-photo filter out contacts without photo
vCard v2.1 (exported from old Android phones) is not supported. Please, consider convertining it with Jochen Welle's vcard2to3.
Google vCards provides contact photos as URLs which can be downloaded without any account login. On the other hand, /e/ accepts photos encoded with Base64.
For each vCard, this script downloads the photo, encodes it, and writes it to the output file, properly handling long lines (which start with a blank).