Get a SharePoint List Using Python

I am trying to find any possible way to get a SharePoint list in Python. I was able to connect to SharePoint and get the XML data using the Rest API through this video: https://www.youtube.com/watch?v=dvFbVPDQYyk ... but not sure how to get the list data in python. The ultimate goal is to get SharePoint data daily and import it into SSMS.

Here is what I still ..

import requests
from requests_ntlm import HttpNtlmAuth
url='URL would go here'
username='username would go here'
password='password would go here'
r=requests.get(url, auth=HttpNtlmAuth(username,password),verify=False)

I believe these will be the next steps. I really need only help in getting data from SharePoint in Excel / CSV format, and everything should be fine from there. But any recommendations would be helpful.

#PARSE XML VIA REST API
#PRINT INTO DATAFRAME AND CONVERT INTO CSV
#IMPORT INTO SQL SERVER
#EMAIL RESULTS
+5
source share
3

Python SharePoint Online:

On-prem SharePoint .

+1

, ( , , ), SharePlum. , SharePoint.

, , csv, SQL Server .

, .

+1
from shareplum import Site
from requests_ntlm import HttpNtlmAuth

server_url = "https://sharepoint.xxx.com/"
site_url = server_url + "sites/org/"

auth = HttpNtlmAuth('xxx\\user', 'pwd')
site = Site(site_url, auth=auth, verify_ssl=False)
sp_list = site.List('list name in my share point')
data = sp_list.GetListItems('All Items', rowlimit=200)
+1

Source: https://habr.com/ru/post/1672719/


All Articles