title: How to read file using sharepoint REST API in Python
body: <p>I am an absolute beginner when it comes to working with REST APIs with python. We have received a share-point URL which has multiple folders and multiples files inside those folders in the 'document' section. I have been provided an 'app_id' and a 'secret_token'.</p>
  <p>I am trying to access the .csv file and read them as a dataframe and perform operations.
  The code for operation is ready after I downloaded the .csv and did it locally but I need help in terms of how to connect share-point using python so that I don't have to download such heavy files ever again.</p>
  <p>I know there had been multiple queries already on this over stack-overflow but none helped to get to where I want.</p>
  <p>I did the following and I am unsure of what to do next:</p>
  <pre><code>import json
  from office365.runtime.auth.user_credential import UserCredential
  from office365.sharepoint.client_context import ClientContext
  from office365.runtime.http.request_options import RequestOptions
  
  site_url = &quot;https://&lt;company-name&gt;.sharepoint.com&quot;
  ctx = ClientContext(site_url).with_credentials(UserCredential(&quot;{app_id}&quot;, &quot;{secret_token}&quot;))
  </code></pre>
  <p>Above for site_url, should I use the whole URL or is it fine till ####.com?</p>
  <p>This is what I have so far, next I want to read files from respective folders and convert them into a dataframe? The files will always be in .csv format</p>
  <p>The example hierarchy of the folders are as follows:</p>
  <p>Documents --&gt; Folder A, Folder B</p>
  <p>Folder A --&gt; a1.csv, a2.csv</p>
  <p>Folder B --&gt; b1.csv, b2.csv</p>
  <p>I should be able to move to whichever folder I want and read the files based on my requirement.</p>
  <p>Thanks for the help.</p>