Created
April 30, 2017 12:46
-
-
Save janseeger/4a32142856c2a28099d6ca8dda33c174 to your computer and use it in GitHub Desktop.
Small script that extracts all contacts from a Baikal (http://sabre.io/baikal/) database and writes them into a single vcf file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sqlite3 | |
conn = sqlite3.connect("db.sqlite") | |
c = conn.cursor() | |
f = open("combined.vcf", "wb") | |
for row in c.execute("SELECT carddata FROM cards"): | |
data = row[0].encode("UTF-8") | |
f.write(data + "\n\n") | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment