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)

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,844 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,964 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,171 Reputation points Microsoft Vendor
    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.