import sqlite3 connection = sqlite3.connect('~/foo.db') cursor = connection.execute('select * from bar') # cursor.description is the description of columns names = [description[0] for description in cursor.description]