sqlite_test



In [7]:
import sqlite3

db = sqlite3.connect('extractor_train_dbs/dev_2014-10-23T11_02_21-0400.db')
db.row_factory = sqlite3.Row

cursor = db.cursor()

cursor.execute( "SELECT * from dlannotations" )


Out[7]:
<sqlite3.Cursor at 0x7f11dcebf7a0>

In [22]:
row = cursor.fetchone()
print row
d = dict([ (k, row[k]) for k in row.keys() ])
d.keys()


<sqlite3.Row object at 0x7f11ef8b0850>
Out[22]:
['annotator_name',
 'downloads_id',
 'raw_content',
 'last_updated',
 'annotations_json']