Skip to main content
Question

Pandas is not working when trying read excel or csv files from box

  • May 22, 2025
  • 5 replies
  • 11 views

Forum|alt.badge.img
Hi, please help me I' struggling 2 days and I can't find the way how to read files (xlsx and csv) from box fokder. I tired everything: got the file id, , did pd.read-excel (file_id) , I tried passing file.content into read_excel() still didn't work, I treid to pass shareable link , again, it didn't work! All authentications are fine, and I do get access to box, but when I read fike I'm getting None object . What should I do? How to pull the data oit and make my pandas able to read it?

5 replies

Forum|alt.badge.img

I believe I have a similar problem here. Is the raw file in box pathable outside of box, i.e. can it be referenced?


Forum|alt.badge.img

Yes it definitely can :
1) url shared link (which will go derectly to the file and will give you file open the link will contain boxdomain/file/file_id + bunch of characters associated with the fike

2) second option will NOT open the file . You can reference as boxdomain/folder/folderid . If you do that way , it will simply direct you to the folder where the file resides.
Out of these 2 ways, the first one I think is what you was asking right ?


Forum|alt.badge.img

The shared link does send you to the file location, but it isn't the raw file. The pic below is an example of a shared link from box. However, if you use this link to a gist you can access the raw file in the browser, which will send you to this page Effectively, you can path to this raw file. I see now way of accessing the raw file from box. I've made a post about it, so hopefully it can get answered to some degree. Ideally, we need the boxdomain/file/file_id + token/file.csv I believe that is why you are getting None types in your pandas read function, because the raw file isn't actually being read, i.e. there is nothing there as far as a csv/excel file goes.BOX__IocZkisLVyLzyAaOhOrjNw.png


Forum|alt.badge.img

So basically after the token that shared url generated + name of the file ? Is that correct ?
Url shared link + file name


Forum|alt.badge.img

The problem is if you add a /filename to the url it doesn't take you to the raw file. However, the raw file is parsed in their js scripts. You can inspect the page and see papa parse and stuff being jqueried. So the raw file is somewhere, but we as users don't have an obvious way of accessing it for references or inputs for functions as you are doing.