def get_column(self) -> int: """Get column number Returns: int: Row number """ raise XlFormNotImplementedException()
def get_formula(self) -> CellValue: """Get formul( Returns: CellValue: Formula """ raise XlFormNotImplementedException()
def new_book(self) -> Book: """New book Returns: Book: Book """ raise XlFormNotImplementedException()
def iter_sheets(self) -> Iterator[Sheet]: """Get sheets iterator Returns: Iterator[Sheet]: Sheets """ raise XlFormNotImplementedException()
def add_sheet(self, name: str) -> None: """Add sheet Args: name (str): Sheet name """ raise XlFormNotImplementedException()
def save(self, path: Path) -> None: """Save book Args: path (Path): File path """ raise XlFormNotImplementedException()
def get_number_format(self) -> str: """Get number format Returns: str: Number format """ raise XlFormNotImplementedException()
def set_value(self, value: CellValue) -> None: """Set cell value Args: value (CellValue): Cell value """ raise XlFormNotImplementedException()
def get_name(self) -> str: """Get sheet name Returns: str: Sheet name """ raise XlFormNotImplementedException()
def get_columns_count(self) -> int: """Get columns count Returns: int: Columns count """ raise XlFormNotImplementedException()
def get_rows_count(self) -> int: """Get rows count Returns: int: Rows count """ raise XlFormNotImplementedException()
def open_book(self, path: Path) -> Book: """Open book Args: path (Path): File path Returns: Book: Book """ raise XlFormNotImplementedException()
def get_text(self) -> str: """Get text Raise an exception if the formula cannot be analyzed. Raise an exception if the number format cannot be analyzed. Returns: str: Text """ raise XlFormNotImplementedException()
def get_range(self, arg: str) -> Range: """Get range Args: arg (str): range like 'A1', 'A1:C3' Returns: Range: Range """ raise XlFormNotImplementedException()
def get_cell(self, row: int, column: int) -> Cell: """Get cell Args: row (int): Row index starting from 1 column (int): Column index starting from 1 Returns: Cell: Cell """ raise XlFormNotImplementedException()
def get_value(self) -> CellValue: """Get value If there is a formula, the calculation result is returned as a value. Otherwise, the value is returned. Raise an exception if the formula cannot be analyzed. Returns: CellValue: Value """ raise XlFormNotImplementedException()
def get_address( self, column_absolute: bool = True, row_absolute: bool = True ) -> str: """Get cell address Args: column_absolute (bool, optional): True if column absolute row_absolute (bool, optional): True if row absolute Returns: str: A1 style absolute address like '$A$1' """ raise XlFormNotImplementedException()
def _set_item_doc(self, item_doc: ItemDoc) -> None: sheet = self._find_sheet(self._sheet_name) r = sheet.get_range(self._range_arg) result = item_doc.get_result() if isinstance(result, list): rows_count = len(result) if r.get_rows_count() - self._header_rows_count != rows_count: raise XlFormArgumentException() for row in result: if len(row) != r.get_columns_count(): raise XlFormArgumentException() for row_index, row in enumerate(result, start=1): for col_index, value in enumerate(row, start=1): r.get_cell(row_index, col_index).set_value(value) elif isinstance(result, dict): raise XlFormNotImplementedException()
def _validate_book(self) -> None: sheet = self._find_sheet(self._sheet_name) r = sheet.get_range(self._range_arg) if r.get_rows_count() <= self._header_rows_count: raise XlFormValidationException() if r.get_columns_count() <= 0: raise XlFormInternalException() if self._header_rows_count == 0: pass elif self._header_rows_count >= 1: if self._header_path_list is None: raise XlFormInternalException() if len(self._header_path_list) != r.get_columns_count(): raise XlFormArgumentException( "len(self._header_path_list) != r.get_columns_count()" ) for col_index, header_path in enumerate( self._header_path_list, start=1 ): for row_index, header in enumerate(header_path, start=1): if r.get_cell(row_index, col_index).get_value() != header: XlFormValidationException() else: raise XlFormNotImplementedException()
def _set_item_doc(self, item_doc: ItemDoc) -> None: """Set item document to book""" raise XlFormNotImplementedException()
def _get_item_doc(self) -> ItemDoc: """Get item document from book""" raise XlFormNotImplementedException()
def _validate_item_doc(self, item_doc: ItemDoc) -> None: """Validate item document""" raise XlFormNotImplementedException()
def _validate_book(self) -> None: """Validate book""" raise XlFormNotImplementedException()
def get_text(self) -> str: raise XlFormNotImplementedException()
def get_value(self) -> CellValue: value = safe_cast_cell_value(self._cell.value) if isinstance(value, str) and value[0] == "=": raise XlFormNotImplementedException() return value
def unprotect(self) -> None: if False: self._sheet.protection.disable() raise XlFormNotImplementedException()
def _set_item_doc(self, item_doc: ItemDoc) -> None: raise XlFormNotImplementedException()
def unprotect(self) -> None: """Unprotect""" raise XlFormNotImplementedException()
def calculate(self) -> None: """Calculate""" raise XlFormNotImplementedException()
def close(self) -> None: """Close book""" raise XlFormNotImplementedException()