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 5 of 9

2.3.7

Changelog

Bug fixes
- 402 and 387: removed _invalid_ dependency to `generator` module rikeshtailor
- 399: fix for downloading a file
- `Web.get_folder_by_server_relative_path` return type fix sharifhsn

Improvements:
- error handling improvements (in terms of covering network exceptions along with invalid HTTP requests) beliaev-maksim
- improvements for _JSON Batching_ support, for both v3 and [v4](https://docs.microsoft.com/en-us/graph/json-batching) versions

2.3.6

Changelog

General

- a preliminary support for `communications `API has been introduced
- optimizing PyPI package in terms of excluding packages from production (e.g. `tests`)



SharePoint API specific
- upload large files improvements in terms of optimizing of memory consumption (377) beliaev-maksim
- new examples for SharePoint section (293) beliaev-maksim
- Document Set improvements and bug fixes 379
- settings Taxonomy field values fixes 380

OneDrive API specific
- fixes for addressing drive items 374
- improvements in terms of supporting and new nav types and methods for better API coverage, for example:


Example 1: address folder by path, where `archive/2018` is a folder path:

python
folder_item = client.me.drive.root.get_by_path("archive/2018").get().execute_query() type: DriveItem



Teams API specific
- improvements in terms of supporting and new nav types and methods for better API coverage

Examples: list all teams


python
client = GraphClient(acquire_token_by_client_credentials)
teams = client.teams.get_all(["displayName"]).execute_query()
for team in teams: type: Team
print(team.display_name)

2.3.5

Changelog

- general: compatibility with Python 2.7 (related: 326 & 275)
- OneDrive API: improvements and fixes for addressing drive items 276
- Graph client: improvements in terms of error handling for batch request, dependencies updated: `msal` 1.12.0
- SharePoint API: fix for `ListItem.update` method (related 365)
- SharePoint API: better support for addressing resources by resource path
- SharePoint API: batch request improvements, i.e. support for specifying maximum of items to be executed per bulk operations, default is 100 (related: 349)

2.3.4

Changelog

- SharePoint API: improved support for a file and folders addressing [details](https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/supporting-and-in-file-and-folder-with-the-resourcepath-api)

- SharePoint API: support for saving taxonomy columns 353



Example: save a single-valued taxonomy field value

python
ctx = ClientContext(site_url).with_credentials(credentials)

tasks_list = ctx.web.lists.get_by_title("Tasks")
tax_field_value = TaxonomyFieldValue("{term-label}", "{term-guid}")
item_to_create = tasks_list.add_item({
"Title": "New task",
"{tex-column-name}": tax_field_value,
}).execute_query()




Example: save a multi-valued taxonomy field value

python
ctx = ClientContext(site_url).with_credentials(credentials)

tasks_list = ctx.web.lists.get_by_title("Tasks")
tax_field_value = TaxonomyFieldValue("{term-label}", "{term-guid}")
tax_field_values = TaxonomyFieldValueCollection([tax_field_value])
item_to_create = tasks_list.add_item({
"Title": "New task",
"{tex-column-name}": tax_field_values,
}).execute_query()

2.3.3

Changelog

- 339: Introduced browser mode to imitate browser when obtaining the authentication cookies by nsmcan
- API improvements for Fluent interface
- SharePoint Batching API improvements for error handling

2.3.2

Changelog

- 320: escape XML characters in STS request by andreas-j-hauser
- 310: Revert `ClientObject.get_property()` semantics by kraptor
- SharePoint API improvements: 303 (addressing versions of ListItem), `hubsite` namespace, File/Folder copy/move operations
- Graph client: initial support for batching
- improved support for [Calendar API](https://docs.microsoft.com/en-us/graph/api/resources/calendar?view=graph-rest-1.0)


Support for [batching](https://docs.microsoft.com/en-us/graph/json-batching) for Graph client

python

def acquire_token_client_credentials():

authority_url = 'https://login.microsoftonline.com/{tenant}'
app = msal.ConfidentialClientApplication(
authority=authority_url,
client_id='{client-id}',
client_credential='{client-secret}'
)
result = app.acquire_token_for_client(scopes=["https://graph.microsoft.com/.default"])
return result

client = GraphClient(acquire_token_client_credentials)

current_user = self.client.users['{user-principal-name}'].get() 1.1: construct query to retrieve user details
my_drive = self.client.users['{user-principal-name}'].drive.get() 1.2: construct query to retrieve user's drive
client.execute_batch() 2: submit a query to the server

Page 5 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.