To read a particular sheet you just need to pass it as a parameter to the read_excel function:
excel_object = s3.get_object(Bucket=source_bucket, Key=source_key)['Body'].read()
df_sheet1 = pd.read_excel(excel_object, sheet_name='name_of_sheet1')
df_sheet2 = pd.read_excel(excel_object, sheet_name='name_of_sheet2')
Note: You can also use the 0-based index of the sheet
If you want to extract every sheet, you can get the sheet names using the .sheet_names
property
excel = pd.ExcelFile(s3_client.get_object(Bucket=source_bucket, Key=source_key)['Body'].read())
names = excel.sheet_names
for name in names:
sheet = pd.read_excel(excel, sheet_name=name)
and extract every sheet in a loop.
pandas.read_excel