I have to make jupyter notebook that can be manualy used to upload .ods files and see it in I can read xlsx files, but have troubles with ods: i get errors or null df. How can i read ods file from bytes? Is it possible?
uploader = widgets.FileUpload(
accept='.xlsx, .ods' ,
multiple=True # True to accept multiple files upload else False
)
display(uploader)
df = pd.DataFrame()
for i in uploader.value:
uploaded_file = uploader.value[0]
bytes_data = uploaded_file['content']
bytes_data = uploaded_file['content'].tobytes()
data = BytesIO(bytes_data)
try:
df = pd.read_excel(bytes_data)
except:
##bytes_data = bytes_data.encode('utf-8')
df = read_ods(bytes_data)