Skip to content

Instantly share code, notes, and snippets.

@rjames86

rjames86/Backup Contacts.py Secret

Last active Sep 3, 2015
Embed
What would you like to do?
Backup Contacts.py
import contacts
import sys, os
import console
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')]
from dropboxlogin import get_client
from datetime import datetime
# Update this path here for the backup
# location in your Dropbox account.
BACKUP_PATH = '/Backups/Contacts'
TODAY = datetime.today().strftime('%Y-%m-%d')
dropbox_client = get_client()
VCARD = "".join(person.vcard for person in contacts.get_all_people())
console.clear()
dropbox_client.put_file(BACKUP_PATH + '/contacts {}.vcf'.format(TODAY), VCARD)
print 'Backup complete!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.