Sharepoint¶
-
class
O365.sharepoint.
Sharepoint
(*, parent=None, con=None, **kwargs)[source]¶ Bases:
O365.utils.utils.ApiComponent
A Sharepoint parent class to group functionality
-
__init__
(*, parent=None, con=None, **kwargs)[source]¶ A Sharepoint site List
- Parameters
parent (Account) – parent object
con (Connection) – connection to use if no parent specified
protocol (Protocol) – protocol to use if no parent specified (kwargs)
main_resource (str) – use this resource instead of parent resource (kwargs)
-
get_site
(*args)[source]¶ Returns a sharepoint site
- Parameters
args –
It accepts multiple ways of retrieving a site:
get_site(host_name): the host_name: host_name ej. ‘contoso.sharepoint.com’ or ‘root’
get_site(site_id): the site_id: a comma separated string of (host_name, site_collection_id, site_id)
get_site(host_name, path_to_site): host_name ej. ‘contoso. sharepoint.com’, path_to_site: a url path (with a leading slash)
get_site(host_name, site_collection_id, site_id): host_name ej. ‘contoso.sharepoint.com’
- Return type
-
-
class
O365.sharepoint.
SharepointList
(*, parent=None, con=None, **kwargs)[source]¶ Bases:
O365.utils.utils.ApiComponent
-
__init__
(*, parent=None, con=None, **kwargs)[source]¶ A Sharepoint site List
- Parameters
parent (Site) – parent object
con (Connection) – connection to use if no parent specified
protocol (Protocol) – protocol to use if no parent specified (kwargs)
main_resource (str) – use this resource instead of parent resource (kwargs)
-
create_list_item
(new_data)[source]¶ Create new list item
- Parameters
new_data – dictionary of {‘col_name’: col_value}
- Return type
-
delete_list_item
(item_id)[source]¶ Delete an existing list item
- Parameters
item_id – Id of the item to be delted
-
get_items
(limit=None, *, query=None, order_by=None, batch=None)[source]¶ Returns a collection of Sharepoint Items :param int limit: max no. of items to get. Over 999 uses batch. :param query: applies a filter to the request. :type query: Query or str :param order_by: orders the result set based on this condition :type order_by: Query or str :param int batch: batch size, retrieves items in
batches allowing to retrieve more items than the limit.
- Returns
list of Sharepoint Items
- Return type
list[SharepointListItem] or Pagination
-
list_column_constructor
¶ alias of
SharepointListColumn
-
list_item_constructor
¶ alias of
SharepointListItem
-
-
class
O365.sharepoint.
SharepointListColumn
(*, parent=None, con=None, **kwargs)[source]¶ Bases:
O365.utils.utils.ApiComponent
A Sharepoint List column within a SharepointList
-
class
O365.sharepoint.
SharepointListItem
(*, parent=None, con=None, **kwargs)[source]¶ Bases:
O365.utils.utils.ApiComponent
-
__init__
(*, parent=None, con=None, **kwargs)[source]¶ A Sharepoint ListItem within a SharepointList
- Parameters
parent (SharepointList) – parent object
con (Connection) – connection to use if no parent specified
protocol (Protocol) – protocol to use if no parent specified (kwargs)
main_resource (str) – use this resource instead of parent resource (kwargs)
-
-
class
O365.sharepoint.
Site
(*, parent=None, con=None, **kwargs)[source]¶ Bases:
O365.utils.utils.ApiComponent
A Sharepoint Site
-
__init__
(*, parent=None, con=None, **kwargs)[source]¶ A Sharepoint site List
- Parameters
parent (Sharepoint) – parent object
con (Connection) – connection to use if no parent specified
protocol (Protocol) – protocol to use if no parent specified (kwargs)
main_resource (str) – use this resource instead of parent resource (kwargs)
-
create_list
(list_data)[source]¶ Creates a SharePoint list. :param list_data: Dict representation of list. :type list_data: Dict :rtype: list[SharepointList]
-
get_default_document_library
(request_drive=False)[source]¶ Returns the default document library of this site (Drive instance)
- Parameters
request_drive – True will make an api call to retrieve the drive data
- Return type
-
get_document_library
(drive_id)[source]¶ Returns a Document Library (a Drive instance)
- Parameters
drive_id – the drive_id to be retrieved.
- Return type
-
get_list_by_name
(display_name)[source]¶ Returns a sharepoint list based on the display name of the list
-
get_lists
()[source]¶ Returns a collection of lists within this site
- Return type
list[SharepointList]
-
list_constructor
¶ alias of
SharepointList
-