Microsoft OneDrive
Deepnote can fetch files from OneDrive, for example, Excel files that you collaborate on with your team. Follow these docs to create your own notebook to pull files from OneDrive, query data, and visualize it.
1. Duplicate the OneDrive template
Open the template by following this link ->
Click the "duplicate" button on the top right corner to do this. Once you've got the template in your Deepnote workspace, you can download files from OneDrive.
2. Share files with Deepnote from OneDrive
You need to create a public sharing link so Deepnote can download the file. Follow these instructions from Microsoft making sure that anyone with the link can at least view the file.
Change the variable ONEDRIVE_SHARE_LINK
in the notebook to link to the file you just made.
3. Fetch OneDrive files from Deepnote
The template notebook has a function called get_onedrive_download
, which takes a share link and creates a URL that will download that file directly. You can use a library like requests
to fetch the file or pass it to pandas
to read a CSV or Excel file directly. In the below example, the shared file is an Excel file.
ONEDRIVE_SHARE_LINK = "https://1drv.ms/x/s!AjP7y6eiYDDSafV7BusEaDHrI0o?e=cL0Fqi"
df = pd.read_excel(get_onedrive_download(ONEDRIVE_SHARE_LINK))
df
When executing the code above, Deepnote will visualize the output dataframe, as we see in the example below.
What's next?
Now that you're querying data, you can share it with your team. You can even turn your charts into a shareable dashboard.