Extract CSV from a shared contacts folder by command line
Jan Kowalsky
jankow at datenkollektiv.net
Sat Apr 25 20:05:57 CEST 2015
Hi Alberto,
Am 20.04.2015 um 18:18 schrieb alby87 at inwind.it:
> Hi! May ask you a thing? I have the need to create a CSV from a contact shared folder every n days, so I would like to cron-ize it, but I need a script to do this.
>
> I've seen that the files are simple XML, it shouldn't be hard to create this script, but if there is some already made script it would be great. Thank you!
> Alberto
In principal you have possibilities to start: you can use the
imap-objects: then you have this xml files.
The other way would be to use the iRony CardDav functionality.
I just had to go the opposite direction: push the contacts stored in a
mysql-Database as vcards to the kolab addressbook. For this I wrote a
script for generating vcards for each contact from mysql.
Then I used the python vdirsyncer to synchronize my local vcard storage
with the iRony Server.
Have a look at https://vdirsyncer.readthedocs.org/en/stable/
This works very well. Maybe also for you this approach is simpler then
the way through the imap objects.
Just sync the kolab addressbook to a local storage and convert the vcard
files to an csv. The last should be very simple - there are even ready
examples in the www.
But if you choose the other way, offlineimap could be interesting:
http://offlineimap.org/
Maybe it's possible also to use the download link - but you have to have
a authenticated session for this:
https://mail.example.org/webmail/?_task=addressbook&_source=Contacts&_action=export
Best regards
Jan
More information about the users
mailing list