Exemplo n.º 1
0
def model_cell(wks: Worksheet, index: str) -> Cell:
    '''Prepare model_cell to apply to DataRange in main program'''
    cell = Cell(index)
    wks.unlink()
    cell.text_format['fontSize'] = 11
    cell.text_format['bold'] = True
    cell.borders = {'top': {'style': 'SOLID'}}
    wks.link()
    return cell
Exemplo n.º 2
0
    def remove_duplicates(self, stream: Worksheet, rows_list: list):
        """
        Removes duplicated rows, provided by `rows_list` as list of indexes.

        We are working with delete operation in offline mode, to decrease the number of API calls.
        1) Unlink the spreadsheet (make it for offline use)
        2) Perform delete operation and update the actual row index
        3) Link the spreadsheet (sync with online version) using batch_update method.
        """
        stream.unlink()
        [stream.delete_rows(row, 1) for row in rows_list]
        stream.link()