def __init__(self): BookReader.__init__(self) self._file_type = constants.FILE_FORMAT_CSV self.__load_from_memory_flag = False self.__line_terminator = DEFAULT_NEWLINE self.__sheet_name = None self.__sheet_index = None
def open_stream( self, file_stream, skip_hidden_sheets=True, detect_merged_cells=False, skip_hidden_row_and_column=True, **keywords ): BookReader.open_stream(self, file_stream, **keywords) self.skip_hidden_sheets = skip_hidden_sheets self.skip_hidden_row_and_column = skip_hidden_row_and_column self.detect_merged_cells = detect_merged_cells self._load_the_excel_file(file_stream)
def open_content(self, file_content, **keywords): if compact.PY27_ABOVE: import mmap encoding = keywords.get('encoding', 'utf-8') if isinstance(file_content, mmap.mmap): # load from mmap self.__multiple_sheets = keywords.get('multiple_sheets', False) self._file_stream = CSVMemoryMapIterator( file_content, encoding) self._keywords = keywords self._native_book = self._load_from_stream() else: if compact.PY3_ABOVE: if isinstance(file_content, bytes): file_content = file_content.decode(encoding) # else python 2.7 does not care about bytes nor str BookReader.open_content(self, file_content, **keywords) else: BookReader.open_content(self, file_content, **keywords)
def open_content(self, file_content, **keywords): try: import mmap encoding = keywords.get("encoding", "utf-8") if isinstance(file_content, mmap.mmap): # load from mmap self.__multiple_sheets = keywords.get("multiple_sheets", False) self._file_stream = CSVMemoryMapIterator( file_content, encoding) self._keywords = keywords self._native_book = self._load_from_stream() else: if compact.PY3_ABOVE: if isinstance(file_content, bytes): file_content = file_content.decode(encoding) # else python 2.7 does not care about bytes nor str BookReader.open_content(self, file_content, **keywords) except ImportError: # python 2.6 or Google app engine BookReader.open_content(self, file_content, **keywords)
def open_content(self, file_content, **keywords): if compact.PY27_ABOVE: import mmap encoding = keywords.get('encoding', 'utf-8') if isinstance(file_content, mmap.mmap): # load from mmap self.__multiple_sheets = keywords.get('multiple_sheets', False) self._file_stream = CSVMemoryMapIterator( file_content, encoding) self._keywords = keywords self._native_book = self._load_from_stream() else: if compact.PY3_ABOVE: if isinstance(file_content, bytes): file_content = file_content.decode(encoding) # else python 2.7 does not care about bytes nor str BookReader.open_content( self, file_content, **keywords) else: BookReader.open_content( self, file_content, **keywords)
def open_content(self, file_content, **keywords): try: import mmap encoding = keywords.get("encoding", "utf-8") if isinstance(file_content, mmap.mmap): # load from mmap self.__multiple_sheets = keywords.get("multiple_sheets", False) self._file_stream = CSVMemoryMapIterator( file_content, encoding ) self._keywords = keywords self._native_book = self._load_from_stream() else: if compact.PY3_ABOVE: if isinstance(file_content, bytes): file_content = file_content.decode(encoding) # else python 2.7 does not care about bytes nor str BookReader.open_content(self, file_content, **keywords) except ImportError: # python 2.6 or Google app engine BookReader.open_content(self, file_content, **keywords)
def open(self, file_name, **keywords): """open ods file""" BookReader.open(self, file_name, **keywords) self._load_from_file()
def __init__(self): BookReader.__init__(self) self.book = None
def open(self, file_name, **keywords): self.__parse_keywords(**keywords) BookReader.open(self, file_name, **keywords)
def open_stream(self, file_stream, **keywords): """load ods from file stream""" BookReader.open_stream(self, file_stream, **keywords) self._load_from_memory()
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords)
def __init__(self): BookReader.__init__(self) self.file_content = None
def open_stream(self, file_stream, multiple_sheets=False, **keywords): BookReader.open_stream(self, file_stream, **keywords) self.__multiple_sheets = multiple_sheets self._native_book = self._load_from_stream()
def __init__(self): BookReader.__init__(self) self._file_content = None
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._get_params() self._load_the_excel_file(file_stream)
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords) self._get_params() self._load_the_excel_file(file_name)
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._native_book = self._load_from_stream()
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._get_params()
def test_book_reader(): reader = BookReader() reader.read_sheet(1)
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords) self._native_book = self._load_from_file_alike_object(self._file_name)
def test_book_reader_open_stream(): reader = BookReader() reader.open_stream("a string")
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._get_params()
def open(self, file_name, skip_hidden_sheets=True, **keywords): BookReader.open(self, file_name, **keywords) self.__skip_hidden_sheets = skip_hidden_sheets
def __init__(self): BookReader.__init__(self) self.book = None
def open_stream(self, file_stream, skip_hidden_sheets=True, **keywords): BookReader.open_stream(self, file_stream, **keywords) self.__skip_hidden_sheets = skip_hidden_sheets
def open_stream(self, file_stream, multiple_sheets=False, **keywords): BookReader.open_stream(self, file_stream, **keywords) self.__multiple_sheets = multiple_sheets self._native_book = self._load_from_stream()
def __init__(self): BookReader.__init__(self) self._file_content = None self.__skip_hidden_sheets = True self.__skip_hidden_row_column = True self.__detect_merged_cells = False
def __init__(self): BookReader.__init__(self) self._file_content = None self.__skip_hidden_sheets = True self.__skip_hidden_row_column = True self.__detect_merged_cells = False
def open(self, file_name, **keywords): self.__parse_keywords(**keywords) BookReader.open(self, file_name, **keywords)
def open_stream(self, file_stream, **keywords): self.__parse_keywords(**keywords) BookReader.open_stream(self, file_stream, **keywords)
def open_stream(self, file_stream, **keywords): self.__parse_keywords(**keywords) BookReader.open_stream(self, file_stream, **keywords)
def open_stream(self, file_stream, **keywords): """open ods file stream""" BookReader.open_stream(self, file_stream, **keywords) self._load_from_memory()
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords) self._load_from_file()
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._load_from_memory()
def open_stream(self, file_stream, skip_hidden_sheets=True, **keywords): BookReader.open_stream(self, file_stream, **keywords) self.skip_hidden_sheets = skip_hidden_sheets self._load_the_excel_file(file_stream)
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords) self._get_params()
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._get_params() self._load_from_memory()
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._native_book = self._load_from_stream()
def test_book_reader(): reader = BookReader() reader.read_sheet(1)
def __init__(self): BookReader.__init__(self) self._file_type = FILE_FORMAT_CSVZ self.zipfile = None
def test_book_reader_open_stream(): reader = BookReader() reader.open_stream("a string")
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._native_book = self._load_from_file_alike_object( self._file_stream)
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords)
def open(self, file_name, **keywords): BookReader.open(self, file_name, **keywords) self._get_params()
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords)
def __init__(self): BookReader.__init__(self) self.book = None self.file_content = None
def open(self, file_name, **keywords): """load ods from file""" BookReader.open(self, file_name, **keywords) self._load_from_file()
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords)
def open_stream(self, file_stream, **keywords): BookReader.open_stream(self, file_stream, **keywords) self._load_the_file(file_stream, **keywords)