Office365-rest-python-client

Latest version: v2.5.10

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

Scan your dependencies

Page 8 of 9

2.1.8

Support for _simplified_ methods to authenticate against SharePoint

Now for user credentials flow, instead of


ctx_auth = AuthenticationContext(url=site_url)
ctx_auth.acquire_token_for_user(username,password):
ctx = ClientContext(site_url, ctx_auth)


an authenticated client could be initialized like this:

`ctx = ClientContext.connect_with_credentials(site_url, UserCredential(username,password))`


and for client credentials flow (aka [SharePoint App-Only](https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs)) instead of


ctx_auth = AuthenticationContext(url=site_url)
ctx_auth.acquire_token_for_app(client_id,client_secret):
ctx = ClientContext(site_url, ctx_auth)


like this:

`ctx = ClientContext.connect_with_credentials(site_url, ClientCredential(client_id,client_secret))`



Introduced support for provision modern Team & Communication sites (179)

- GroupSiteManager.create_group_ex - create a [Team site](https://support.office.com/en-us/article/create-a-team-site-in-sharepoint-ef10c1e7-15f3-42a3-98aa-b5972711777d)

- SPSiteManager.create - create a [Communication site](https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest)

Examples

Create a Team Site


client = ClientContext.connect_with_credentials(url,ClientCredential(client_id,client_secret))
site_manager = GroupSiteManager(client)
info = site_manager.create_group_ex("Team Site", "teamsite", True, None)
client.execute_query()


Create a Communication site


client = ClientContext.connect_with_credentials(url,ClientCredential(client_id,client_secret))
site_manager = SPSiteManager(client)
request = SPSiteCreationRequest("CommSite", "https://contoso.sharepoint.com/sites/commsite")
response = site_manager.create(request)
client.execute_query()



Bug fixes and feature requests

- 174 and 28 - a bug which prevented to authenticate successfully with user credentials on not root site collections or a sub sites
- 181 - missing types
- 178 - introduced support for provision modern Team & Communication sites

2.1.7

- Support for SAML-based federated authentication with SharePoint Online

- Bug fixes and feature requests: 170 171

2.1.6

The list of changes:

One Drive API:

- introduced new resources such as `ContentType`, `ColumnDefinition`

- support for [Resumable file upload](https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online)


SharePoint API:

support for chunk file upload, for example:


`

ctx = ClientContext(site_url, ctx_auth)
size_1Mb = 1000000
local_path = "./data/big_buck_bunny.mp4"
target_url = "/Shared Documents"

result_file = ctx.web.get_folder_by_server_relative_url(target_url)
.files.create_upload_session(local_path, size_1Mb, print_upload_progress)
ctx.execute_query()

`

2.1.5

Release changes:


- `GraphClient` client has been introduced for working with Microsoft Graph endpoint
- CAML query builder has been introduced (credit goes to domdinicola)

2.1.4

- introduced support for Introduced support for SharePoint 2010 list data service, `ListDataService` class

- added methods and properties for List, ListItem and Field resources:
- `ListItem.validate_update_listItem` method - Validates and sets the values of the specified collection of fields for the list item.
- `ListItem.system_update` method
- `ListItem.update_overwrite_version` method
- `ListItem.parent_list` navigation property
- `List.fields` navigation property
- `FieldCollection.add` method
- `FieldCollection.get_by_id` method
- `FieldCollection.get_by_internal_name_or_title` method
- `FieldCollection.get_by_title` method
- `Field.update` method
- `Field.delete` method

2.1.3

- Added support for NTLM authentication 110

- Switch context per web 111

All the credit goes to Aisbergg for those changes!

Page 8 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.