code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def download_contents(self, to_folder=None): """ This will download each file and folder sequentially. Caution when downloading big folder structures :param drive.Folder to_folder: folder where to store the contents """ if to_folder is None: try: to_fo...
This will download each file and folder sequentially. Caution when downloading big folder structures :param drive.Folder to_folder: folder where to store the contents
download_contents
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def upload_file( self, item, item_name=None, chunk_size=DEFAULT_UPLOAD_CHUNK_SIZE, upload_in_chunks=False, stream=None, stream_size=None, conflict_handling=None, file_created_date_time: str = None, fi...
Uploads a file :param item: path to the item you want to upload :type item: str or Path :param item_name: name of the item on the server. None to use original name :type item_name: str or Path :param chunk_size: Only applies if file is bigger than 4MB or upload_in_chunks is Tru...
upload_file
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """ Create a drive representation :param parent: parent for this operation :type parent: Drive or Storage :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no paren...
Create a drive representation :param parent: parent for this operation :type parent: Drive or Storage :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use...
__init__
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def get_root_folder(self): """ Returns the Root Folder of this drive :return: Root Folder :rtype: DriveItem """ if self.object_id: # reference the current drive_id url = self.build_url( self._endpoints.get('get_root_item').format(id=self.o...
Returns the Root Folder of this drive :return: Root Folder :rtype: DriveItem
get_root_folder
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def get_item(self, item_id): """ Returns a DriveItem by it's Id :return: one item :rtype: DriveItem """ if self.object_id: # reference the current drive_id url = self.build_url( self._endpoints.get('get_item').format(id=self.object_id, ...
Returns a DriveItem by it's Id :return: one item :rtype: DriveItem
get_item
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def get_item_by_path(self, item_path): """ Returns a DriveItem by it's absolute path: /path/to/file :return: one item :rtype: DriveItem """ if not item_path.startswith("/"): item_path = "/" + item_path if self.object_id: # reference the current d...
Returns a DriveItem by it's absolute path: /path/to/file :return: one item :rtype: DriveItem
get_item_by_path
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def get_special_folder(self, name): """ Returns the specified Special Folder :return: a special Folder :rtype: drive.Folder """ name = name if \ isinstance(name, OneDriveWellKnowFolderNames) \ else OneDriveWellKnowFolderNames(name.lower()) name =...
Returns the specified Special Folder :return: a special Folder :rtype: drive.Folder
get_special_folder
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def refresh(self): """ Updates this drive with data from the server :return: Success / Failure :rtype: bool """ if self.object_id is None: url = self.build_url(self._endpoints.get('default_drive')) else: url = self.build_url( self...
Updates this drive with data from the server :return: Success / Failure :rtype: bool
refresh
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """ Create a storage representation :param parent: parent for this operation :type parent: Account :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent speci...
Create a storage representation :param parent: parent for this operation :type parent: Account :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use this r...
__init__
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def get_default_drive(self, request_drive=False): """ Returns a Drive instance :param request_drive: True will make an api call to retrieve the drive data :return: default One Drive :rtype: Drive """ if request_drive is False: return Drive(con=self.c...
Returns a Drive instance :param request_drive: True will make an api call to retrieve the drive data :return: default One Drive :rtype: Drive
get_default_drive
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def get_drive(self, drive_id): """ Returns a Drive instance :param drive_id: the drive_id to be retrieved :return: Drive for the id :rtype: Drive """ if not drive_id: return None url = self.build_url( self._endpoints.get('get_drive').form...
Returns a Drive instance :param drive_id: the drive_id to be retrieved :return: Drive for the id :rtype: Drive
get_drive
python
O365/python-o365
O365/drive.py
https://github.com/O365/python-o365/blob/master/O365/drive.py
Apache-2.0
def __init__(self, *, parent=None, con=None, persist=True, **kwargs): """Create a workbook session object. :param parent: parent for this operation :param Connection con: connection to use if no parent specified :param Bool persist: Whether or not to persist the session changes ...
Create a workbook session object. :param parent: parent for this operation :param Connection con: connection to use if no parent specified :param Bool persist: Whether or not to persist the session changes
__init__
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def prepare_request(self, kwargs): """If session is in use, prepares the request headers and checks if the session is expired. """ if self.session_id is not None: actual = dt.datetime.now() if (self.last_activity + self.inactivity_limit) < actual: ...
If session is in use, prepares the request headers and checks if the session is expired.
prepare_request
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def _load_data(self): """Loads the data into this instance""" url = self.parent.build_url(self.parent._endpoints.get("format")) response = self.parent.session.get(url) if not response: return False data = response.json() self._bold = data.get("bold", False) ...
Loads the data into this instance
_load_data
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def to_api_data(self, restrict_keys=None): """Returns a dict to communicate with the server :param restrict_keys: a set of keys to restrict the returned data to :rtype: dict """ cc = self.parent._cc # alias data = { cc("bold"): self._bold, cc("co...
Returns a dict to communicate with the server :param restrict_keys: a set of keys to restrict the returned data to :rtype: dict
to_api_data
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def color(self): """The color of the range format font :getter: get the color :setter: set the color :type: str """ if not self._color: self._load_data() return self._color
The color of the range format font :getter: get the color :setter: set the color :type: str
color
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def italic(self): """Is range format font in italics :getter: get the italic :setter: set the italic :type: bool """ if not self._loaded: self._load_data() return self._italic
Is range format font in italics :getter: get the italic :setter: set the italic :type: bool
italic
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def name(self): """The name of the range format font :getter: get the name :setter: set the name :type: str """ if not self._loaded: self._load_data() return self._name
The name of the range format font :getter: get the name :setter: set the name :type: str
name
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def size(self): """The size of the range format font :getter: get the size :setter: set the size :type: int """ if not self._loaded: self._load_data() return self._size
The size of the range format font :getter: get the size :setter: set the size :type: int
size
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def underline(self): """Is range format font underlined :getter: get the underline :setter: set the underline :type: bool """ if not self._loaded: self._load_data() return self._underline
Is range format font underlined :getter: get the underline :setter: set the underline :type: bool
underline
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def background_color(self): """The background color of the range :getter: get the background_color :setter: set the background_color :type: UnsentSentinel """ if self._background_color is UnsetSentinel: self._load_background_color() return self._backg...
The background color of the range :getter: get the background_color :setter: set the background_color :type: UnsentSentinel
background_color
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def _load_background_color(self): """Loads the data related to the fill color""" url = self.build_url(self._endpoints.get("fill")) response = self.session.get(url) if not response: return None data = response.json() self._background_color = data.get("color", N...
Loads the data related to the fill color
_load_background_color
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_offset_range(self, row_offset, column_offset): """Gets an object which represents a range that's offset from the specified range. The dimension of the returned range will match this range. If the resulting range is forced outside the bounds of the worksheet grid, an e...
Gets an object which represents a range that's offset from the specified range. The dimension of the returned range will match this range. If the resulting range is forced outside the bounds of the worksheet grid, an exception will be thrown. :param int row_offset: The numbe...
get_offset_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_used_range(self, only_values=True): """ Returns the used range of the given range object. :param bool only_values: Optional. Defaults to True. Considers only cells with values as used cells (ignores formatting). :return: Range """ # Format the "only_val...
Returns the used range of the given range object. :param bool only_values: Optional. Defaults to True. Considers only cells with values as used cells (ignores formatting). :return: Range
get_used_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def clear(self, apply_to="all"): """ Clear range values, format, fill, border, etc. :param str apply_to: Optional. Determines the type of clear action. The possible values are: all, formats, contents. """ url = self.build_url(self._endpoints.get("clear_range")) ...
Clear range values, format, fill, border, etc. :param str apply_to: Optional. Determines the type of clear action. The possible values are: all, formats, contents.
clear
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def delete(self, shift="up"): """ Deletes the cells associated with the range. :param str shift: Optional. Specifies which way to shift the cells. The possible values are: up, left. """ url = self.build_url(self._endpoints.get("delete_range")) return bool(self....
Deletes the cells associated with the range. :param str shift: Optional. Specifies which way to shift the cells. The possible values are: up, left.
delete
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def merge(self, across=False): """ Merge the range cells into one region in the worksheet. :param bool across: Optional. Set True to merge cells in each row of the specified range as separate merged cells. """ url = self.build_url(self._endpoints.get("merge_range")) ...
Merge the range cells into one region in the worksheet. :param bool across: Optional. Set True to merge cells in each row of the specified range as separate merged cells.
merge
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_format(self): """Returns a RangeFormat instance with the format of this range""" url = self.build_url(self._endpoints.get("get_format")) response = self.session.get(url) if not response: return None return self.range_format_constructor( parent=self...
Returns a RangeFormat instance with the format of this range
get_format
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_range(self): """Returns the Range instance this named range refers to""" url = self.build_url(self._endpoints.get("get_range")) response = self.session.get(url) if not response: return None return self.range_constructor( parent=self, **{self._cloud...
Returns the Range instance this named range refers to
get_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def update(self, *, visible=None, comment=None): """ Updates this named range :param bool visible: Specifies whether the object is visible or not :param str comment: Represents the comment associated with this name :return: Success or Failure """ if visible is Non...
Updates this named range :param bool visible: Specifies whether the object is visible or not :param str comment: Represents the comment associated with this name :return: Success or Failure
update
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_range(self): """Gets the range object associated with the entire row""" url = self.build_url(self._endpoints.get("get_range")) response = self.session.get(url) if not response: return None return self.range_constructor( parent=self, **{self._cloud_...
Gets the range object associated with the entire row
get_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def update(self, values): """ Updates this column :param values: values to update """ response = self.session.patch(self.build_url(""), data={"values": values}) if not response: return False data = response.json() self.values = data.get("value...
Updates this column :param values: values to update
update
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def _get_range(self, endpoint_name): """Returns a Range based on the endpoint name""" url = self.build_url(self._endpoints.get(endpoint_name)) response = self.session.get(url) if not response: return None return self.range_constructor( parent=self, **{sel...
Returns a Range based on the endpoint name
_get_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def apply_filter(self, criteria): """ Apply the given filter criteria on the given column. :param str criteria: the criteria to apply Example: .. code-block:: json { "color": "string", "criterion1": "string", ...
Apply the given filter criteria on the given column. :param str criteria: the criteria to apply Example: .. code-block:: json { "color": "string", "criterion1": "string", "criterion2": "string", ...
apply_filter
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_filter(self): """Returns the filter applie to this column""" q = self.q().select("name").expand("filter") response = self.session.get(self.build_url(""), params=q.as_params()) if not response: return None data = response.json() return data.get("criteri...
Returns the filter applie to this column
get_filter
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_columns(self, *, top=None, skip=None): """ Return the columns of this table :param int top: specify n columns to retrieve :param int skip: specify n columns to skip """ url = self.build_url(self._endpoints.get("get_columns")) params = {} if top is...
Return the columns of this table :param int top: specify n columns to retrieve :param int skip: specify n columns to skip
get_columns
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_column(self, id_or_name): """ Gets a column from this table by id or name :param id_or_name: the id or name of the column :return: WorkBookTableColumn """ url = self.build_url( self._endpoints.get("get_column").format(id=quote(id_or_name)) ) ...
Gets a column from this table by id or name :param id_or_name: the id or name of the column :return: WorkBookTableColumn
get_column
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_column_at_index(self, index): """ Returns a table column by it's index :param int index: the zero-indexed position of the column in the table """ if index is None: return None url = self.build_url(self._endpoints.get("get_column_index")) respo...
Returns a table column by it's index :param int index: the zero-indexed position of the column in the table
get_column_at_index
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def delete_column(self, id_or_name): """ Deletes a Column by its id or name :param id_or_name: the id or name of the column :return bool: Success or Failure """ url = self.build_url( self._endpoints.get("delete_column").format(id=quote(id_or_name)) ) ...
Deletes a Column by its id or name :param id_or_name: the id or name of the column :return bool: Success or Failure
delete_column
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def add_column(self, name, *, index=0, values=None): """ Adds a column to the table :param str name: the name of the column :param int index: the index at which the column should be added. Defaults to 0. :param list values: a two dimension array of values to add to the column ...
Adds a column to the table :param str name: the name of the column :param int index: the index at which the column should be added. Defaults to 0. :param list values: a two dimension array of values to add to the column
add_column
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_rows(self, *, top=None, skip=None): """ Return the rows of this table :param int top: specify n rows to retrieve :param int skip: specify n rows to skip :rtype: TableRow """ url = self.build_url(self._endpoints.get("get_rows")) params = {} ...
Return the rows of this table :param int top: specify n rows to retrieve :param int skip: specify n rows to skip :rtype: TableRow
get_rows
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_row(self, index): """Returns a Row instance at an index""" url = self.build_url(self._endpoints.get("get_row").format(id=index)) response = self.session.get(url) if not response: return None return self.row_constructor( parent=self, **{self._cloud_...
Returns a Row instance at an index
get_row
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_row_at_index(self, index): """ Returns a table row by it's index :param int index: the zero-indexed position of the row in the table """ if index is None: return None url = self.build_url(self._endpoints.get("get_row_index")) url = "{}(index={...
Returns a table row by it's index :param int index: the zero-indexed position of the row in the table
get_row_at_index
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def add_rows(self, values=None, index=None): """ Add rows to this table. Multiple rows can be added at once. This request might occasionally receive a 504 HTTP error. The appropriate response to this error is to repeat the request. :param list values: Optional. a 1 o...
Add rows to this table. Multiple rows can be added at once. This request might occasionally receive a 504 HTTP error. The appropriate response to this error is to repeat the request. :param list values: Optional. a 1 or 2 dimensional array of values to add :param in...
add_rows
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def update(self, *, name=None, show_headers=None, show_totals=None, style=None): """ Updates this table :param str name: the name of the table :param bool show_headers: whether or not to show the headers :param bool show_totals: whether or not to show the totals :param st...
Updates this table :param str name: the name of the table :param bool show_headers: whether or not to show the headers :param bool show_totals: whether or not to show the totals :param str style: the style of the table :return: Success or Failure
update
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def update(self, *, name=None, position=None, visibility=None): """Changes the name, position or visibility of this worksheet""" if name is None and position is None and visibility is None: raise ValueError("Provide at least one parameter to update") data = {} if name: ...
Changes the name, position or visibility of this worksheet
update
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_tables(self): """Returns a collection of this worksheet tables""" url = self.build_url(self._endpoints.get("get_tables")) response = self.session.get(url) if not response: return [] data = response.json() return [ self.table_constructor...
Returns a collection of this worksheet tables
get_tables
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_table(self, id_or_name): """ Retrieves a Table by id or name :param str id_or_name: The id or name of the column :return: a Table instance """ url = self.build_url(self._endpoints.get("get_table").format(id=id_or_name)) response = self.session.get(url) ...
Retrieves a Table by id or name :param str id_or_name: The id or name of the column :return: a Table instance
get_table
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def add_table(self, address, has_headers): """ Adds a table to this worksheet :param str address: a range address eg: 'A1:D4' :param bool has_headers: if the range address includes headers or not :return: a Table instance """ if address is None: return...
Adds a table to this worksheet :param str address: a range address eg: 'A1:D4' :param bool has_headers: if the range address includes headers or not :return: a Table instance
add_table
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_range(self, address=None): """ Returns a Range instance from whitin this worksheet :param str address: Optional, the range address you want :return: a Range instance """ url = self.build_url(self._endpoints.get("get_range")) if address is not None: ...
Returns a Range instance from whitin this worksheet :param str address: Optional, the range address you want :return: a Range instance
get_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_used_range(self, only_values=True): """Returns the smallest range that encompasses any cells that have a value or formatting assigned to them. :param bool only_values: Optional. Defaults to True. Considers only cells with values as used cells (ignores formatting). :retu...
Returns the smallest range that encompasses any cells that have a value or formatting assigned to them. :param bool only_values: Optional. Defaults to True. Considers only cells with values as used cells (ignores formatting). :return: Range
get_used_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_cell(self, row, column): """Gets the range object containing the single cell based on row and column numbers.""" url = self.build_url( self._endpoints.get("get_cell").format(row=row, column=column) ) response = self.session.get(url) if not response: ...
Gets the range object containing the single cell based on row and column numbers.
get_cell
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def add_named_range(self, name, reference, comment="", is_formula=False): """ Adds a new name to the collection of the given scope using the user's locale for the formula :param str name: the name of this range :param str reference: the reference for this range or formula :param ...
Adds a new name to the collection of the given scope using the user's locale for the formula :param str name: the name of this range :param str reference: the reference for this range or formula :param str comment: a comment to describe this named range :param bool is_formula: T...
add_named_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_named_range(self, name): """Retrieves a Named range by it's name""" url = self.build_url(self._endpoints.get("get_named_range").format(name=name)) response = self.session.get(url) if not response: return None return self.named_range_constructor( pa...
Retrieves a Named range by it's name
get_named_range
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def remove_sheet_name_from_address(address): """Removes the sheet name from a given address""" compiled = re.compile("([a-zA-Z]+[0-9]+):.*?([a-zA-Z]+[0-9]+)") result = compiled.search(address) if result: return ":".join(result.groups()) else: return addres...
Removes the sheet name from a given address
remove_sheet_name_from_address
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def __init__(self, workbook): """ Create A WorkbookApplication representation :param workbook: A workbook object, of the workboook that you want to interact with """ if not isinstance(workbook, WorkBook): raise ValueError("workbook was not an accepted type: Workbook...
Create A WorkbookApplication representation :param workbook: A workbook object, of the workboook that you want to interact with
__init__
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def run_calculations(self, calculation_type): """Recalculate all currently opened workbooks in Excel.""" if calculation_type not in ["Recalculate", "Full", "FullRebuild"]: raise ValueError( "calculation type must be one of: Recalculate, Full, FullRebuild" ) ...
Recalculate all currently opened workbooks in Excel.
run_calculations
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def __init__(self, file_item, *, use_session=True, persist=True): """Create a workbook representation :param File file_item: the Drive File you want to interact with :param Bool use_session: Whether or not to use a session to be more efficient :param Bool persist: Whether or not to pers...
Create a workbook representation :param File file_item: the Drive File you want to interact with :param Bool use_session: Whether or not to use a session to be more efficient :param Bool persist: Whether or not to persist this info
__init__
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_tables(self): """Returns a collection of this workbook tables""" url = self.build_url(self._endpoints.get("get_tables")) response = self.session.get(url) if not response: return [] data = response.json() return [ self.table_constructor(...
Returns a collection of this workbook tables
get_tables
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_worksheets(self): """Returns a collection of this workbook worksheets""" url = self.build_url(self._endpoints.get("get_worksheets")) response = self.session.get(url) if not response: return [] data = response.json() return [ self.worksh...
Returns a collection of this workbook worksheets
get_worksheets
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_worksheet(self, id_or_name): """Gets a specific worksheet by id or name""" url = self.build_url( self._endpoints.get("get_worksheet").format(id=quote(id_or_name)) ) response = self.session.get(url) if not response: return None return self.w...
Gets a specific worksheet by id or name
get_worksheet
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def get_named_ranges(self): """Returns the list of named ranges for this Workbook""" url = self.build_url(self._endpoints.get("get_names")) response = self.session.get(url) if not response: return [] data = response.json() return [ self.named_rang...
Returns the list of named ranges for this Workbook
get_named_ranges
python
O365/python-o365
O365/excel.py
https://github.com/O365/python-o365/blob/master/O365/excel.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """ A Microsoft 365 group :param parent: parent object :type parent: Teams :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) ...
A Microsoft 365 group :param parent: parent object :type parent: Teams :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use this resource instead of paren...
__init__
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def get_group_members(self, recursive=False): """ Returns members of given group :param bool recursive: drill down to users if group has other group as a member :rtype: list[User] """ if recursive: recursive_data = self._get_group_members_raw() for member ...
Returns members of given group :param bool recursive: drill down to users if group has other group as a member :rtype: list[User]
get_group_members
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def get_group_owners(self): """ Returns owners of given group :rtype: list[User] """ url = self.build_url(self._endpoints.get('get_group_owners').format(group_id=self.object_id)) response = self.con.get(url) if not response: return [] data = respons...
Returns owners of given group :rtype: list[User]
get_group_owners
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """ A Teams object :param parent: parent object :type parent: Account :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) ...
A Teams object :param parent: parent object :type parent: Account :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use this resource instead of parent res...
__init__
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def get_group_by_id(self, group_id = None): """ Returns Microsoft 365/AD group with given id :param group_id: group id of group :rtype: Group """ if not group_id: raise RuntimeError('Provide the group_id') # get channels by the team id url = self.b...
Returns Microsoft 365/AD group with given id :param group_id: group id of group :rtype: Group
get_group_by_id
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def get_group_by_mail(self, group_mail=None): """Returns Microsoft 365/AD group by mail field :param group_name: mail of group :rtype: Group """ if not group_mail: raise RuntimeError("Provide the group mail") # get groups by filter mail url = self.b...
Returns Microsoft 365/AD group by mail field :param group_name: mail of group :rtype: Group
get_group_by_mail
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def list_groups(self): """Returns list of groups :rtype: list[Group] """ url = self.build_url( self._endpoints.get('list_groups')) response = self.con.get(url) if not response: return None data = response.json() return [ ...
Returns list of groups :rtype: list[Group]
list_groups
python
O365/python-o365
O365/groups.py
https://github.com/O365/python-o365/blob/master/O365/groups.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """Representation of the AutomaticRepliesSettings. :param parent: parent object :type parent: Mailbox :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent sp...
Representation of the AutomaticRepliesSettings. :param parent: parent object :type parent: Mailbox :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use thi...
__init__
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """Representation of the MailboxSettings. :param parent: parent object :type parent: Mailbox :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified ...
Representation of the MailboxSettings. :param parent: parent object :type parent: Mailbox :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if no parent specified (kwargs) :param str main_resource: use this resourc...
__init__
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def save(self): """Save the MailboxSettings. :return: Success / Failure :rtype: bool """ url = self.build_url(self._endpoints.get("settings")) cc = self._cc ars = self.automaticrepliessettings automatic_reply_settings = { cc("status"): ars.sta...
Save the MailboxSettings. :return: Success / Failure :rtype: bool
save
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def __init__(self, *, parent=None, con=None, **kwargs): """Create an instance to represent the specified folder in given parent folder :param parent: parent folder/account for this folder :type parent: mailbox.Folder or Account :param Connection con: connection to use if no pare...
Create an instance to represent the specified folder in given parent folder :param parent: parent folder/account for this folder :type parent: mailbox.Folder or Account :param Connection con: connection to use if no parent specified :param Protocol protocol: protocol to use if n...
__init__
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def create_child_folder(self, folder_name): """Creates a new child folder under this folder :param str folder_name: name of the folder to add :return: newly created folder :rtype: mailbox.Folder or None """ if not folder_name: return None if self.roo...
Creates a new child folder under this folder :param str folder_name: name of the folder to add :return: newly created folder :rtype: mailbox.Folder or None
create_child_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def get_folder(self, *, folder_id=None, folder_name=None): """Get a folder by it's id or name :param str folder_id: the folder_id to be retrieved. Can be any folder Id (child or not) :param str folder_name: the folder name to be retrieved. Must be a child of this folder. ...
Get a folder by it's id or name :param str folder_id: the folder_id to be retrieved. Can be any folder Id (child or not) :param str folder_name: the folder name to be retrieved. Must be a child of this folder. :return: a single folder :rtype: mailbox.Folder or None ...
get_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def refresh_folder(self, update_parent_if_changed=False): """Re-download folder data Inbox Folder will be unable to download its own data (no folder_id) :param bool update_parent_if_changed: updates self.parent with new parent Folder if changed :return: Refreshed or Not ...
Re-download folder data Inbox Folder will be unable to download its own data (no folder_id) :param bool update_parent_if_changed: updates self.parent with new parent Folder if changed :return: Refreshed or Not :rtype: bool
refresh_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def get_parent_folder(self): """Get the parent folder from attribute self.parent or getting it from the cloud :return: Parent Folder :rtype: mailbox.Folder or None """ if self.root: return None if self.parent: return self.parent i...
Get the parent folder from attribute self.parent or getting it from the cloud :return: Parent Folder :rtype: mailbox.Folder or None
get_parent_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def update_folder_name(self, name, update_folder_data=True): """Change this folder name :param str name: new name to change to :param bool update_folder_data: whether or not to re-fetch the data :return: Updated or Not :rtype: bool """ if self.root: r...
Change this folder name :param str name: new name to change to :param bool update_folder_data: whether or not to re-fetch the data :return: Updated or Not :rtype: bool
update_folder_name
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def delete(self): """Deletes this folder :return: Deleted or Not :rtype: bool """ if self.root or not self.folder_id: return False url = self.build_url( self._endpoints.get("get_folder").format(id=self.folder_id) ) response = se...
Deletes this folder :return: Deleted or Not :rtype: bool
delete
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def copy_folder(self, to_folder): """Copy this folder and it's contents to into another folder :param to_folder: the destination Folder/folder_id to copy into :type to_folder: mailbox.Folder or str :return: The new folder after copying :rtype: mailbox.Folder or None """ ...
Copy this folder and it's contents to into another folder :param to_folder: the destination Folder/folder_id to copy into :type to_folder: mailbox.Folder or str :return: The new folder after copying :rtype: mailbox.Folder or None
copy_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def move_folder(self, to_folder, *, update_parent_if_changed=True): """Move this folder to another folder :param to_folder: the destination Folder/folder_id to move into :type to_folder: mailbox.Folder or str :param bool update_parent_if_changed: updates self.parent with the ne...
Move this folder to another folder :param to_folder: the destination Folder/folder_id to move into :type to_folder: mailbox.Folder or str :param bool update_parent_if_changed: updates self.parent with the new parent Folder if changed :return: The new folder after copying ...
move_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def new_message(self): """Creates a new draft message under this folder :return: new Message :rtype: Message """ draft_message = self.message_constructor(parent=self, is_draft=True) if self.root: draft_message.folder_id = OutlookWellKnowFolderNames.DRAFTS.v...
Creates a new draft message under this folder :return: new Message :rtype: Message
new_message
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def delete_message(self, message): """Deletes a stored message :param message: message/message_id to delete :type message: Message or str :return: Success / Failure :rtype: bool """ message_id = message.object_id if isinstance(message, Message) else message ...
Deletes a stored message :param message: message/message_id to delete :type message: Message or str :return: Success / Failure :rtype: bool
delete_message
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def set_automatic_reply( self, internal_text: str, external_text: str, scheduled_start_date_time: dt.datetime = None, scheduled_end_date_time: dt.datetime = None, externalAudience: ExternalAudience = ExternalAudience.ALL, ): """Set an automatic reply for the m...
Set an automatic reply for the mailbox. :return: Success / Failure :rtype: bool
set_automatic_reply
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def set_disable_reply(self): """Disable the automatic reply for the mailbox. :return: Success / Failure :rtype: bool """ mailboxsettings = self.get_settings() ars = mailboxsettings.automaticrepliessettings ars.status = AutoReplyStatus.DISABLED return ma...
Disable the automatic reply for the mailbox. :return: Success / Failure :rtype: bool
set_disable_reply
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def inbox_folder(self): """Shortcut to get Inbox Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Inbox", folder_id=OutlookWellKnowFolderNames.INBOX.value )
Shortcut to get Inbox Folder instance :rtype: mailbox.Folder
inbox_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def junk_folder(self): """Shortcut to get Junk Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Junk", folder_id=OutlookWellKnowFolderNames.JUNK.value )
Shortcut to get Junk Folder instance :rtype: mailbox.Folder
junk_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def deleted_folder(self): """Shortcut to get DeletedItems Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="DeletedItems", folder_id=OutlookWellKnowFolderNames.DELETED.value, )
Shortcut to get DeletedItems Folder instance :rtype: mailbox.Folder
deleted_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def drafts_folder(self): """Shortcut to get Drafts Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Drafts", folder_id=OutlookWellKnowFolderNames.DRAFTS.value, )
Shortcut to get Drafts Folder instance :rtype: mailbox.Folder
drafts_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def sent_folder(self): """Shortcut to get SentItems Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="SentItems", folder_id=OutlookWellKnowFolderNames.SENT.value, )
Shortcut to get SentItems Folder instance :rtype: mailbox.Folder
sent_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def outbox_folder(self): """Shortcut to get Outbox Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Outbox", folder_id=OutlookWellKnowFolderNames.OUTBOX.value, )
Shortcut to get Outbox Folder instance :rtype: mailbox.Folder
outbox_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def archive_folder(self): """Shortcut to get Archive Folder instance :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Archive", folder_id=OutlookWellKnowFolderNames.ARCHIVE.value, )
Shortcut to get Archive Folder instance :rtype: mailbox.Folder
archive_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def clutter_folder(self): """Shortcut to get Clutter Folder instance The clutter folder low-priority messages are moved to when using the Clutter feature. :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Clutter", ...
Shortcut to get Clutter Folder instance The clutter folder low-priority messages are moved to when using the Clutter feature. :rtype: mailbox.Folder
clutter_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def conflicts_folder(self): """Shortcut to get Conflicts Folder instance The folder that contains conflicting items in the mailbox. :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Conflicts", folder_id=...
Shortcut to get Conflicts Folder instance The folder that contains conflicting items in the mailbox. :rtype: mailbox.Folder
conflicts_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def conversationhistory_folder(self): """Shortcut to get Conversation History Folder instance The folder where Skype saves IM conversations (if Skype is configured to do so). :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, ...
Shortcut to get Conversation History Folder instance The folder where Skype saves IM conversations (if Skype is configured to do so). :rtype: mailbox.Folder
conversationhistory_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def localfailures_folder(self): """Shortcut to get Local Failure Folder instance The folder that contains items that exist on the local client but could not be uploaded to the server. :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, ...
Shortcut to get Local Failure Folder instance The folder that contains items that exist on the local client but could not be uploaded to the server. :rtype: mailbox.Folder
localfailures_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def recoverableitemsdeletions_folder(self): """Shortcut to get Recoverable Items Deletions (Purges) Folder instance The folder that contains soft-deleted items: deleted either from the Deleted Items folder, or by pressing shift+delete in Outlook. This folder is not visible in any Outlook email ...
Shortcut to get Recoverable Items Deletions (Purges) Folder instance The folder that contains soft-deleted items: deleted either from the Deleted Items folder, or by pressing shift+delete in Outlook. This folder is not visible in any Outlook email client, but end users can interact with it thr...
recoverableitemsdeletions_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def scheduled_folder(self): """Shortcut to get Scheduled Folder instance The folder that contains messages that are scheduled to reappear in the inbox using the Schedule feature in Outlook for iOS. :rtype: mailbox.Folder """ return self.folder_constructor( pa...
Shortcut to get Scheduled Folder instance The folder that contains messages that are scheduled to reappear in the inbox using the Schedule feature in Outlook for iOS. :rtype: mailbox.Folder
scheduled_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def searchfolders_folder(self): """Shortcut to get Search Folders Folder instance The parent folder for all search folders defined in the user's mailbox. :rtype: mailbox.Folder """ return self.folder_constructor( parent=self, name="Search Folders"...
Shortcut to get Search Folders Folder instance The parent folder for all search folders defined in the user's mailbox. :rtype: mailbox.Folder
searchfolders_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0
def serverfailures_folder(self): """Shortcut to get Server Failures Folder instance The folder that contains items that exist on the server but could not be synchronized to the local client. :rtype: mailbox.Folder """ return self.folder_constructor( parent=se...
Shortcut to get Server Failures Folder instance The folder that contains items that exist on the server but could not be synchronized to the local client. :rtype: mailbox.Folder
serverfailures_folder
python
O365/python-o365
O365/mailbox.py
https://github.com/O365/python-o365/blob/master/O365/mailbox.py
Apache-2.0