I want to access share point using python

Somesh 1 Reputation point
2022-02-24T05:40:00.023+00:00

I wanted to access sharepoint using python
i used shareplum,shrepy, office365 but didnt work.
for Authentication our organization uses "DUO" but when i try to run the below code is shows authencation failure

s.sharepy.connect("url",username,password)
s.save()
if not has attr(s,'cookie):
print('auth failed')
quit()

else:
r=s.getfile(siteurl,filename='testfile')
print(r.status)
print(r.raw)

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-02-24T07:08:44.413+00:00

    Hi @Somesh ,
    You could use Office365-Rest-Python-Client library to access to Sharepoint documents. https://github.com/vgrem/Office365-REST-Python-Client

    Here are some examples about file operations: https://github.com/vgrem/Office365-REST-Python-Client/tree/master/examples/sharepoint/files


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.