So I want to create a condition that allows me to read two or more file types in google drive using pydrive. But I don't know where to start.
and I do have this code.
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
spreadsheet_id = '######'
#This is to read spreadsheet file
url = "https://www.googleapis.com/drive/v3/files/" + spreadsheet_id + "/export?mimeType=application%2Fvnd.openxmlformats-officedocument.spreadsheetml.sheet"
res = requests.get(url, headers={"Authorization": "Bearer " + gauth.attr['credentials'].access_token})
#This is to read xlsv
url = "https://www.googleapis.com/drive/v3/files/" + spreadsheet_id + "?alt=media"
res = requests.get(url, headers={"Authorization": "Bearer " + gauth.attr['credentials'].access_token})
# 2. The downloaded XLSX data is read with `pd.read_excel`.
sheet = "Summary"
values = pd.read_excel(BytesIO(res.content), usecols=None, sheet_name=sheet)
print (values)
return ''