Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
neldarov
Frequent Visitor

get data from sharepoint folder/link using python script

I need to have a new script in Power BI and let it read all files that I have inside this folder. How can I do that? What is folder in sharepoint?

The most simple code to do this task:

 

import pandas as pd

 

# data loading and processing
path = "C:\\Users\\nelda\\Documents\\Projects\\project1\\dataset.csv"
dataset = pd.read_csv(path)

 

However I am not sure how to do that for sharepoint.

3 REPLIES 3
Greg_Deckler
Super User
Super User

Potentially could just use the web url for the file in SharePoint. Otherwise, perhaps this will be of assistance:

https://stackoverflow.com/questions/20945822/how-to-access-a-sharepoint-site-via-the-rest-api-in-pyt...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks but that doesn't work, 403 error message. That actually does not work for many people.

in the sharepoint folder there is an option to select "Sync". This creates a folder in your computer. You can use that folder to create a path like you would with any other folder located in your computer

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.