title: Is there a way to write python code to download zip file from github?
body: <p>I am trying to automate data download from github. Assume the file in github is in a zip folder. Is there a way to write a python code to download the entire zip folder?</p>
  
  <p>I have used the request method but it does not work. The code can run without error but the file is clearly smaller than the original file and I cannot open it by double click with error message file is invalide</p>
  
  <pre><code>import requests
  
  URL = 'https://github.com/XYZ/file.zip'
  r = requests.get(url)
  # open method to open a file on your system and write the contents    
  with open("file.zip", "wb") as code:
      code.write(r.content)
  </code></pre>