Instantly share code, notes, and snippets.

What would you like to do?
Export contacts from Nokia Suite
import sqlite3
import json
conn = sqlite3.connect('c:\\Users\\Martin\\AppData\\Local\\Nokia\\Nokia Data Store\\DataBase\\MDataStore.db3')
data = {}
cursor = conn.execute("select * from contact")
rows = cursor.fetchall()
getRowData = lambda r : ' '.join([x if x else '' for x in r]).strip()
for row in rows:
data[getRowData(row[1:6])] = getRowData(row[6:-1])
print(json.dumps(data, ensure_ascii=False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment