pypi Office365-REST-Python-Client 2.2.1
v 2.2.1

latest releases: 2.5.11, 2.5.10, 2.5.9...
3 years ago

Changelog

Here is the comparison of two approaches, in the first example update operation is submitted to server per every list item, while in the second one multiple list item update operations are submitted via a since (batch) request:

list_tasks = ctx.web.lists.get_by_title("Tasks")
items = list_tasks.items.get().execute_query() #  
for task_id, item in enumerate(items):
    task_prefix = str(randint(0, 10000))
    item.set_property("Title", f"Task {task_prefix}")
    item.update()
    ctx.execute_query()  #  <- update operation is submitted to server per every  list item
list_tasks = ctx.web.lists.get_by_title("Tasks")
items = list_tasks.items.get().execute_query()   
for task_id, item in enumerate(items):
    task_prefix = str(randint(0, 10000))
    item.set_property("Title", f"Task {task_prefix}")
    item.update()
ctx.execute_batch()   # <- construct a single (batch) for all list items and submit to server
   list = client.web.lists.get_by_title(list_title)
   list.delete_object()
   client.execute_query()

list delete operation could be constructed and submitted to a server in a more compact manner:

   client.web.lists.get_by_title(list_title).delete_object().execute_query()
  • SharePoint API Changes namespace improvements (#259), here is the list of operations:

    • Site.get_changes
    • Web.get_changes
    • List.get_changes
    • ListItem.get_changes
  • SharePoint API RecycleBin entity class and operations

Don't miss a new Office365-REST-Python-Client release

NewReleases is sending notifications on new releases.