當前位置: 首頁>>代碼示例>>Python>>正文


Python book.BookReader類代碼示例

本文整理匯總了Python中pyexcel_io.book.BookReader的典型用法代碼示例。如果您正苦於以下問題:Python BookReader類的具體用法?Python BookReader怎麽用?Python BookReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BookReader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 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
開發者ID:schulzsebastian,項目名稱:qgisplugin_spreadsheet,代碼行數:7,代碼來源:_csv.py

示例2: open_stream

 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)
開發者ID:pyexcel,項目名稱:pyexcel-xlsx,代碼行數:13,代碼來源:xlsxr.py

示例3: open_content

 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)
開發者ID:caspartse,項目名稱:QQ-Groups-Spider,代碼行數:21,代碼來源:csvr.py

示例4: open_content

    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)
開發者ID:pyexcel,項目名稱:pyexcel-io,代碼行數:22,代碼來源:csvr.py

示例5: open_stream

 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()
開發者ID:caspartse,項目名稱:QQ-Groups-Spider,代碼行數:4,代碼來源:csvr.py

示例6: open_stream

 def open_stream(self, file_stream, **keywords):
     """load ods from file stream"""
     BookReader.open_stream(self, file_stream, **keywords)
     self._load_from_memory()
開發者ID:Gayathri001,項目名稱:cir-portal,代碼行數:4,代碼來源:ods.py

示例7: open

 def open(self, file_name, **keywords):
     """load ods from file"""
     BookReader.open(self, file_name, **keywords)
     self._load_from_file()
開發者ID:Gayathri001,項目名稱:cir-portal,代碼行數:4,代碼來源:ods.py

示例8: open

 def open(self, file_name, **keywords):
     BookReader.open(self, file_name, **keywords)
     self._get_params()
開發者ID:62484m,項目名稱:QQ-Groups-Spider,代碼行數:3,代碼來源:xls.py

示例9: open_stream

 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)
開發者ID:schulzsebastian,項目名稱:qgisplugin_spreadsheet,代碼行數:4,代碼來源:csvz.py

示例10: __init__

 def __init__(self):
     BookReader.__init__(self)
     self._file_type = FILE_FORMAT_CSVZ
     self.zipfile = None
開發者ID:schulzsebastian,項目名稱:qgisplugin_spreadsheet,代碼行數:4,代碼來源:csvz.py

示例11: open_stream

 def open_stream(self, file_stream, **keywords):
     self.__parse_keywords(**keywords)
     BookReader.open_stream(self, file_stream, **keywords)
開發者ID:pyexcel,項目名稱:pyexcel-xls,代碼行數:3,代碼來源:xlsr.py

示例12: open

 def open(self, file_name, **keywords):
     self.__parse_keywords(**keywords)
     BookReader.open(self, file_name, **keywords)
開發者ID:pyexcel,項目名稱:pyexcel-xls,代碼行數:3,代碼來源:xlsr.py

示例13: __init__

 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
開發者ID:pyexcel,項目名稱:pyexcel-xls,代碼行數:6,代碼來源:xlsr.py

示例14: test_book_reader_open_stream

def test_book_reader_open_stream():
    reader = BookReader()
    reader.open_stream("a string")
開發者ID:pyexcel,項目名稱:pyexcel-io,代碼行數:3,代碼來源:test_book.py

示例15: test_book_reader

def test_book_reader():
    reader = BookReader()
    reader.read_sheet(1)
開發者ID:pyexcel,項目名稱:pyexcel-io,代碼行數:3,代碼來源:test_book.py


注:本文中的pyexcel_io.book.BookReader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。