def namedtuple_factory(cursor, row):
    return LanguageRecord(*row)
con = sqlite3.connect(':memory:')
con.row_factory = namedtuple_factory
cur = con.cursor()
cur.execute('select 1,2,3')
print(cur.fetchone())
Mapping result rows to namedtuple in python sqlite