def __init__(self, sheet, encoding="utf-8", auto_detect_float=True, ignore_infinity=True, auto_detect_int=True, auto_detect_datetime=True, **keywords): SheetReader.__init__(self, sheet, **keywords) self._encoding = encoding self.__auto_detect_int = auto_detect_int self.__auto_detect_float = auto_detect_float self.__ignore_infinity = ignore_infinity self.__auto_detect_datetime = auto_detect_datetime
def __init__(self, sheet, **keywords): SheetReader.__init__(self, sheet, **keywords) self.__merged_cells = {} self.max_row = 0 self.max_column = 0 self.__sheet_max_row = sheet.max_row self.__sheet_max_column = sheet.max_column for ranges in sheet.merged_cells.ranges[:]: merged_cells = MergedCell(ranges) merged_cells.register_cells(self.__merged_cells) if self.max_row < merged_cells.bottom_row(): self.max_row = merged_cells.bottom_row() if self.max_column < merged_cells.right_column(): self.max_column = merged_cells.right_column()
def to_array(self): """ Convert query sets into an array """ if len(self.__query_sets) == 0: yield [] for element in SheetReader.to_array(self): yield element
def __init__(self, sheet, auto_detect_int=True, date_mode=0, **keywords): SheetReader.__init__(self, sheet, **keywords) self.__auto_detect_int = auto_detect_int self.__hidden_cols = [] self.__hidden_rows = [] self.__merged_cells = {} self._book_date_mode = date_mode if keywords.get('detect_merged_cells') is True: for merged_cell_ranges in sheet.merged_cells: merged_cells = MergedCell(*merged_cell_ranges) merged_cells.register_cells(self.__merged_cells) if keywords.get('skip_hidden_row_and_column') is True: for col_index, info in self._native_sheet.colinfo_map.items(): if info.hidden == 1: self.__hidden_cols.append(col_index) for row_index, info in self._native_sheet.rowinfo_map.items(): if info.hidden == 1: self.__hidden_rows.append(row_index)
def __init__( self, sheet, encoding="utf-8", auto_detect_float=True, ignore_infinity=True, auto_detect_int=True, auto_detect_datetime=True, pep_0515_off=True, ignore_nan_text=False, default_float_nan=None, **keywords ): SheetReader.__init__(self, sheet, **keywords) self._encoding = encoding self.__auto_detect_int = auto_detect_int self.__auto_detect_float = auto_detect_float self.__ignore_infinity = ignore_infinity self.__auto_detect_datetime = auto_detect_datetime self.__file_handle = None self.__pep_0515_off = pep_0515_off self.__ignore_nan_text = ignore_nan_text self.__default_float_nan = default_float_nan
def __init__(self, sheet, auto_detect_int=True, **keywords): SheetReader.__init__(self, sheet, **keywords) self.auto_detect_int = auto_detect_int
def __init__(self, query_sets, column_names, **keywords): SheetReader.__init__(self, query_sets, **keywords) self.__column_names = column_names self.__query_sets = query_sets
def test_number_of_rows(self): reader = SheetReader("test") reader.number_of_rows()
def test_number_of_columns(self): reader = SheetReader("test") reader.number_of_columns()
def test_abstractness(self): reader = SheetReader("test") reader.cell_value(1, 2)
def cell_value(self, row, column): SheetReader.cell_value(self, row, column) return self._native_sheet.payload[row][column]
def number_of_rows(self): SheetReader.number_of_rows(self) return len(self._native_sheet.payload)
def number_of_columns(self): SheetReader.number_of_columns(self) return len(self._native_sheet.payload[0])
def __init__(self, query_sets, column_names, **keywords): SheetReader.__init__(self, query_sets, **keywords) self.__column_names = column_names self.__query_sets = query_sets
def __init__(self, sheet, auto_detect_int=True, **keywords): SheetReader.__init__(self, sheet, **keywords) self.auto_detect_int = auto_detect_int