pypi Office365-REST-Python-Client 2.3.14
v 2.3.14

latest releases: 2.5.13, 2.5.12, 2.5.11...
2 years ago

Changelog

Paged data retrieval enhancements, namely:

  1. introduction of ClientObjectCollection.get_all method to retrieve all the items in a collection, regardless of the size, for example:
def print_progress(items):
    """
    :type items: office365.sharepoint.listitems.collection.ListItemCollection
    """
    print("Items read: {0}".format(len(items)))

page_size = 500
ctx = ClientContext(site_url).with_credentials(client_credentials)
large_list = ctx.web.lists.get_by_title(list_title)

all_items = target_list.items.get_all(page_size, print_progress).execute_query()
  1. retrieving paged data via ClientObjectCollection.paged method
page_size = 500

ctx = ClientContext(site_url).with_credentials(client_credentials)
large_list = ctx.web.lists.get_by_title(list_title)
paged_items = large_list.items.paged(page_size, page_loaded=print_progress).get().execute_query()
    for index, item in enumerate(paged_items):  # type: int, ListItem
        print("{0}: {1}".format(index, item.id))

Bug fixes:

  • #541: client certificate auth fails when non root site is provided
  • #529: Python 2.7 compatibility fixes
  • #527: fix for Folder.copy_to_using_path method

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

NewReleases is sending notifications on new releases.