How to obtain sheet names from XLS files without loading the whole file?

you can use the xlrd library and open the workbook with the “on_demand=True” flag, so that the sheets won’t be loaded automaticaly.

Than you can retrieve the sheet names in a similar way to pandas:

import xlrd
xls = xlrd.open_workbook(r'<path_to_your_excel_file>', on_demand=True)
print xls.sheet_names() # <- remeber: xlrd sheet_names is a function, not a property

Leave a Comment