Office365-rest-python-client

Latest version: v2.5.9

Safety actively analyzes 629765 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 9

2.3.1

Changelog

Summary:

- improved support for SharePoint API (`fields`, `tenants` namespaces)
- bug fixes: 303 , 302 and 265


Improved support for SharePoint API

Here are a few examples which demonstrate how to create field and set values for a different field types:

Create a multi lookup field:


lookup_field = list.fields.add_lookup_field(title=lookup_field_name,
lookup_list_id=lookup_list.properties['Id'],
lookup_field_name='Title',
allow_multiple_values=True).execute_query()



Set a multi lookup field value


field_value = FieldMultiLookupValue()
field_value.add(FieldLookupValue(lookup_id))
updated = item_to_update.set_property(lookup_field_name, field_value).update().execute_query()


The list of methods (`fields` namespace):

- `FieldCollection.add_url_field(title)`
- `FieldCollection.add_lookup_field(title, lookup_list_id, lookup_field_name, allow_multiple_values)`
- `FieldCollection.add_choice_field(title, values, multiple_values)`
- `FieldCollection.create_taxonomy_field(name, ssp_id, term_set_id, anchor_id,field_id, text_field_id, web_id, list_id)`


The list of methods (`tenant` namespace):

- `Tenant.get_site_health_status(site_url)`

2.3.0.1

Changelog

- `requests_ntlm` is included as an optional dependency
- `README.md` broken links resolved

2.3.0

Changelog

- improvements for SAML-based claims authentication, kudos to wreiner for the implementation and nsmcan for the proposal 297, 272
- support for and % in SharePoint Online and OneDrive for Business by kraptor 300
- support for optional arguments for `FileCollection.create_upload_session` method by beliaev-maksim 289
- migration from `adal` library to `msal` as a mandatory dependency 296
- improved support for `sharepoint` namespace, new types and methods (`Tenant`, `ViewField`, `ContentType` classes)
- migration from Outlook API v1.0 to Microsoft Graph. Note: `OutlookClient` is decommissioned and no longer available

2.2.2

Changelog

- Migration from [Azure Active Directory Authentication Library (ADAL)](https://github.com/AzureAD/azure-activedirectory-library-for-python) to use the [Microsoft Authentication Library (MSAL)](https://github.com/AzureAD/microsoft-authentication-library-for-python) library as a _mandatory_ dependency
- Bug fixes: 278 - escape special characters in xml
- SharePoint API: support for creating fields from schema xml, methods: `FieldCollection.create_field_as_xml`, `FieldCollection.create_taxonomy_field`

2.2.1

Changelog

- Improved support for [SharePoint API Batch requests](https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/make-batch-requests-with-the-rest-apis)

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


- API improvements for [Fluent interface](https://en.wikipedia.org/wiki/Fluent_interface#Python), for example, instead:


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

2.2.0

Changelog

Finally the initial support for [SharePoint API Batch requests](https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/make-batch-requests-with-the-rest-apis) has been introduced. All insert/update/delete operations are supported.

The following example how current user and web objects could be retrieved by grouping two operations and submitting it as a single request to the server:


client = ClientContext(site_url).with_credentials(user_credentials)
current_user = client.web.currentUser
client.load(current_user)
current_web = client.web
client.load(current_web)
client.execute_batch()


which offers a new way of improving the performance.

Among another improvements and changes:

- improved support for Office365 auth with ADFS by liuliqiu

- style enforcement (`flake8`), code formatting (`isort`) configuration by domdinicola

- `ClientRuntimeContext.execute_query_retry` method which implements [Retry pattern](https://docs.microsoft.com/en-us/azure/architecture/patterns/retry)

Page 6 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.