Skip to main content
Question

Unable to read excel file content from box folder

  • May 23, 2025
  • 5 replies
  • 58 views

Forum|alt.badge.img

Hello,

I am using Python box sdk to read content of an excel file from box folder, but it's not working. Conversion from bytes to string is also not working in this scenario. Although, I am able to read the content of a .txt or .csv file from box. Are there any restriction on excel file? What is the suggested approach to read excel file content?

Thank you

5 replies

Forum|alt.badge.img

To my knowledge, you would have to use a third party library to actually see the contents of a file. The public Box API doesn't programmatically have access to the underlying data within any content. There shouldn't be any restrictions on the Box side from downloading the file and using a third party library to parse through it.


Forum|alt.badge.img

Hi Neha. Have you found a way to read Excel file in Box? I am also running into the same issue. 

Hi Alex,

Is Box encoding Excel files in a different format? I am able to read text and csv files after decoding them to utf-8 format, but that doesnt work with excel file. These excel files would read just fine in local but I wont be able to download them to my local.


Forum|alt.badge.img

I found a way out to read Excel files. This worked for me..

pd.read_excel(io.BytesIO(item.content()))

Forum|alt.badge.img

Hi 14098930624019: I am trying to reed the excel file from box and then parse the data. Is it something you also did?


Forum|alt.badge.img

Yes.. Thats what I did. The below code should help you read the excel file.

    items = client.folder(folder_id=inputfolder).get_items()
  for item in items:
    df= pd.read_excel(io.BytesIO(item.content()))