Skip to content

Instantly share code, notes, and snippets.

@martinmev
Created June 1, 2014 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinmev/444619fbdec82864a025 to your computer and use it in GitHub Desktop.
Save martinmev/444619fbdec82864a025 to your computer and use it in GitHub Desktop.
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])
cursor.close()
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