If it is possible, it want to use pyexcel.iget_records().
What I have got now is:-
data = OrderedDict()
raw_data = pyexcel.get_book(file_name='filename.xlsx')
for sheet_name in raw_data.sheet_names():
raw_data[sheet_name].name_columns_by_row(0)
data[sheet_name] = raw_data[sheet_name].to_records()
pyexcel.free_resources()
But .to_records() doesn't seem to be a memory-efficient way as it generates a list, not a generator. Also, why do I have to call raw_data[sheet_name].name_columns_by_row(0) explicitly?