def NamedTupleRow(cursor):
 from collections import namedtuple
 attr_names = [x[0] for x in cursor._ColBufferList]
 class Row(namedtuple('Row', attr_names, rename=True), ):
  cursor_description = cursor.description
  def __new__(cls, iterable):
   return super(Row, cls).__new__(cls, *iterable)
 return Row

def NamedTupleRow ( cursor ) : from collections import namedtuple attr_names = [ x [ 0 ] for x in cursor . _ColBufferList ] class Row ( namedtuple ( 'Row' , attr_names , rename = True ) , ) : cursor_description = cursor . description def __new__ ( cls , iterable ) : return super ( Row , cls ) . __new__ ( cls , * iterable ) return Row
named tuple to allow attribute lookup by name .