

To use those libraries, first, we have to install them pip install py-topping pip install Office365-REST-Python-ClientĪfter that it just about Python Coding *I changed function name from “da_tran_SP365” into “lazy_SP365” # Import library from py_topping.data_connection.sharepoint import lazy_SP365 # Create connection sp = lazy_SP365(site_url = 'Your Site URL', client_id = 'Your ID', client_secret = 'Your Secret') # Create download path from download URL download_path = sp.create_link('Your Download File Link') # Download file sp.download(sharepoint_location = download_path, local_location = 'local directory you want to save')Īnd Done!, you already downloaded your file with python.

This library can interact with SharePoint by the build upon a great library called “Office365-REST-Python-Client”, you could read more about both libraries at the end of this article You dont have to, but you cant save the file in CSV and retain the code in it. I did save your file as XLSB instead of CSV to run the code. Those changes make it work just fine for me using the below code. The downloaded data can be stored as a variable and/or saved to a local drive as a file. We will use my custom library “py_topping”. Adjust the URL of the file, which would be found in the NameParts () array instead of the Values () array. A Python can be used to download a text or a binary data from a URL by reading the response of a.
