Read box files in python

New post

Comments

3 comments

  • Nayak

    Hi , I stongly recommend you to use the Box Python SDK and authenticate (either via JWT approach or 3 legged Oauth2) and get the access token & client connection setup. Post this you can call the List Folder Items & download required files. Hope this helps

    0
    Comment actions Permalink
  • George Avetisyan

    Hey, Nayak. I did try everything you just mentioned above, pandas is not able to read excel files. In fact its not reading any files. When I do pd.read_excel () in the parameter I tried to pass content, link to the file, file id, everything. Its not working. Please let me know what is the problem

    0
    Comment actions Permalink
  • Guy Huinen

     

    from io import StringIO
    import pandas as pd

    file_content = client.file(file_id).content()

    s=str(file_content,'utf-8')

    data = StringIO(s)

    df=pd.read_csv(data)

    0
    Comment actions Permalink

Please sign in to leave a comment.