cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading sharepoint lists using python

tanjil
New Contributor III

Hello,

I am trying to download lists from SharePoint into a pandas dataframe. However I cannot get any information successfully. I have attempted many solution mentioned in stackoverflow. Below is one of those attempts:

# https://pypi.org/project/sharepoint/
 
 
from sharepoint import SharePointSite, basic_auth_opener
  
server_url = "https://teamup.<company_name>.com/"
site_url = server_url + "sites/pt/service/metrics/sitedata/"
opener = basic_auth_opener(server_url, username, password)
site = SharePointSite(site_url, opener)

When the following code is executed I am getting an error:

for sp_list in site.lists:
    print(sp_list.id, sp_list.meta['Title'])

Error generated:

<urlopen error [Errno -2] Name or service not known>

Any help on this issue is greatly appreciated.

Thanks in advance,

Tanjil

1 ACCEPTED SOLUTION

Accepted Solutions

tanjil
New Contributor III

Hello,

I have gotten the code to work by using office365 library instead.

View solution in original post

7 REPLIES 7

Hubert-Dudek
Esteemed Contributor III

Please use sharepy https://pypi.org/project/sharepy/ sharepoint library which you are using wasn't updated since 2015.

Alternative way is to use Azure logic apps and from there save it to Azure Data Lake Storage in format of your choice.

tanjil
New Contributor III

Thank you Hubert for your answer.

However, when running the following line:

s = sharepy.connect(SPUrl,username,password)

I am getting the following error:

'NoneType' object has no attribute 'group'.

User16725394280
Contributor II

Hi ,

Can you check on the below reference documentation and let us know whether it is helpful.

https://docs.microsoft.com/en-us/azure/data-factory/connector-sharepoint-online-list?tabs=data-facto...

Hi @tanjil​ ,

Did you check @Kiran Bharathi​ docs? do you still need help?

User16725394280
Contributor II

Hi Tanjil,

Kindly check and update us in case you have any further queries on this.

tanjil
New Contributor III

Hello,

I have gotten the code to work by using office365 library instead.

jessykoo32
New Contributor II

Hello tanjil,

I am new here and I need that code Please Help me. MyAccountAccess Rewards

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.