'Add item to SharePoint list”翻译为“添加项目至SharePoint列表”,可以使用以下代码示例:
from shareplum import Site
from shareplum import Office365
from shareplum.site import Version
username = 'username@domain.com'
password = 'password'
site_name = 'sharepoint_site_name'
doc_library = 'document_library'
authcookie = Office365(site_name, username=username, password=password).GetCookies()
site = Site('https://' +site_name+ ".sharepoint.com/sites/" +doc_library+ '/', version=Version.v365, authcookie=authcookie)
data = {'Title': 'New item', 'Description': 'Description of new item'}
list_name = 'List Name'
sp_list = site.List(list_name)
sp_list.AddListItems(data)