pypi Office365-REST-Python-Client 2.3.4
v 2.3.4

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

Changelog

  • SharePoint API: improved support for a file and folders addressing details

  • SharePoint API: support for saving taxonomy columns #353

Example: save a single-valued taxonomy field value

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

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()

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

NewReleases is sending notifications on new releases.