how can i use sharepoint (via soap?) from python?

Blauohr picture Blauohr · Oct 20, 2008 · Viewed 12.7k times · Source

I want to use Sharepoint with python (C-Python)

Has anyone tried this before ?

Answer

somewhatoff picture somewhatoff · Mar 23, 2011

I suspect that since this question was answered the SUDS library has been updated to take care of the required authentication itself. After jumping through various hoops, I found this to do the trick:


from suds import WebFault
from suds.client import *
from suds.transport.https import WindowsHttpAuthenticated


user = r'SERVER\user'
password = "yourpassword"
url = "http://sharepointserver/_vti_bin/SiteData.asmx?WSDL"


ntlm = WindowsHttpAuthenticated(username = user, password = password)
client = Client(url, transport=ntlm)