title: download sharepoint 365 document using python
body: <p>I am trying to automate the download of sharepoint office 365 files using Python.
  I found the following client
  <a href="https://github.com/vgrem/Office365-REST-Python-Client" rel="nofollow noreferrer">https://github.com/vgrem/Office365-REST-Python-Client</a></p>
  
  <p>However my requirement is to use a simple client that uses a clientid and secret to grab a acesses token and then download the file.</p>
  
  <p>If you understand OAuth2 then this flow is called client credential grant.
  But when i go through the Python Client in the examples section i see</p>
  
  <pre><code>settings.py
  settings = {
      'url': 'https://mediadev20.sharepoint.com/sites/contoso',
      'username': 'mattim@mediadev20.onmicrosoft.com',
      'password': 'P@ssw0rd'
  }
  
  app_settings = {
      'url': 'https://mediadev20.sharepoint.com/sites/contoso',
      'client_id': '99cbd1a9-ec8d-4e89-96c3-699993089d65',
      'client_secret': 'VMdT8mOurDhsvG8yDnP3yFg',
      'redirect_url': 'https://github.com/vgrem/Office365-REST-Python-Client/'
  }
  </code></pre>
  
  <p>My problem is i do not know what to with the redirect_url as mine is a standalone client and there is no redirect_url as such.</p>
  
  <p>Does anyone have a sample code or a pointer on how i can use that library without using redirect_url ?</p>