当前位置: 首页>>代码示例>>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;未经允许,请勿转载。