本文由 大侠(AhcaoZhu)原创,转载请声明。
链接: https://blog.csdn.net/Ahcao2008
一图看懂 xlrd 模块:读写 Excel 文件的数据和格式信息, 资料整理+笔记(大全)
- 摘要
- 模块图
- 类关系图
- 模块全展开
- 【xlrd】
- 统计
- 常量
- int
- dict
- 模块
- 26 os
- 27 pprint
- 28 sys
- 29 zipfile
- 30 xlrd.timemachine
- 31 xlrd.biffh
- 32 xlrd.compdoc
- 33 xlrd.formatting
- 34 xlrd.formula
- 35 xlrd.sheet
- 36 xlrd.book
- 37 xlrd.info
- 38 xlrd.xldate
- 函数
- 39 colname(colx)
- 40 open_workbook_xls(filename=None, logfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False)
- 41 decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0)
- 42 dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
- 43 evaluate_name_formula(bk, nobj, namex, blah=0, level=0)
- 44 rangename3d(book, ref3d)
- 45 rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0)
- 46 cellname(rowx, colx)
- 47 cellnameabs(rowx, colx, r1c1=0)
- 48 xldate_as_datetime(xldate, datemode)
- 49 xldate_as_tuple(xldate, datemode)
- 50 inspect_format(path=None, content=None)
- 51 open_workbook(filename=None, logfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False)
- 52 dump(filename, outfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
- 53 count_records(filename, outfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>)
- 类
- 54 xlrd.biffh.XLRDError
- 55 xlrd.book.Book
- data
- method
- 20 biff2_8_load()
- 21 derive_encoding()
- 22 fake_globals_get_sheet()
- 23 get2bytes()
- 24 get_record_parts()
- 25 get_record_parts_conditional()
- 26 get_sheet()
- 27 get_sheets()
- 28 getbof()
- 29 handle_boundsheet()
- 30 handle_builtinfmtcount()
- 31 handle_codepage()
- 32 handle_country()
- 33 handle_datemode()
- 34 handle_externname()
- 35 handle_externsheet()
- 36 handle_filepass()
- 37 handle_name()
- 38 handle_obj()
- 39 handle_sheethdr()
- 40 handle_sheetsoffset()
- 41 handle_sst()
- 42 handle_supbook()
- 43 handle_writeaccess()
- 44 initialise_format_info()
- 45 names_epilogue()
- 46 parse_globals()
- 47 read()
- 48 release_resources()
- 49 sheet_by_index()
- 50 sheet_by_name()
- 51 sheet_loaded()
- 52 sheet_names()
- 53 sheets()
- 54 unload_sheet()
- 56 xlrd.formula.Operand
- data
- 57 xlrd.formula.Ref3D
- 58 xlrd.xldate.XLDateError
- 152 unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)
- 57 range
- 58 xlrd.formatting.EqNeAttrs
- 59 xlrd.formatting.Font
- data
- 60 xlrd.formatting.Format
- data
- 61 xlrd.formatting.XFBorder
- data
- 62 xlrd.formatting.XFBackground
- data
- 63 xlrd.formatting.XFAlignment
- data
- 64 xlrd.formatting.XFProtection
- data
- 65 xlrd.formatting.XF
- data
- 内嵌函数或方法
- 私有或局部
- 剩余
- 【xlrd.formula】
- 统计
- 常量
- int
- str
- tuple
- list
- set
- dict
- 模块
- 55 copy
- 56 operator
- 57 sys
- 函数
- 58 hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
- 59 unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None)
- 60 unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)
- 61 <lambda>(x)
- 62 <lambda>(x)
- 63 <lambda>(byte)
- 64 fprintf(f, fmt, *vargs)
- 65 <lambda>(b, enc)
- 66 <lambda>(s)
- 67 do_box_funcs(box_funcs, boxa, boxb)
- 68 adjust_cell_addr_biff8(rowval, colval, reldelta, browx=None, bcolx=None)
- 69 adjust_cell_addr_biff_le7(rowval, colval, reldelta, browx=None, bcolx=None)
- 70 get_cell_addr(data, pos, bv, reldelta, browx=None, bcolx=None)
- 71 get_cell_range_addr(data, pos, bv, reldelta, browx=None, bcolx=None)
- 72 get_externsheet_local_range(bk, refx, blah=0)
- 73 get_externsheet_local_range_b57(bk, raw_extshtx, ref_first_sheetx, ref_last_sheetx, blah=0)
- 74 nop(x)
- 75 _opr_pow(x, y)
- 76 _opr_lt(x, y)
- 77 _opr_le(x, y)
- 78 _opr_eq(x, y)
- 79 _opr_ge(x, y)
- 80 _opr_gt(x, y)
- 81 _opr_ne(x, y)
- 82 num2strg(num)
- 83 evaluate_name_formula(bk, nobj, namex, blah=0, level=0)
- 84 decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0)
- 85 dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
- 86 rownamerel(rowx, rowxrel, browx=None, r1c1=0)
- 87 colnamerel(colx, colxrel, bcolx=None, r1c1=0)
- 88 cellname(rowx, colx)
- 89 cellnameabs(rowx, colx, r1c1=0)
- 90 cellnamerel(rowx, colx, rowxrel, colxrel, browx=None, bcolx=None, r1c1=0)
- 91 colname(colx)
- 92 rangename2d(rlo, rhi, clo, chi, r1c1=0)
- 93 rangename2drel(rlo_rhi_clo_chi, rlorel_rhirel_clorel_chirel, browx=None, bcolx=None, r1c1=0)
- 94 rangename3d(book, ref3d)
- 95 rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0)
- 96 quotedsheetname(shnames, shx)
- 97 sheetrange(book, slo, shi)
- 98 sheetrangerel(book, srange, srangerel)
- 类
- 99 xlrd.biffh.BaseObject
- method
- 1 dump()
- 100 xlrd.biffh.XLRDError
- 101 _io.BytesIO
摘要
全文介绍系统内置 xlrd 模块、函数、类及类的方法和属性。
它通过代码抓取并经AI智能翻译和人工校对。
是一部不可多得的权威字典类工具书。它是系列集的一部分。后续陆续发布、敬请关注。【原创:AhcaoZhu大侠】
模块图
xlrd
◆os
◆pprint
◆sys
◆zipfile
xlrd.timemachine
xlrd.biffh
xlrd.compdoc
xlrd.formatting
xlrd.formula
xlrd.sheet
xlrd.book
xlrd.info
xlrd.xldate
类关系图
◆object
◆BaseException
◆Exception
◆OSError
◆ValueError
xlrd.xldate.XLDateError
xlrd.xldate.XLDateAmbiguous
xlrd.xldate.XLDateBadDatemode
xlrd.xldate.XLDateBadTuple
xlrd.xldate.XLDateNegative
xlrd.xldate.XLDateTooLarge
xlrd.biffh.XLRDError
xlrd.compdoc.CompDocError
xlrd.formula.FormulaError
◆pprint.PrettyPrinter
◆pprint._safe_key
◆tuple
xlrd.formula.Ref3D
xlrd.biffh.BaseObject
xlrd.book.Book
xlrd.book.Name
xlrd.formatting.Font
xlrd.formatting.Format
xlrd.formatting.XF
xlrd.formatting.XFAlignment
xlrd.formatting.XFBackground
xlrd.formatting.XFBorder
xlrd.formatting.XFProtection
xlrd.sheet.Cell
xlrd.sheet.Colinfo
xlrd.sheet.Hyperlink
xlrd.sheet.MSODrawing
xlrd.sheet.MSObj
xlrd.sheet.MSTxo
xlrd.sheet.Note
xlrd.sheet.Rowinfo
xlrd.sheet.Sheet
xlrd.compdoc.CompDoc
xlrd.compdoc.DirNode
xlrd.formatting.EqNeAttrs
xlrd.biffh.BaseObject
xlrd.formula.Operand
◆zipfile.ZipFile
模块全展开
【xlrd】
xlrd, fullname=xlrd, file=xlrd_init_.py
统计
序号 | 类别 | 数量 |
---|---|---|
1 | int | 21 |
4 | str | 6 |
6 | list | 1 |
8 | dict | 5 |
9 | module | 13 |
10 | class | 5 |
11 | function | 15 |
13 | residual | 6 |
14 | system | 11 |
16 | all | 72 |
常量
int
1 XL_CELL_BLANK 6
2 XL_CELL_BOOLEAN 4
3 XL_CELL_DATE 3
4 XL_CELL_EMPTY 0
5 XL_CELL_ERROR 5
6 XL_CELL_NUMBER 2
7 XL_CELL_TEXT 1
8 oBOOL 3
9 oERR 4
10 oNUM 2
11 oREF -1
12 oREL -2
13 oSTRG 1
14 oUNK 0
15 FMLA_TYPE_CELL 1
16 FMLA_TYPE_SHARED 2
17 FMLA_TYPE_ARRAY 4
18 FMLA_TYPE_COND_FMT 8
19 FMLA_TYPE_DATA_VAL 16
20 FMLA_TYPE_NAME 32
21 PEEK_SIZE 8
dict
22 biff_text_from_num {0: ‘(not BIFF)’, 20: ‘2.0’, 21: ‘2.1’, 30: ‘3’, 40: ‘4S’, 45: ‘4W’, 50: ‘5’, 70: ‘7’, 80: ‘8’, 85: ‘8X’}
23 error_text_from_code {0: ‘#NULL!’, 7: ‘#DIV/0!’, 15: ‘#VALUE!’, 23: ‘#REF!’, 29: ‘#NAME?’, 36: ‘#NUM!’, 42: ‘#N/A’}
24 okind_dict {-2: ‘oREL’, -1: ‘oREF’, 0: ‘oUNK’, 1: ‘oSTRG’, 2: ‘oNUM’, 3: ‘oBOOL’, 4: ‘oERR’, 5: ‘oMSNG’}
25 FILE_FORMAT_DESCRIPTIONS {‘xls’: ‘Excel xls’, ‘xlsb’: ‘Excel 2007 xlsb file’, ‘xlsx’: ‘Excel xlsx file’, ‘ods’: ‘Openoffice.org ODS file’, ‘zip’:…
模块
26 os
os, fullname=os, file=os.py
27 pprint
pprint, fullname=pprint, file=pprint.py
28 sys
sys, fullname=sys, file=
29 zipfile
zipfile, fullname=zipfile, file=zipfile.py
30 xlrd.timemachine
timemachine, fullname=xlrd.timemachine, file=xlrd\timemachine.py
31 xlrd.biffh
biffh, fullname=xlrd.biffh, file=xlrd\biffh.py
32 xlrd.compdoc
compdoc, fullname=xlrd.compdoc, file=xlrd\compdoc.py
实现从OLE2复合文档文件中提取“Workbook”或“Book”流(作为一个大字符串)所需的最小功能。
33 xlrd.formatting
formatting, fullname=xlrd.formatting, file=xlrd\formatting.py
模块用于格式化信息。
34 xlrd.formula
formula, fullname=xlrd.formula, file=xlrd\formula.py
解析/计算Microsoft Excel公式的模块。
35 xlrd.sheet
sheet, fullname=xlrd.sheet, file=xlrd\sheet.py
36 xlrd.book
book, fullname=xlrd.book, file=xlrd\book.py
37 xlrd.info
info, fullname=xlrd.info, file=xlrd\info.py
38 xlrd.xldate
xldate, fullname=xlrd.xldate, file=xlrd\xldate.py
用于在Excel文件中处理日期和时间的工具。
从``days``到``(year, month, day)`` 的转换以一个整数“儒略历日”(又名JDN)开始。
FWIW:
- JDN 0 对应于公历年-4713年11月24日星期一的中午。
更重要的是:
公历1900-03-01日的中午(基于1900年的系统中的第61天)为JDN 2415080.0;
公历1904-01-02日的中午(基于1904年的系统中的第1天)为JDN 2416482.0
函数
39 colname(colx)
colname(colx), module=xlrd.formula, line:2100 at site-packages\xlrd\formula.py
实用函数:``7`` => ``'H'``, ``27`` => ``'AB'``
40 open_workbook_xls(filename=None, logfile=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False)
open_workbook_xls(filename=None, logfile=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False), module=xlrd.book, line:59 at site-packages\xlrd\book.py
41 decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0)
decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0), module=xlrd.formula, line:1360 at site-packages\xlrd\formula.py
42 dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0), module=xlrd.formula, line:1886 at site-packages\xlrd\formula.py
43 evaluate_name_formula(bk, nobj, namex, blah=0, level=0)
evaluate_name_formula(bk, nobj, namex, blah=0, level=0), module=xlrd.formula, line:752 at site-packages\xlrd\formula.py
44 rangename3d(book, ref3d)
rangename3d(book, ref3d), module=xlrd.formula, line:2130 at site-packages\xlrd\formula.py
实用函数:
``Ref3D(1, 4, 5, 20, 7, 10)`` =>
``'Sheet2:Sheet3!$H$6:$J$20'``
(假设Excel的默认表名)
45 rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0)
rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0), module=xlrd.formula, line:2142 at site-packages\xlrd\formula.py
实用函数:
``Ref3D(coords=(0, 1, -32, -22, -13, 13), relflags=(0, 0, 1, 1, 1, 1))``
在R1C1模式 => ``'Sheet1!R[-32]C[-13]:R[-23]C[12]'``
在A1模式 => 依赖于基本单元格 ``(browx, bcolx)``
46 cellname(rowx, colx)
cellname(rowx, colx), module=xlrd.formula, line:2078 at site-packages\xlrd\formula.py
实用函数:``(5, 7)`` => ``'H6'``
47 cellnameabs(rowx, colx, r1c1=0)
cellnameabs(rowx, colx, r1c1=0), module=xlrd.formula, line:2082 at site-packages\xlrd\formula.py
实用函数:``(5, 7)`` => ``'$H$6'``
48 xldate_as_datetime(xldate, datemode)
xldate_as_datetime(xldate, datemode), module=xlrd.xldate, line:130 at site-packages\xlrd\xldate.py
将一个Excel日期/时间数字转换为: :class:`datetime.datetime` 对象。
:param xldate: Excel编号
:param datemode: 0: 1900-based, 1: 1904-based。
:返回: :class:`datetime.datetime`对象。
49 xldate_as_tuple(xldate, datemode)
xldate_as_tuple(xldate, datemode), module=xlrd.xldate, line:59 at site-packages\xlrd\xldate.py
将一个Excel数字(假定表示date、datetime或time)转换为元组, 适合提供给datetime或mx.DateTime的。
:param xldate: Excel编号
:param datemode: 0: 1900-based, 1: 1904-based.
:raises xlrd.xldate.XLDateNegative:
:raises xlrd.xldate.XLDateAmbiguous:
:raises xlrd.xldate.XLDateTooLarge:
:raises xlrd.xldate.XLDateBadDatemode:
:raises xlrd.xldate.XLDateError:
:returns: Gregorian ``(year, month, day, hour, minute, nearest_second)``.
警告:
当使用此函数解释工作簿的内容时,您应该传入 :attr:`~xlrd.book.Book.datemode` 属性。
工作簿是否曾经接近过麦金塔是无关紧要的。
警告:特殊情况
如果 ``0.0 <= xldate < 1.0``, 则假定它表示时间;
``(0, 0, 0, hour, minute, second)`` 将被返回。
注意:
'1904-01-01' 在''datemode==1''系统中不被视为有效日期;它的“序列号”是零。
50 inspect_format(path=None, content=None)
inspect_format(path=None, content=None), module=xlrd, line:38 at site-packages\xlrd_init_.py
检查所提供路径的内容或所提供的 :class:`bytes` 内容,并返回文件类型为:class: 'str',如果无法确定则返回'None' 。
:param path:
一个 :class:`string <str>` 路径包含要检查的内容。
``~`` 将展开。
:param content:
:class:`bytes`将被检查。
:returns:
如果无法确定格式,则返回`None`。返回值总是可以在:data:`FILE_FORMAT_DESCRIPTIONS`中查找:
返回所找到的格式的人类可读的描述。
51 open_workbook(filename=None, logfile=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False)
open_workbook(filename=None, logfile=<io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False), module=xlrd, line:84 at site-packages\xlrd_init.py
打开电子表格文件进行数据提取。
:param filename:要打开电子表格文件的路径。
:param logfile:一个被写入消息和诊断的打开文件。
:param verbosity:增加写入日志文件的跟踪材料的体积。
:param use_mmap:启发式决定是否使用mmap模块。使用这个参数来覆盖结果。
当前启发式:如果存在mmap,则使用它。
:param file_contents: 字符串或:class:`mmap.mmap`对象或其他类似行为的对象。如果提供了``file_contents``, ``filename``将不会被使用,(可能)在消息中除外。
:param encoding_override:用于克服旧版本文件中缺失或错误的代码页信息。参见:doc:`unicode`。
:param formatting_info: 默认为``False``,这将节省内存。
在这种情况下,“空白”单元格,即那些有自己的格式化信息但没有数据的单元格,通过忽略文件的“空白”和“MULBLANK”记录被视为空单元格。
这将切断空单元格或空白单元格行的任何底部或右侧“边缘”。
仅有 :meth:`~xlrd.sheet.Sheet.cell_value` 和 :meth:`~xlrd.sheet.Sheet.cell_type`是有效的。
当``True``时,格式化信息将从电子表格文件中读取。这将提供所有单元格,包括空单元格和空白单元格。每个单元格都有格式化信息。
注意,当与xlsx文件一起使用时,这将引发NotImplementedError。
:param on_demand:控制所有表是在初始加载还是在调用者要求时加载。参见: doc:`on_demand`。
:param ragged_rows: 默认的 ``False`` 意味着所有行都用空单元格填充,以便所有行的大小与 :attr:`~xlrd.sheet.Sheet.ncols` 中找到的相同。
``True``表示行尾没有空单元格。如果行大小相差很大,这可以节省大量内存。请参见 :meth:`~xlrd.sheet.Sheet.row_len` 方法。
:param ignore_workbook_corruption:该选项允许读取损坏的工作簿。
当 ``False`` 时,您可能会面临CompDocError: Workbook损坏。
当 ``True`` 时,异常将被忽略。
:returns: 返回:class:`~xlrd.book.Book`的实例。
52 dump(filename, outfile=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, unnumbered=False)
dump(filename, outfile=<io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, unnumbered=False), module=xlrd, line:188 at site-packages\xlrd_init.py
对于调试:
For debugging: 转储一个XLS文件的BIFF记录在char和十六进制。
:param filename: 要转储的文件路径。
:param outfile: 一个打开的文件,转储文件被写入其中。
:param unnumbered: 如果为真,省略偏移量(用于有意义的差异)。
53 count_records(filename, outfile=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>)
count_records(filename, outfile=<io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>), module=xlrd, line:202 at site-packages\xlrd_init.py
用于调试和分析:总结文件的BIFF记录。
即:生成一个排序文件``(record_name, count)``。
:param filename:要总结的文件的路径。
:param outfile:一个打开的文件,摘要被写入其中。
类
54 xlrd.biffh.XLRDError
XLRDError, xlrd.biffh.XLRDError, module=xlrd.biffh
从Excel文件读取数据时出现问题的异常。
55 xlrd.book.Book
Book, xlrd.book.Book, module=xlrd.book
“workbook”的内容。你不应该自己实例化这个类。你可以使用调用:func:`~xlrd.open_workbook`对象。
data
1 biff_version=0 kind:data type:int class:<class ‘xlrd.book.Book’>
2 codepage=None kind:data type:NoneType class:<class ‘xlrd.book.Book’>
3 colour_map={} kind:data type:dict class:<class ‘xlrd.book.Book’>
4 countries=(0, 0) kind:data type:tuple class:<class ‘xlrd.book.Book’>
5 datemode=0 kind:data type:int class:<class ‘xlrd.book.Book’>
6 encoding=None kind:data type:NoneType class:<class ‘xlrd.book.Book’>
7 font_list=[] kind:data type:list class:<class ‘xlrd.book.Book’>
8 format_list=[] kind:data type:list class:<class ‘xlrd.book.Book’>
9 format_map={} kind:data type:dict class:<class ‘xlrd.book.Book’>
10 load_time_stage_1=-1.0 kind:data type:float class:<class ‘xlrd.book.Book’>
11 load_time_stage_2=-1.0 kind:data type:float class:<class ‘xlrd.book.Book’>
12 name_and_scope_map={} kind:data type:dict class:<class ‘xlrd.book.Book’>
13 name_map={} kind:data type:dict class:<class ‘xlrd.book.Book’>
14 name_obj_list=[] kind:data type:list class:<class ‘xlrd.book.Book’>
15 nsheets=0 kind:data type:int class:<class ‘xlrd.book.Book’>
16 palette_record=[] kind:data type:list class:<class ‘xlrd.book.Book’>
17 style_name_map={} kind:data type:dict class:<class ‘xlrd.book.Book’>
18 user_name= kind:data type:str class:<class ‘xlrd.book.Book’>
19 xf_list=[] kind:data type:list class:<class ‘xlrd.book.Book’>
method
20 biff2_8_load()
kind=method class=Book objtype=function
21 derive_encoding()
kind=method class=Book objtype=function
22 fake_globals_get_sheet()
kind=method class=Book objtype=function
23 get2bytes()
kind=method class=Book objtype=function
24 get_record_parts()
kind=method class=Book objtype=function
25 get_record_parts_conditional()
kind=method class=Book objtype=function
26 get_sheet()
kind=method class=Book objtype=function
27 get_sheets()
kind=method class=Book objtype=function
28 getbof()
kind=method class=Book objtype=function
29 handle_boundsheet()
kind=method class=Book objtype=function
30 handle_builtinfmtcount()
kind=method class=Book objtype=function
31 handle_codepage()
kind=method class=Book objtype=function
32 handle_country()
kind=method class=Book objtype=function
33 handle_datemode()
kind=method class=Book objtype=function
34 handle_externname()
kind=method class=Book objtype=function
35 handle_externsheet()
kind=method class=Book objtype=function
36 handle_filepass()
kind=method class=Book objtype=function
37 handle_name()
kind=method class=Book objtype=function
38 handle_obj()
kind=method class=Book objtype=function
39 handle_sheethdr()
kind=method class=Book objtype=function
40 handle_sheetsoffset()
kind=method class=Book objtype=function
41 handle_sst()
kind=method class=Book objtype=function
42 handle_supbook()
kind=method class=Book objtype=function
43 handle_writeaccess()
kind=method class=Book objtype=function
44 initialise_format_info()
kind=method class=Book objtype=function
45 names_epilogue()
kind=method class=Book objtype=function
46 parse_globals()
kind=method class=Book objtype=function
47 read()
kind=method class=Book objtype=function
48 release_resources()
kind=method class=Book objtype=function
这种方法有双重目的。你可以调用它来释放占用内存的对象和(可能的)内存映射文件(:class:`mmap.mmap`)。
当你在``on_demand``模式下完成了加载工作表,但仍然需要:class:`Book`对象来检查加载的工作表。
当:func:`~xlrd.open_workbook` 时,它也被自动(a)调用。
打开工作簿的引发一个异常(b)如果你正在使用``with``语句,当``with`` 块被退出时。在同一对象上多次调用此方法不会产生不良影响。
49 sheet_by_index()
kind=method class=Book objtype=function
:参数sheetx:表索引在``range(nsheets)``
:返回:一个类:class:`~xlrd.sheet.Sheet`。
50 sheet_by_name()
kind=method class=Book objtype=function
:param sheet name:所需的表的名称。
:返回:一个类: class:`~xlrd.sheet.Sheet`。
51 sheet_loaded()
kind=method class=Book objtype=function
:param sheet_name_or_index: 查询表的名称或索引
:returns: 如果表已加载,则返回:``True``否则返回:``False``。
52 sheet_names()
kind=method class=Book objtype=function
:返回:工作簿文件中所有工作表的名称列表。即使在还没有加载表的情况下,这些信息也是可用的。
53 sheets()
kind=method class=Book objtype=function
:返回:书中所有表的列表。所有尚未装入的页都将装入。
54 unload_sheet()
kind=method class=Book objtype=function
:param表名称或索引:要卸载的表的名称或索引。versionadded::是0.7.1
56 xlrd.formula.Operand
Operand, xlrd.formula.Operand, module=xlrd.formula
用于计算公式。下表描述了这些类型及其值是如何表示的。
.. raw:: html
<table border="1" cellpadding="7">
<tr>
<th>Kind symbol</th>
<th>Kind number</th>
<th>Value representation</th>
</tr>
<tr>
<td>oBOOL</td>
<td align="center">3</td>
<td>integer: 0 => False; 1 => True</td>
</tr>
<tr>
<td>oERR</td>
<td align="center">4</td>
<td>None, or an int error code (same as XL_CELL_ERROR in the Cell class).
</td>
</tr>
<tr>
<td>oMSNG</td>
<td align="center">5</td>
<td>Used by Excel as a placeholder for a missing (not supplied) function
argument. Should *not* appear as a final formula result. Value is None.</td>
</tr>
<tr>
<td>oNUM</td>
<td align="center">2</td>
<td>A float. Note that there is no way of distinguishing dates.</td>
</tr>
<tr>
<td>oREF</td>
<td align="center">-1</td>
<td>The value is either None or a non-empty list of
absolute Ref3D instances.<br>
</td>
</tr>
<tr>
<td>oREL</td>
<td align="center">-2</td>
<td>The value is None or a non-empty list of
fully or partially relative Ref3D instances.
</td>
</tr>
<tr>
<td>oSTRG</td>
<td align="center">1</td>
<td>A Unicode string.</td>
</tr>
<tr>
<td>oUNK</td>
<td align="center">0</td>
<td>The kind is unknown or ambiguous. The value is None</td>
</tr>
</table>
data
1 kind=0 kind:data type:int class:<class ‘xlrd.formula.Operand’>
2 text=? kind:data type:str class:<class ‘xlrd.formula.Operand’>
3 value=None kind:data type:NoneType class:<class ‘xlrd.formula.Operand’>
57 xlrd.formula.Ref3D
Ref3D, xlrd.formula.Ref3D, module=xlrd.formula
表示对包含一个或多个单元格的方框的绝对或相对三维引用。
``coordinates``属性是形式为::(shtxlo, shtxhi, rowxlo, rowxhi, colxlo, colxhi)的元组,
其中``0 <= thingxlo <= thingx < thingxhi``
..注:
很可能有``thingx > nthings``;例如,``Print_Titles`` 可以有``colxhi == 256``和/或``rowxhi == 65536``,
而不管工作表中实际使用了多少列/行。
调用方需要决定如何处理这种情况。关键字::class:`IndexError`
coords属性的组件也可以作为单独的属性:``shtxlo``, ``shtxhi``, ``rowxlo``, ``rowxhi``, ``colxlo``, ``colxhi``。
``relflags``属性是一个6元组的标志,它指示对应的(sheet|row|col)(lo|hi)是相对(1)还是绝对(0)。
注意::
对于引用可能相对于哪些单元格,必然没有可用的信息。调用者必须决定使用``oREL``操作数。
注意:
部分相对的引用很可能是一个拼写错误。例如,定义名称``A1Z10``为``$a$1:$z10`` (``z``后缺少``$``),而光标位于单元格``Sheet3!A27``上。
结果:class:`Ref3D`实例将有
``coords = (2, 3, 0, -16, 0, 26)``
以及 ``relflags = (0, 0, 0, 1, 0, 0).<br>
到目前为止,只注意到引用中相对于表的组件的一种可能性:位于“当前表”中的2D引用。
这将显示为``coords = (0, 1, ...)`` 和 ``relflags = (1, 1, ...)``
..versionadded: 0.6.0
58 xlrd.xldate.XLDateError
XLDateError, xlrd.xldate.XLDateError, module=xlrd.xldate
所有日期时间相关错误的基类。
实用函数```
## 剩余
> 59 __doc__ None
> 60 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002515588>
> 61 __spec__ ModuleSpec(name='xlrd', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002515588>, origin='...\\lib\\site-packages\\xlrd\\__init__.py', submodule_search_locations=['...\\lib\\site-packages\\xlrd'])
> 62 XLS_SIGNATURE b'\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1'
> 63 empty_cell empty:''
> 64 ZIP_SIGNATURE b'PK\x03\x04'
## 【os】
> os, fullname=os, file=os.py
## 【pprint】
> pprint, fullname=pprint, file=pprint.py
## 【sys】
> sys, fullname=sys, file=
## 【zipfile】
> zipfile, fullname=zipfile, file=zipfile.py
## 【xlrd.timemachine】
> timemachine, fullname=xlrd.timemachine, file=xlrd\timemachine.py
## 统计
序号|类别|数量
---|---|---
4|str|4
5|tuple|2
8|dict|1
9|module|1
10|class|2
11|function|6
12|builtin_function_or_method|2
13|residual|4
14|system|8
16|all|22
## 常量
### tuple
> 1 python_version (3, 7)
> 2 EXCEL_TEXT_TYPES (<class 'str'>, <class 'bytes'>, <class 'bytearray'>)
## 模块
### 3 sys
> sys, fullname=sys, file=
## 函数
### 4 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
### 5 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
### 6 <lambda>(byte)
> <lambda>(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
### 7 fprintf(f, fmt, *vargs)
> fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
### 8 <lambda>(b, enc)
> <lambda>(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
### 9 <lambda>(s)
> <lambda>(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
## 类
### 10 _io.BytesIO
> BytesIO, _io.BytesIO, module=_io
使用内存字节缓冲区的缓冲I/O实现。
### 11 range
> range, range, module=builtins
## 内嵌函数或方法
> 12 REPR <built-in function ascii>
> 13 unichr <built-in function chr>
## 剩余
> 14 __doc__ None
> 15 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FA2408>
> 16 __spec__ ModuleSpec(name='xlrd.timemachine', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FA2408>, origin='...\\lib\\site-packages\\xlrd\\timemachine.py')
> 17 print_function _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
## 【xlrd.biffh】
> biffh, fullname=xlrd.biffh, file=xlrd\biffh.py
## 统计
序号|类别|数量
---|---|---
1|int|126
4|str|5
5|tuple|4
6|list|1
8|dict|7
9|module|1
10|class|4
11|function|17
12|builtin_function_or_method|3
13|residual|4
14|system|8
15|private|4
16|all|172
## 常量
### int
> 1 DEBUG 0
> 2 FUN 0
> 3 FDT 1
> 4 FNU 2
> 5 FGE 3
> 6 FTX 4
> 7 DATEFORMAT 1
> 8 NUMBERFORMAT 2
> 9 XL_CELL_EMPTY 0
> 10 XL_CELL_TEXT 1
> 11 XL_CELL_NUMBER 2
> 12 XL_CELL_DATE 3
> 13 XL_CELL_BOOLEAN 4
> 14 XL_CELL_ERROR 5
> 15 XL_CELL_BLANK 6
> 16 BIFF_FIRST_UNICODE 80
> 17 XL_WORKBOOK_GLOBALS 5
> 18 WBKBLOBAL 5
> 19 XL_WORKBOOK_GLOBALS_4W 256
> 20 XL_WORKSHEET 16
> 21 WRKSHEET 16
> 22 XL_BOUNDSHEET_WORKSHEET 0
> 23 XL_BOUNDSHEET_CHART 2
> 24 XL_BOUNDSHEET_VB_MODULE 6
> 25 XL_ARRAY 545
> 26 XL_ARRAY2 33
> 27 XL_BLANK 513
> 28 XL_BLANK_B2 1
> 29 XL_BOF 2057
> 30 XL_BOOLERR 517
> 31 XL_BOOLERR_B2 5
> 32 XL_BOUNDSHEET 133
> 33 XL_BUILTINFMTCOUNT 86
> 34 XL_CF 433
> 35 XL_CODEPAGE 66
> 36 XL_COLINFO 125
> 37 XL_COLUMNDEFAULT 32
> 38 XL_COLWIDTH 36
> 39 XL_CONDFMT 432
> 40 XL_CONTINUE 60
> 41 XL_COUNTRY 140
> 42 XL_DATEMODE 34
> 43 XL_DEFAULTROWHEIGHT 549
> 44 XL_DEFCOLWIDTH 85
> 45 XL_DIMENSION 512
> 46 XL_DIMENSION2 0
> 47 XL_EFONT 69
> 48 XL_EOF 10
> 49 XL_EXTERNNAME 35
> 50 XL_EXTERNSHEET 23
> 51 XL_EXTSST 255
> 52 XL_FEAT11 2162
> 53 XL_FILEPASS 47
> 54 XL_FONT 49
> 55 XL_FONT_B3B4 561
> 56 XL_FORMAT 1054
> 57 XL_FORMAT2 30
> 58 XL_FORMULA 6
> 59 XL_FORMULA3 518
> 60 XL_FORMULA4 1030
> 61 XL_GCW 171
> 62 XL_HLINK 440
> 63 XL_QUICKTIP 2048
> 64 XL_HORIZONTALPAGEBREAKS 27
> 65 XL_INDEX 523
> 66 XL_INTEGER 2
> 67 XL_IXFE 68
> 68 XL_LABEL 516
> 69 XL_LABEL_B2 4
> 70 XL_LABELRANGES 351
> 71 XL_LABELSST 253
> 72 XL_LEFTMARGIN 38
> 73 XL_TOPMARGIN 40
> 74 XL_RIGHTMARGIN 39
> 75 XL_BOTTOMMARGIN 41
> 76 XL_HEADER 20
> 77 XL_FOOTER 21
> 78 XL_HCENTER 131
> 79 XL_VCENTER 132
> 80 XL_MERGEDCELLS 229
> 81 XL_MSO_DRAWING 236
> 82 XL_MSO_DRAWING_GROUP 235
> 83 XL_MSO_DRAWING_SELECTION 237
> 84 XL_MULRK 189
> 85 XL_MULBLANK 190
> 86 XL_NAME 24
> 87 XL_NOTE 28
> 88 XL_NUMBER 515
> 89 XL_NUMBER_B2 3
> 90 XL_OBJ 93
> 91 XL_PAGESETUP 161
> 92 XL_PALETTE 146
> 93 XL_PANE 65
> 94 XL_PRINTGRIDLINES 43
> 95 XL_PRINTHEADERS 42
> 96 XL_RK 638
> 97 XL_ROW 520
> 98 XL_ROW_B2 8
> 99 XL_RSTRING 214
> 100 XL_SCL 160
> 101 XL_SHEETHDR 143
> 102 XL_SHEETPR 129
> 103 XL_SHEETSOFFSET 142
> 104 XL_SHRFMLA 1212
> 105 XL_SST 252
> 106 XL_STANDARDWIDTH 153
> 107 XL_STRING 519
> 108 XL_STRING_B2 7
> 109 XL_STYLE 659
> 110 XL_SUPBOOK 430
> 111 XL_TABLEOP 566
> 112 XL_TABLEOP2 55
> 113 XL_TABLEOP_B2 54
> 114 XL_TXO 438
> 115 XL_UNCALCED 94
> 116 XL_UNKNOWN 65535
> 117 XL_VERTICALPAGEBREAKS 26
> 118 XL_WINDOW2 574
> 119 XL_WINDOW2_B2 62
> 120 XL_WRITEACCESS 92
> 121 XL_WSBOOL 129
> 122 XL_XF 224
> 123 XL_XF2 67
> 124 XL_XF3 579
> 125 XL_XF4 1091
> 126 _cell_opcode 214
### str
> 127 _numh 0868
### tuple
> 128 python_version (3, 7)
> 129 EXCEL_TEXT_TYPES (<class 'str'>, <class 'bytes'>, <class 'bytearray'>)
> 130 bofcodes (2057, 1033, 521, 9)
> 131 XL_FORMULA_OPCODES (6, 1030, 518)
### list
> 132 _cell_opcode_list [517, 6, 518, 1030, 516, 253, 189, 515, 638, 214]
### dict
> 133 biff_text_from_num {0: '(not BIFF)', 20: '2.0', 21: '2.1', 30: '3', 40: '4S', 45: '4W', 50: '5', 70: '7', 80: '8', 85: '8X'}
> 134 error_text_from_code {0: '#NULL!', 7: '#DIV/0!', 15: '#VALUE!', 23: '#REF!', 29: '#NAME?', 36: '#NUM!', 42: '#N/A'}
> 135 boflen {2057: 8, 1033: 6, 521: 6, 9: 4}
> 136 _cell_opcode_dict {517: 1, 6: 1, 518: 1, 1030: 1, 516: 1, 253: 1, 189: 1, 515: 1, 638: 1, 214: 1}
> 137 biff_rec_name_dict {0: 'DIMENSIONS_B2', 1: 'BLANK_B2', 2: 'INTEGER_B2_ONLY', 3: 'NUMBER_B2', 4: 'LABEL_B2', 5: 'BOOLERR_B2', 6: 'FORMULA', ...
> 138 encoding_from_codepage {1200: 'utf_16_le', 10000: 'mac_roman', 10006: 'mac_greek', 10007: 'mac_cyrillic', 10029: 'mac_latin2', 10079: 'mac_icel...
## 模块
### 139 sys
> sys, fullname=sys, file=
## 函数
### 140 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
### 141 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
### 142 <lambda>(byte)
> <lambda>(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
### 143 fprintf(f, fmt, *vargs)
> fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
### 144 <lambda>(b, enc)
> <lambda>(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
### 145 <lambda>(s)
> <lambda>(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
### 146 is_cell_opcode(c)
> is_cell_opcode(c), module=xlrd.biffh, line:236 at site-packages\xlrd\biffh.py
### 147 upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>)
> upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>), module=xlrd.biffh, line:239 at site-packages\xlrd\biffh.py
### 148 upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>)
> upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>), module=xlrd.biffh, line:243 at site-packages\xlrd\biffh.py
### 149 unpack_string(data, pos, encoding, lenlen=1)
> unpack_string(data, pos, encoding, lenlen=1), module=xlrd.biffh, line:247 at site-packages\xlrd\biffh.py
### 150 unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None)
> unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None), module=xlrd.biffh, line:252 at site-packages\xlrd\biffh.py
### 151 unpack_unicode(data, pos, lenlen=2)
> unpack_unicode(data, pos, lenlen=2), module=xlrd.biffh, line:262 at site-packages\xlrd\biffh.py
返回unicode strg
实用函数```
152 unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)
unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None), module=xlrd.biffh, line:301 at site-packages\xlrd\biffh.py
返回(unicode_strg,更新后的pos值)
实用函数```
### 153 unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6)
> unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6), module=xlrd.biffh, line:336 at site-packages\xlrd\biffh.py
### 154 hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
> hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False), module=xlrd.biffh, line:521 at site-packages\xlrd\biffh.py
### 155 biff_dump(mem, stream_offset, stream_len, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
> biff_dump(mem, stream_offset, stream_len, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False), module=xlrd.biffh, line:552 at site-packages\xlrd\biffh.py
### 156 biff_count_records(mem, stream_offset, stream_len, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>)
> biff_count_records(mem, stream_offset, stream_len, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>), module=xlrd.biffh, line:598 at site-packages\xlrd\biffh.py
## 类
### 157 _io.BytesIO
> BytesIO, _io.BytesIO, module=_io
### 158 range
> range, range, module=builtins
### 159 xlrd.biffh.XLRDError
> XLRDError, xlrd.biffh.XLRDError, module=xlrd.biffh
从Excel文件读取数据时出现问题的异常。
### 160 xlrd.biffh.BaseObject
> BaseObject, xlrd.biffh.BaseObject, module=xlrd.biffh
包中几乎所有其他类的父类。定义一个用于调试的通用:meth:dump
方法。
#### method
> #### 1 dump()
> kind=method class=BaseObject objtype=function
:param f: 转储文件写入的打开文件对象
:param header: 转储前写入的文本
:param footer: 转储后写入的文本
:param indent: 前导空格数(用于递归调用)
## 内嵌函数或方法
> 161 unpack <built-in function unpack>
> 162 REPR <built-in function ascii>
> 163 unichr <built-in function chr>
## 私有或局部
> 164 _cell_opcode_list [517, 6, 518, 1030, 516, 253, 189, 515, 638, 214]
> 165 _cell_opcode_dict {517: 1, 6: 1, 518: 1, 1030: 1, 516: 1, 253: 1, 189: 1, 515: 1, 638: 1, 214: 1}
> 166 _cell_opcode 214
> 167 _numh 0868
## 剩余
> 168 __doc__ None
> 169 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FA0248>
> 170 __spec__ ModuleSpec(name='xlrd.biffh', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FA0248>, origin='...\\lib\\site-packages\\xlrd\\biffh.py')
> 171 print_function _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
## 【xlrd.compdoc】
> compdoc, fullname=xlrd.compdoc, file=xlrd\compdoc.py
实现从OLE2复合文档文件中提取“Workbook”或“Book”流(作为一个大字符串)所需的最小功能。
## 统计
序号|类别|数量
---|---|---
1|int|5
4|str|5
5|tuple|2
8|dict|1
9|module|2
10|class|5
11|function|9
12|builtin_function_or_method|3
13|residual|4
14|system|8
15|private|1
16|all|36
## 常量
### int
> 1 EOCSID -2
> 2 FREESID -1
> 3 SATSID -3
> 4 MSATSID -4
> 5 EVILSID -5
### tuple
> 6 python_version (3, 7)
> 7 EXCEL_TEXT_TYPES (<class 'str'>, <class 'bytes'>, <class 'bytearray'>)
## 模块
### 8 array
> array, fullname=array, file=
这个模块定义了一个对象类型,它可以有效地表示基本值的数组:字符、整数、浮点数。
数组是序列类型,除了存储在其中的对象类型受到限制之外,它的行为非常类似于列表。
### 9 sys
> sys, fullname=sys, file=
## 函数
### 10 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
### 11 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
### 12 <lambda>(byte)
> <lambda>(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
### 13 fprintf(f, fmt, *vargs)
> fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
### 14 <lambda>(b, enc)
> <lambda>(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
### 15 <lambda>(s)
> <lambda>(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
### 16 _build_family_tree(dirlist, parent_DID, child_DID)
> _build_family_tree(dirlist, parent_DID, child_DID), module=xlrd.compdoc, line:64 at site-packages\xlrd\compdoc.py
### 17 x_dump_line(alist, stride, f, dpos, equal=0)
> x_dump_line(alist, stride, f, dpos, equal=0), module=xlrd.compdoc, line:461 at site-packages\xlrd\compdoc.py
### 18 dump_list(alist, stride, f=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>)
> dump_list(alist, stride, f=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>), module=xlrd.compdoc, line:467 at site-packages\xlrd\compdoc.py
## 类
### 19 _io.BytesIO
> BytesIO, _io.BytesIO, module=_io
### 20 range
> range, range, module=builtins
### 21 xlrd.compdoc.CompDocError
> CompDocError, xlrd.compdoc.CompDocError, module=xlrd.compdoc
### 22 xlrd.compdoc.DirNode
> DirNode, xlrd.compdoc.DirNode, module=xlrd.compdoc
#### method
> #### 1 dump()
> kind=method class=DirNode objtype=function
### 23 xlrd.compdoc.CompDoc
> CompDoc, xlrd.compdoc.CompDoc, module=xlrd.compdoc
复合文档处理程序。
:param mem:文件的原始内容,作为字符串,或作为:class:mmap.mmap
对象。它需要支持的唯一操作是切片。
#### method
> #### 1 get_named_stream()
> kind=method class=CompDoc objtype=function
查询复合文档的目录;如果找到流则返回字符串形式,否则返回None
。
:param qname:期望流的名称。“Workbook”。应该是Unicode或可转换的。
> #### 2 locate_named_stream()
> kind=method class=CompDoc objtype=function
查询复合文档的目录。
如果未找到命名流,则返回(None, 0,0)
。
如果找到命名流,并且在打开文档时使用的原始字节序列(mem
)中相邻,则返回(mem, offset_to_start_of_stream, length_of_stream)
。
否则,将从这些片段构建一个新字符串,并返回(new_string, 0, length_of_stream)
。
:param qname:期望流的名称。'Workbook'
应该是Unicode或可转换的。
## 内嵌函数或方法
> 24 unpack <built-in function unpack>
> 25 REPR <built-in function ascii>
> 26 unichr <built-in function chr>
## 私有或局部
> 27 _build_family_tree <function _build_family_tree at 0x0000000002FC05E8>
## 剩余
> 28 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FC1708>
> 29 __spec__ ModuleSpec(name='xlrd.compdoc', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FC1708>, origin='...\\lib\\site-packages\\xlrd\\compdoc.py')
> 30 print_function _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
> 31 SIGNATURE b'\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1'
## 【xlrd.formatting】
> formatting, fullname=xlrd.formatting, file=xlrd\formatting.py
模块用于格式化信息。
## 统计
序号|类别|数量
---|---|---
1|int|11
4|str|6
5|tuple|5
6|list|2
8|dict|9
9|module|2
10|class|12
11|function|24
12|builtin_function_or_method|4
13|residual|3
14|system|8
15|private|2
16|all|78
## 常量
### int
> 1 FDT 1
> 2 FGE 3
> 3 FNU 2
> 4 FTX 4
> 5 FUN 0
> 6 XL_CELL_DATE 3
> 7 XL_CELL_NUMBER 2
> 8 XL_CELL_TEXT 1
> 9 XL_FORMAT 1054
> 10 XL_FORMAT2 30
> 11 DEBUG 0
### str
> 12 _c
### tuple
> 13 python_version (3, 7)
> 14 EXCEL_TEXT_TYPES (<class 'str'>, <class 'bytes'>, <class 'bytearray'>)
> 15 excel_default_palette_b5 ((0, 0, 0), (255, 255, 255), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (128, 0...
> 16 excel_default_palette_b2 ((0, 0, 0), (255, 255, 255), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (128, 0...
> 17 excel_default_palette_b8 ((0, 0, 0), (255, 255, 255), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (128, 0...
### list
> 18 built_in_style_names ['Normal', 'RowLevel_', 'ColLevel_', 'Comma', 'Currency', 'Percent', 'Comma [0]', 'Currency [0]', 'Hyperlink', 'Followed...
> 19 fmt_code_ranges [(0, 0, 3), (1, 13, 2), (14, 22, 1), (27, 36, 1), (37, 44, 2), (45, 47, 1), (48, 48, 2), (49, 49, 4), (50, 58, 1), (59, ...
### dict
> 20 _cellty_from_fmtty {2: 2, 0: 2, 3: 2, 1: 3, 4: 2}
> 21 default_palette {80: ((0, 0, 0), (255, 255, 255), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (1...
> 22 std_format_strings {0: 'General', 1: '0', 2: '0.00', 3: '#,##0', 4: '#,##0.00', 5: '$#,##0_);($#,##0)', 6: '$#,##0_);[Red]($#,##0)', 7: '$#...
> 23 std_format_code_types {0: 3, 1: 2, 2: 2, 3: 2, 4: 2, 5: 2, 6: 2, 7: 2, 8: 2, 9: 2, 10: 2, 11: 2, 12: 2, 13: 2, 14: 1, 15: 1, 16: 1, 17: 1, 18:...
> 24 date_char_dict {'y': 5, 'm': 5, 'd': 5, 'h': 5, 's': 5, 'Y': 5, 'M': 5, 'D': 5, 'H': 5, 'S': 5}
> 25 skip_char_dict {'$': 1, '-': 1, '+': 1, '/': 1, '(': 1, ')': 1, ':': 1, ``: 1}
> 26 num_char_dict {'0': 5, '#': 5, '?': 5}
> 27 non_date_formats {'0.00E+00': 1, '##0.0E+0': 1, 'General': 1, 'GENERAL': 1, 'general': 1, '@': 1}
## 模块
### 28 re
> re, fullname=re, file=re.py
### 29 sys
> sys, fullname=sys, file=
## 函数
### 30 fprintf(f, fmt, *vargs)
> fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
### 31 unpack_string(data, pos, encoding, lenlen=1)
> unpack_string(data, pos, encoding, lenlen=1), module=xlrd.biffh, line:247 at site-packages\xlrd\biffh.py
### 32 unpack_unicode(data, pos, lenlen=2)
> unpack_unicode(data, pos, lenlen=2), module=xlrd.biffh, line:262 at site-packages\xlrd\biffh.py
返回unicode strg
### 33 upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>)
> upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>), module=xlrd.biffh, line:239 at site-packages\xlrd\biffh.py
### 34 upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>)
> upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>), module=xlrd.biffh, line:243 at site-packages\xlrd\biffh.py
### 35 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
### 36 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
### 37 <lambda>(byte)
> <lambda>(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
### 38 <lambda>(b, enc)
> <lambda>(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
### 39 <lambda>(s)
> <lambda>(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
### 40 initialise_colour_map(book)
> initialise_colour_map(book), module=xlrd.formatting, line:105 at site-packages\xlrd\formatting.py
### 41 nearest_colour_index(colour_map, rgb, debug=0)
> nearest_colour_index(colour_map, rgb, debug=0), module=xlrd.formatting, line:129 at site-packages\xlrd\formatting.py
通用功能。使用欧几里得距离。到目前为止仅用于biff8之前的WINDOW2
记录。不一定要快。不需要很花哨。
### 42 handle_efont(book, data)
> handle_efont(book, data), module=xlrd.formatting, line:257 at site-packages\xlrd\formatting.py
### 43 handle_font(book, data)
> handle_font(book, data), module=xlrd.formatting, line:262 at site-packages\xlrd\formatting.py
### 44 is_date_format_string(book, fmt)
> is_date_format_string(book, fmt), module=xlrd.formatting, line:462 at site-packages\xlrd\formatting.py
### 45 handle_format(self, data, rectype=1054)
> handle_format(self, data, rectype=1054), module=xlrd.formatting, line:525 at site-packages\xlrd\formatting.py
### 46 handle_palette(book, data)
> handle_palette(book, data), module=xlrd.formatting, line:577 at site-packages\xlrd\formatting.py
### 47 palette_epilogue(book)
> palette_epilogue(book), module=xlrd.formatting, line:613 at site-packages\xlrd\formatting.py
### 48 handle_style(book, data)
> handle_style(book, data), module=xlrd.formatting, line:633 at site-packages\xlrd\formatting.py
### 49 check_colour_indexes_in_obj(book, obj, orig_index)
> check_colour_indexes_in_obj(book, obj, orig_index), module=xlrd.formatting, line:676 at site-packages\xlrd\formatting.py
### 50 fill_in_standard_formats(book)
> fill_in_standard_formats(book), module=xlrd.formatting, line:689 at site-packages\xlrd\formatting.py
### 51 handle_xf(self, data)
> handle_xf(self, data), module=xlrd.formatting, line:700 at site-packages\xlrd\formatting.py
### 52 xf_epilogue(self)
> xf_epilogue(self), module=xlrd.formatting, line:1016 at site-packages\xlrd\formatting.py
### 53 initialise_book(book)
> initialise_book(book), module=xlrd.formatting, line:1089 at site-packages\xlrd\formatting.py
## 类
### 54 xlrd.biffh.BaseObject
> BaseObject, xlrd.biffh.BaseObject, module=xlrd.biffh
包中几乎所有其他类的父类。定义一个用于调试的通用:meth:dump
方法。
#### method
> #### 1 dump()
> kind=method class=BaseObject objtype=function
:param f: 转储文件写入的打开文件对象
:param header: 转储前写入的文本
:param footer: 转储后写入的文本
:param indent: 前导空格数(用于递归调用)
### 55 xlrd.biffh.XLRDError
> XLRDError, xlrd.biffh.XLRDError, module=xlrd.biffh
从Excel文件读取数据时出现问题的异常。
### 56 _io.BytesIO
> BytesIO, _io.BytesIO, module=_io
57 range
range, range, module=builtins
58 xlrd.formatting.EqNeAttrs
EqNeAttrs, xlrd.formatting.EqNeAttrs, module=xlrd.formatting
这个mixin类只存在于:class:`Format`,:class:`Font`和:class:`XF`对象可以通过属性值进行比较。
59 xlrd.formatting.Font
Font, xlrd.formatting.Font, module=xlrd.formatting
一个Excel“字体”不仅包含通常被认为是字体的细节,而且还包含其他几个显示属性。
项目对应的Excel UI的 Format -> Cells -> Font 选项卡。versionadded: 0.6.1
data
1 bold=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
2 character_set=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
3 colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
4 escapement=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
5 family=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
6 font_index=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
7 height=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
8 italic=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
9 name= kind:data type:str class:<class ‘xlrd.formatting.Font’>
10 outline=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
11 shadow=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
12 struck_out=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
13 underline_type=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
14 underlined=0 kind:data type:int class:<class ‘xlrd.formatting.Font’>
15 weight=400 kind:data type:int class:<class ‘xlrd.formatting.Font’>
60 xlrd.formatting.Format
Format, xlrd.formatting.Format, module=xlrd.formatting
来自``FORMAT``记录的“数字格式”信息。versionadded: 0.6.1
data
1 format_key=0 kind:data type:int class:<class ‘xlrd.formatting.Format’>
2 format_str= kind:data type:str class:<class ‘xlrd.formatting.Format’>
3 type=0 kind:data type:int class:<class ‘xlrd.formatting.Format’>
61 xlrd.formatting.XFBorder
XFBorder, xlrd.formatting.XFBorder, module=xlrd.formatting
XF记录的边界相关属性的集合。
项目对应的Excel UI的格式->单元格->边框选项卡。关于“颜色指数”的解释见:参考:“调色板”。
有五个行样式属性;可能的值及其含义为:
:0 =无线,1 =细线,2 =中线,3 =虚线,4 =虚线,5 =粗线,6 =双线,7 =粗线,8 =中虚线,9 =细虚线,10 =中虚线,11 =细虚线,
12 =中虚线,13 =中斜线。
0 = No line,
1 = Thin,
2 = Medium,
3 = Dashed,
4 = Dotted,
5 = Thick,
6 = Double,
7 = Hair,
8 = Medium dashed,
9 = Thin dash-dotted,
10 = Medium dash-dotted,
11 = Thin dash-dot-dotted,
12 = Medium dash-dot-dotted,
13 = Slanted medium dash-dotted.
线条样式8到13只出现在BIFF8文件(Excel 97及更高版本)中。
关于线条样式的图片,请参考Line Styles for Cell Borders (BIFF3-BIFF8)
data
1 bottom_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
2 bottom_line_style=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
3 diag_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
4 diag_down=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
5 diag_line_style=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
6 diag_up=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
7 left_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
8 left_line_style=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
9 right_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
10 right_line_style=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
11 top_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
12 top_line_style=0 kind:data type:int class:<class ‘xlrd.formatting.XFBorder’>
62 xlrd.formatting.XFBackground
XFBackground, xlrd.formatting.XFBackground, module=xlrd.formatting
一个“XF”记录的背景相关属性集合。
项目对应于那些在Excel UI的格式->单元格->模式选项卡。关于“颜色指数”的解释见:参考:“调色板”
..versionadded: 0.6.1
data
1 background_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBackground’>
2 fill_pattern=0 kind:data type:int class:<class ‘xlrd.formatting.XFBackground’>
3 pattern_colour_index=0 kind:data type:int class:<class ‘xlrd.formatting.XFBackground’>
63 xlrd.formatting.XFAlignment
XFAlignment, xlrd.formatting.XFAlignment, module=xlrd.formatting
一个“XF”记录的对齐和类似属性的集合。
项目对应于那些在Excel UI的格式->单元格->对齐选项卡。
versionadded: 0.6.1
data
1 hor_align=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
2 indent_level=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
3 rotation=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
4 shrink_to_fit=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
5 text_direction=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
6 text_wrapped=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
7 vert_align=0 kind:data type:int class:<class ‘xlrd.formatting.XFAlignment’>
64 xlrd.formatting.XFProtection
XFProtection, xlrd.formatting.XFProtection, module=xlrd.formatting
“XF”记录的保护相关属性的集合。
项目对应的Excel UI的格式->单元格->保护选项卡。
注意,OOo文档在这个属性包中包含了“cell or style”位。这是不正确的;位用于决定使用哪个包。
versionadded: 0.6.1
data
1 cell_locked=0 kind:data type:int class:<class ‘xlrd.formatting.XFProtection’>
2 formula_hidden=0 kind:data type:int class:<class ‘xlrd.formatting.XFProtection’>
65 xlrd.formatting.XF
XF, xlrd.formatting.XF, module=xlrd.formatting
单元格、行、列和样式的扩展格式信息。
下面6个标志中的每一个都描述了一组特定属性的有效性。
在单元格XFs中:
``flag=0``表示使用父样式``XF``的属性,(但仅当属性在那里有效时);
``flag=1``表示使用这个``XF`` '的属性。
在样式XFs中:
``flag=0``表示属性设置有效;
``flag=1``表示忽略该属性。
注意::
API提供了“原始”xf和“计算”xf。在后一种情况下,单元xf应用了上述继承机制。
versionadded: 0.6.1
data
1 alignment=None kind:data type:NoneType class:<class ‘xlrd.formatting.XF’>
2 background=None kind:data type:NoneType class:<class ‘xlrd.formatting.XF’>
3 border=None kind:data type:NoneType class:<class ‘xlrd.formatting.XF’>
4 font_index=0 kind:data type:int class:<class ‘xlrd.formatting.XF’>
5 format_key=0 kind:data type:int class:<class ‘xlrd.formatting.XF’>
6 is_style=0 kind:data type:int class:<class ‘xlrd.formatting.XF’>
7 parent_style_index=0 kind:data type:int class:<class ‘xlrd.formatting.XF’>
8 protection=None kind:data type:NoneType class:<class ‘xlrd.formatting.XF’>
9 xf_index=0 kind:data type:int class:<class ‘xlrd.formatting.XF’>
内嵌函数或方法
66 unpack
67 REPR
68 unichr
69 fmt_bracketed_sub <built-in method sub of re.Pattern object at 0x0000000002F77E70>
私有或局部
70 _cellty_from_fmtty {2: 2, 0: 2, 3: 2, 1: 3, 4: 2}
71 _c
剩余
72 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FC4E08>
73 spec ModuleSpec(name=‘xlrd.formatting’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FC4E08>, origin=‘…\lib\site-packages\xlrd\formatting.py’)
74 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
【xlrd.formula】
formula, fullname=xlrd.formula, file=xlrd\formula.py
解析/计算Microsoft Excel公式的模块。
统计
序号 | 类别 | 数量 |
---|---|---|
1 | int | 31 |
4 | str | 6 |
5 | tuple | 4 |
6 | list | 7 |
7 | set | 1 |
8 | dict | 12 |
9 | module | 3 |
10 | class | 7 |
11 | function | 41 |
12 | builtin_function_or_method | 4 |
13 | residual | 3 |
14 | system | 9 |
15 | private | 11 |
16 | all | 119 |
常量
int
1 FMLA_TYPE_CELL 1
2 FMLA_TYPE_SHARED 2
3 FMLA_TYPE_ARRAY 4
4 FMLA_TYPE_COND_FMT 8
5 FMLA_TYPE_DATA_VAL 16
6 FMLA_TYPE_NAME 32
7 ALL_FMLA_TYPES 63
8 oBOOL 3
9 oERR 4
10 oMSNG 5
11 oNUM 2
12 oREF -1
13 oREL -2
14 oSTRG 1
15 oUNK 0
16 tAdd 3
17 tSub 4
18 tMul 5
19 tDiv 6
20 tPower 7
21 tConcat 8
22 tLT 9
23 tLE 10
24 tEQ 11
25 tGE 12
26 tGT 13
27 tNE 14
28 LEAF_RANK 90
29 FUNC_RANK 90
30 STACK_ALARM_LEVEL 5
31 STACK_PANIC_LEVEL 10
str
32 listsep ,
tuple
33 python_version (3, 7)
34 EXCEL_TEXT_TYPES (<class ‘str’>, <class ‘bytes’>, <class ‘bytearray’>)
35 tRangeFuncs (, , , , <built-in function …
36 tIsectFuncs (, , , , <built-in function …
list
37 sztab0 [-2, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -1, 8, 4, 2, 2, 3, 9, 8, 2, 3, 8, 4, 7, 5…
38 sztab1 [-2, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -1, 11, 5, 2, 2, 3, 9, 9, 2, 3, 11, 4, 7,…
39 sztab2 [-2, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -1, 11, 5, 2, 2, 3, 9, 9, 3, 4, 11, 4, 7,…
40 sztab3 [-2, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -1, -2, -2, 2, 2, 3, 9, 9, 3, 4, 15, 4, 7…
41 sztab4 [-2, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -2, -2, 2, 2, 3, 9, 9, 3, 4, 5, 5, 9,…
42 onames [‘Unk00’, ‘Exp’, ‘Tbl’, ‘Add’, ‘Sub’, ‘Mul’, ‘Div’, ‘Power’, ‘Concat’, ‘LT’, ‘LE’, ‘EQ’, ‘GE’, ‘GT’, ‘NE’, ‘Isect’, 'Lis…
set
43 error_opcodes {7, 8, 10, 11, 47, 28, 29}
dict
44 error_text_from_code {0: ‘#NULL!’, 7: ‘#DIV/0!’, 15: ‘#VALUE!’, 23: ‘#REF!’, 29: ‘#NAME?’, 36: ‘#NUM!’, 42: ‘#N/A’}
45 FMLA_TYPEDESCR_MAP {1: ‘CELL’, 2: ‘SHARED’, 4: ‘ARRAY’, 8: ‘COND-FMT’, 16: ‘DATA-VAL’, 32: ‘NAME’}
46 okind_dict {-2: ‘oREL’, -1: ‘oREF’, 0: ‘oUNK’, 1: ‘oSTRG’, 2: ‘oNUM’, 3: ‘oBOOL’, 4: ‘oERR’, 5: ‘oMSNG’}
47 szdict {20: [-2, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -2, -1, 8, 4, 2, 2, 3, 9, 8, 2, 3, 8, 4,…
48 func_defs {0: (‘COUNT’, 0, 30, 4, 1, ‘V’, ‘R’), 1: (‘IF’, 2, 3, 4, 3, ‘V’, ‘VRR’), 2: (‘ISNA’, 1, 1, 2, 1, ‘V’, ‘V’), 3: ('ISERROR…
49 tAttrNames {0: ‘Skip??’, 1: ‘Volatile’, 2: ‘If’, 4: ‘Choose’, 8: ‘Skip’, 16: ‘Sum’, 32: ‘Assign’, 64: ‘Space’, 65: ‘SpaceVolatile’}
50 _arith_argdict {2: <function nop at 0x0000000003011438>, 1: <class ‘float’>}
51 _cmp_argdict {2: <function nop at 0x0000000003011438>, 1: <function nop at 0x0000000003011438>}
52 _strg_argdict {2: <function num2strg at 0x0000000003011AF8>, 1: <function nop at 0x0000000003011438>}
53 binop_rules {3: ({2: <function nop at 0x0000000003011438>, 1: <class ‘float’>}, 2, , 30, ‘+’), 4: ({2: <funct…
54 unop_rules {19: (<function at 0x0000000003011B88>, 70, ‘-’, ‘’), 18: (<function at 0x0000000003011C18>, 70, ‘+’, …
模块
55 copy
copy, fullname=copy, file=copy.py
56 operator
operator, fullname=operator, file=operator.py
操作界面。这个模块导出一组用C语言实现的函数,对应于Python的内在操作符。
例如,operator.add(x, y) 等价于表达式 x+y。函数名是用于特殊方法的函数名;为了方便起见,还提供了不带前导和结尾'__'的变体。
57 sys
sys, fullname=sys, file=
函数
58 hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, unnumbered=False)
hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name=‘’ mode=‘w’ encoding=‘GB18030’>, unnumbered=False), module=xlrd.biffh, line:521 at site-packages\xlrd\biffh.py
59 unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None)
unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None), module=xlrd.biffh, line:252 at site-packages\xlrd\biffh.py
60 unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)
unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None), module=xlrd.biffh, line:301 at site-packages\xlrd\biffh.py
返回(unicode strg,更新后的pos值)
61 (x)
(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
62 (x)
(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
63 (byte)
(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
64 fprintf(f, fmt, *vargs)
fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
65 (b, enc)
(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
66 (s)
(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
67 do_box_funcs(box_funcs, boxa, boxb)
do_box_funcs(box_funcs, boxa, boxb), module=xlrd.formula, line:402 at site-packages\xlrd\formula.py
68 adjust_cell_addr_biff8(rowval, colval, reldelta, browx=None, bcolx=None)
adjust_cell_addr_biff8(rowval, colval, reldelta, browx=None, bcolx=None), module=xlrd.formula, line:408 at site-packages\xlrd\formula.py
69 adjust_cell_addr_biff_le7(rowval, colval, reldelta, browx=None, bcolx=None)
adjust_cell_addr_biff_le7(rowval, colval, reldelta, browx=None, bcolx=None), module=xlrd.formula, line:425 at site-packages\xlrd\formula.py
70 get_cell_addr(data, pos, bv, reldelta, browx=None, bcolx=None)
get_cell_addr(data, pos, bv, reldelta, browx=None, bcolx=None), module=xlrd.formula, line:443 at site-packages\xlrd\formula.py
71 get_cell_range_addr(data, pos, bv, reldelta, browx=None, bcolx=None)
get_cell_range_addr(data, pos, bv, reldelta, browx=None, bcolx=None), module=xlrd.formula, line:454 at site-packages\xlrd\formula.py
72 get_externsheet_local_range(bk, refx, blah=0)
get_externsheet_local_range(bk, refx, blah=0), module=xlrd.formula, line:472 at site-packages\xlrd\formula.py
73 get_externsheet_local_range_b57(bk, raw_extshtx, ref_first_sheetx, ref_last_sheetx, blah=0)
get_externsheet_local_range_b57(bk, raw_extshtx, ref_first_sheetx, ref_last_sheetx, blah=0), module=xlrd.formula, line:509 at site-packages\xlrd\formula.py
74 nop(x)
nop(x), module=xlrd.formula, line:700 at site-packages\xlrd\formula.py
75 _opr_pow(x, y)
_opr_pow(x, y), module=xlrd.formula, line:703 at site-packages\xlrd\formula.py
76 _opr_lt(x, y)
_opr_lt(x, y), module=xlrd.formula, line:705 at site-packages\xlrd\formula.py
77 _opr_le(x, y)
_opr_le(x, y), module=xlrd.formula, line:706 at site-packages\xlrd\formula.py
78 _opr_eq(x, y)
_opr_eq(x, y), module=xlrd.formula, line:707 at site-packages\xlrd\formula.py
79 _opr_ge(x, y)
_opr_ge(x, y), module=xlrd.formula, line:708 at site-packages\xlrd\formula.py
80 _opr_gt(x, y)
_opr_gt(x, y), module=xlrd.formula, line:709 at site-packages\xlrd\formula.py
81 _opr_ne(x, y)
_opr_ne(x, y), module=xlrd.formula, line:710 at site-packages\xlrd\formula.py
82 num2strg(num)
num2strg(num), module=xlrd.formula, line:712 at site-packages\xlrd\formula.py
尝试模拟Excel从数字到字符串的默认转换。
83 evaluate_name_formula(bk, nobj, namex, blah=0, level=0)
evaluate_name_formula(bk, nobj, namex, blah=0, level=0), module=xlrd.formula, line:752 at site-packages\xlrd\formula.py
84 decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0)
decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0), module=xlrd.formula, line:1360 at site-packages\xlrd\formula.py
85 dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0), module=xlrd.formula, line:1886 at site-packages\xlrd\formula.py
86 rownamerel(rowx, rowxrel, browx=None, r1c1=0)
rownamerel(rowx, rowxrel, browx=None, r1c1=0), module=xlrd.formula, line:2050 at site-packages\xlrd\formula.py
87 colnamerel(colx, colxrel, bcolx=None, r1c1=0)
colnamerel(colx, colxrel, bcolx=None, r1c1=0), module=xlrd.formula, line:2064 at site-packages\xlrd\formula.py
88 cellname(rowx, colx)
cellname(rowx, colx), module=xlrd.formula, line:2078 at site-packages\xlrd\formula.py
实用函数:``(5, 7)`` => ``'H6'``
89 cellnameabs(rowx, colx, r1c1=0)
cellnameabs(rowx, colx, r1c1=0), module=xlrd.formula, line:2082 at site-packages\xlrd\formula.py
实用函数:``(5, 7)`` => ``'$H$6'``
90 cellnamerel(rowx, colx, rowxrel, colxrel, browx=None, bcolx=None, r1c1=0)
cellnamerel(rowx, colx, rowxrel, colxrel, browx=None, bcolx=None, r1c1=0), module=xlrd.formula, line:2088 at site-packages\xlrd\formula.py
91 colname(colx)
colname(colx), module=xlrd.formula, line:2100 at site-packages\xlrd\formula.py
实用函数:``7`` => ``'H'``, ``27`` => ``'AB'``
92 rangename2d(rlo, rhi, clo, chi, r1c1=0)
rangename2d(rlo, rhi, clo, chi, r1c1=0), module=xlrd.formula, line:2109 at site-packages\xlrd\formula.py
``(5, 20, 7, 10)`` => ``'$H$6:$J$20'``
93 rangename2drel(rlo_rhi_clo_chi, rlorel_rhirel_clorel_chirel, browx=None, bcolx=None, r1c1=0)
rangename2drel(rlo_rhi_clo_chi, rlorel_rhirel_clorel_chirel, browx=None, bcolx=None, r1c1=0), module=xlrd.formula, line:2117 at site-packages\xlrd\formula.py
94 rangename3d(book, ref3d)
rangename3d(book, ref3d), module=xlrd.formula, line:2130 at site-packages\xlrd\formula.py
实用函数:
实用函数:
``Ref3D(1, 4, 5, 20, 7, 10)`` =>
``'Sheet2:Sheet3!$H$6:$J$20'``
(假设Excel的默认表名)
95 rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0)
rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0), module=xlrd.formula, line:2142 at site-packages\xlrd\formula.py
实用函数:
``Ref3D(coords=(0, 1, -32, -22, -13, 13), relflags=(0, 0, 1, 1, 1, 1))``
在R1C1模式 => ``'Sheet1!R[-32]C[-13]:R[-23]C[12]'``
在A1模式 => 依赖于基本单元格 ``(browx, bcolx)``
96 quotedsheetname(shnames, shx)
quotedsheetname(shnames, shx), module=xlrd.formula, line:2159 at site-packages\xlrd\formula.py
97 sheetrange(book, slo, shi)
sheetrange(book, slo, shi), module=xlrd.formula, line:2175 at site-packages\xlrd\formula.py
98 sheetrangerel(book, srange, srangerel)
sheetrangerel(book, srange, srangerel), module=xlrd.formula, line:2182 at site-packages\xlrd\formula.py
类
99 xlrd.biffh.BaseObject
BaseObject, xlrd.biffh.BaseObject, module=xlrd.biffh
包中几乎所有其他类的父类。定义一个用于调试的通用:meth:`dump`方法。
method
1 dump()
kind=method class=BaseObject objtype=function
:param f: 转储文件写入的打开文件对象
:param header: 转储前写入的文本
:param footer: 转储后写入的文本
:param indent: 前导空格数(用于递归调用)
100 xlrd.biffh.XLRDError
XLRDError, xlrd.biffh.XLRDError, module=xlrd.biffh
从Excel文件读取数据时出现问题的异常。
101 _io.BytesIO
BytesIO, _io.BytesIO, module=_io
### 102 range
> range, range, module=builtins
### 103 xlrd.formula.FormulaError
> FormulaError, xlrd.formula.FormulaError, module=xlrd.formula
### 104 xlrd.formula.Operand
> Operand, xlrd.formula.Operand, module=xlrd.formula
用于计算公式。(见前)
#### data
> 1 kind=0 kind:data type:int class:<class 'xlrd.formula.Operand'>
> 2 text=? kind:data type:str class:<class 'xlrd.formula.Operand'>
> 3 value=None kind:data type:NoneType class:<class 'xlrd.formula.Operand'>
### 105 xlrd.formula.Ref3D
> Ref3D, xlrd.formula.Ref3D, module=xlrd.formula
表示对包含一个或多个单元格的方框的绝对或相对三维引用。(见前)
## 内嵌函数或方法
> 106 unpack <built-in function unpack>
> 107 REPR <built-in function ascii>
> 108 unichr <built-in function chr>
> 109 _TOKEN_NOT_ALLOWED <built-in method get of dict object at 0x0000000003006B38>
## 私有或局部
> 110 _TOKEN_NOT_ALLOWED <built-in method get of dict object at 0x0000000003006B38>
> 111 _opr_pow <function _opr_pow at 0x0000000003011708>
> 112 _opr_lt <function _opr_lt at 0x0000000003011798>
> 113 _opr_le <function _opr_le at 0x0000000003011828>
> 114 _opr_eq <function _opr_eq at 0x00000000030118B8>
> 115 _opr_ge <function _opr_ge at 0x0000000003011948>
> 116 _opr_gt <function _opr_gt at 0x00000000030119D8>
> 117 _opr_ne <function _opr_ne at 0x0000000003011A68>
> 118 _arith_argdict {2: <function nop at 0x0000000003011438>, 1: <class 'float'>}
> 119 _cmp_argdict {2: <function nop at 0x0000000003011438>, 1: <function nop at 0x0000000003011438>}
> 120 _strg_argdict {2: <function num2strg at 0x0000000003011AF8>, 1: <function nop at 0x0000000003011438>}
## 剩余
> 121 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FF0588>
> 122 __spec__ ModuleSpec(name='xlrd.formula', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FF0588>, origin='...\\lib\\site-packages\\xlrd\\formula.py')
> 123 print_function _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
## 【xlrd.sheet】
> sheet, fullname=xlrd.sheet, file=xlrd\sheet.py
## 统计
序号|类别|数量
---|---|---
1|int|129
4|str|4
5|tuple|5
8|dict|8
9|module|1
10|class|15
11|function|22
12|builtin_function_or_method|4
13|residual|5
14|system|8
15|private|2
16|all|193
## 常量
### int
> 1 DEBUG 0
> 2 FUN 0
> 3 FDT 1
> 4 FNU 2
> 5 FGE 3
> 6 FTX 4
> 7 DATEFORMAT 1
> 8 NUMBERFORMAT 2
> 9 XL_CELL_EMPTY 0
> 10 XL_CELL_TEXT 1
> 11 XL_CELL_NUMBER 2
> 12 XL_CELL_DATE 3
> 13 XL_CELL_BOOLEAN 4
> 14 XL_CELL_ERROR 5
> 15 XL_CELL_BLANK 6
> 16 BIFF_FIRST_UNICODE 80
> 17 XL_WORKBOOK_GLOBALS 5
> 18 WBKBLOBAL 5
> 19 XL_WORKBOOK_GLOBALS_4W 256
> 20 XL_WORKSHEET 16
> 21 WRKSHEET 16
> 22 XL_BOUNDSHEET_WORKSHEET 0
> 23 XL_BOUNDSHEET_CHART 2
> 24 XL_BOUNDSHEET_VB_MODULE 6
> 25 XL_ARRAY 545
> 26 XL_ARRAY2 33
> 27 XL_BLANK 513
> 28 XL_BLANK_B2 1
> 29 XL_BOF 2057
> 30 XL_BOOLERR 517
> 31 XL_BOOLERR_B2 5
> 32 XL_BOUNDSHEET 133
> 33 XL_BUILTINFMTCOUNT 86
> 34 XL_CF 433
> 35 XL_CODEPAGE 66
> 36 XL_COLINFO 125
> 37 XL_COLUMNDEFAULT 32
> 38 XL_COLWIDTH 36
> 39 XL_CONDFMT 432
> 40 XL_CONTINUE 60
> 41 XL_COUNTRY 140
> 42 XL_DATEMODE 34
> 43 XL_DEFAULTROWHEIGHT 549
> 44 XL_DEFCOLWIDTH 85
> 45 XL_DIMENSION 512
> 46 XL_DIMENSION2 0
> 47 XL_EFONT 69
> 48 XL_EOF 10
> 49 XL_EXTERNNAME 35
> 50 XL_EXTERNSHEET 23
> 51 XL_EXTSST 255
> 52 XL_FEAT11 2162
> 53 XL_FILEPASS 47
> 54 XL_FONT 49
> 55 XL_FONT_B3B4 561
> 56 XL_FORMAT 1054
> 57 XL_FORMAT2 30
> 58 XL_FORMULA 6
> 59 XL_FORMULA3 518
> 60 XL_FORMULA4 1030
> 61 XL_GCW 171
> 62 XL_HLINK 440
> 63 XL_QUICKTIP 2048
> 64 XL_HORIZONTALPAGEBREAKS 27
> 65 XL_INDEX 523
> 66 XL_INTEGER 2
> 67 XL_IXFE 68
> 68 XL_LABEL 516
> 69 XL_LABEL_B2 4
> 70 XL_LABELRANGES 351
> 71 XL_LABELSST 253
> 72 XL_LEFTMARGIN 38
> 73 XL_TOPMARGIN 40
> 74 XL_RIGHTMARGIN 39
> 75 XL_BOTTOMMARGIN 41
> 76 XL_HEADER 20
> 77 XL_FOOTER 21
> 78 XL_HCENTER 131
> 79 XL_VCENTER 132
> 80 XL_MERGEDCELLS 229
> 81 XL_MSO_DRAWING 236
> 82 XL_MSO_DRAWING_GROUP 235
> 83 XL_MSO_DRAWING_SELECTION 237
> 84 XL_MULRK 189
> 85 XL_MULBLANK 190
> 86 XL_NAME 24
> 87 XL_NOTE 28
> 88 XL_NUMBER 515
> 89 XL_NUMBER_B2 3
> 90 XL_OBJ 93
> 91 XL_PAGESETUP 161
> 92 XL_PALETTE 146
> 93 XL_PANE 65
> 94 XL_PRINTGRIDLINES 43
> 95 XL_PRINTHEADERS 42
> 96 XL_RK 638
> 97 XL_ROW 520
> 98 XL_ROW_B2 8
> 99 XL_RSTRING 214
> 100 XL_SCL 160
> 101 XL_SHEETHDR 143
> 102 XL_SHEETPR 129
> 103 XL_SHEETSOFFSET 142
> 104 XL_SHRFMLA 1212
> 105 XL_SST 252
> 106 XL_STANDARDWIDTH 153
> 107 XL_STRING 519
> 108 XL_STRING_B2 7
> 109 XL_STYLE 659
> 110 XL_SUPBOOK 430
> 111 XL_TABLEOP 566
> 112 XL_TABLEOP2 55
> 113 XL_TABLEOP_B2 54
> 114 XL_TXO 438
> 115 XL_UNCALCED 94
> 116 XL_UNKNOWN 65535
> 117 XL_VERTICALPAGEBREAKS 26
> 118 XL_WINDOW2 574
> 119 XL_WINDOW2_B2 62
> 120 XL_WRITEACCESS 92
> 121 XL_WSBOOL 129
> 122 XL_XF 224
> 123 XL_XF2 67
> 124 XL_XF3 579
> 125 XL_XF4 1091
> 126 FMLA_TYPE_CELL 1
> 127 FMLA_TYPE_SHARED 2
> 128 OBJ_MSO_DEBUG 0
> 129 _USE_SLOTS 1
### tuple
> 130 python_version (3, 7)
> 131 EXCEL_TEXT_TYPES (<class 'str'>, <class 'bytes'>, <class 'bytearray'>)
> 132 bofcodes (2057, 1033, 521, 9)
> 133 XL_FORMULA_OPCODES (6, 1030, 518)
> 134 _WINDOW2_options (('show_formulas', 0), ('show_grid_lines', 1), ('show_sheet_headers', 1), ('panes_are_frozen', 0), ('show_zero_values', ...
### dict
> 135 biff_text_from_num {0: '(not BIFF)', 20: '2.0', 21: '2.1', 30: '3', 40: '4S', 45: '4W', 50: '5', 70: '7', 80: '8', 85: '8X'}
> 136 error_text_from_code {0: '#NULL!', 7: '#DIV/0!', 15: '#VALUE!', 23: '#REF!', 29: '#NAME?', 36: '#NUM!', 42: '#N/A'}
> 137 boflen {2057: 8, 1033: 6, 521: 6, 9: 4}
> 138 biff_rec_name_dict {0: 'DIMENSIONS_B2', 1: 'BLANK_B2', 2: 'INTEGER_B2_ONLY', 3: 'NUMBER_B2', 4: 'LABEL_B2', 5: 'BOOLERR_B2', 6: 'FORMULA', ...
> 139 encoding_from_codepage {1200: 'utf_16_le', 10000: 'mac_roman', 10006: 'mac_greek', 10007: 'mac_cyrillic', 10029: 'mac_latin2', 10079: 'mac_icel...
> 140 cellty_from_fmtty {2: 2, 0: 2, 3: 2, 1: 3, 4: 2}
> 141 ctype_text {0: 'empty', 1: 'text', 2: 'number', 3: 'xldate', 4: 'bool', 5: 'error', 6: 'blank'}
## 模块
### 142 sys
> sys, fullname=sys, file=
## 函数
### 143 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
### 144 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
### 145 <lambda>(byte)
> <lambda>(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
### 146 fprintf(f, fmt, *vargs)
> fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
### 147 <lambda>(b, enc)
> <lambda>(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
### 148 <lambda>(s)
> <lambda>(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
### 149 is_cell_opcode(c)
> is_cell_opcode(c), module=xlrd.biffh, line:236 at site-packages\xlrd\biffh.py
### 150 upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>)
> upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>), module=xlrd.biffh, line:239 at site-packages\xlrd\biffh.py
### 151 upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>)
> upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>), module=xlrd.biffh, line:243 at site-packages\xlrd\biffh.py
### 152 unpack_string(data, pos, encoding, lenlen=1)
> unpack_string(data, pos, encoding, lenlen=1), module=xlrd.biffh, line:247 at site-packages\xlrd\biffh.py
### 153 unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None)
> unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None), module=xlrd.biffh, line:252 at site-packages\xlrd\biffh.py
### 154 unpack_unicode(data, pos, lenlen=2)
> unpack_unicode(data, pos, lenlen=2), module=xlrd.biffh, line:262 at site-packages\xlrd\biffh.py
返回unicode_strg
### 155 unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)
> unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None), module=xlrd.biffh, line:301 at site-packages\xlrd\biffh.py
返回(unicode_strg,更新后的pos值)
### 156 unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6)
> unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6), module=xlrd.biffh, line:336 at site-packages\xlrd\biffh.py
### 157 hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
> hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False), module=xlrd.biffh, line:521 at site-packages\xlrd\biffh.py
### 158 biff_dump(mem, stream_offset, stream_len, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
> biff_dump(mem, stream_offset, stream_len, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False), module=xlrd.biffh, line:552 at site-packages\xlrd\biffh.py
### 159 biff_count_records(mem, stream_offset, stream_len, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>)
> biff_count_records(mem, stream_offset, stream_len, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>), module=xlrd.biffh, line:598 at site-packages\xlrd\biffh.py
### 160 nearest_colour_index(colour_map, rgb, debug=0)
> nearest_colour_index(colour_map, rgb, debug=0), module=xlrd.formatting, line:129 at site-packages\xlrd\formatting.py
通用功能。使用欧几里得距离。到目前为止仅用于biff8之前的WINDOW2
记录。不一定要快。不需要很花哨。
### 161 decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0)
> decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0), module=xlrd.formula, line:1360 at site-packages\xlrd\formula.py
### 162 dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
> dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0), module=xlrd.formula, line:1886 at site-packages\xlrd\formula.py
### 163 rangename2d(rlo, rhi, clo, chi, r1c1=0)
> rangename2d(rlo, rhi, clo, chi, r1c1=0), module=xlrd.formula, line:2109 at site-packages\xlrd\formula.py
(5, 20, 7, 10)
=> '$H$6:$J$20'
### 164 unpack_RK(rk_str)
> unpack_RK(rk_str), module=xlrd.sheet, line:2219 at site-packages\xlrd\sheet.py
## 类
### 165 array.array
> array, array.array, module=array
array(typecode [, initializer]) -> array
返回一个新数组,其项受typecode限制,并从可选的初始化值初始化,该初始化值必须是适当类型元素的列表、字符串或可迭代对象。
数组表示基本值,其行为与列表非常相似,只是存储在其中的对象类型受到限制。
类型是在对象创建时通过使用类型代码指定的,类型代码是一个单个字符。
定义了以下类型代码:
Type code C Type Minimum size in bytes
‘b’ signed integer 1
‘B’ unsigned integer 1
‘u’ Unicode character 2 (see note)
‘h’ signed integer 2
‘H’ unsigned integer 2
‘i’ signed integer 2
‘I’ unsigned integer 2
‘l’ signed integer 4
‘L’ unsigned integer 4
‘q’ signed integer 8 (see note)
‘Q’ unsigned integer 8 (see note)
‘f’ floating point 4
‘d’ floating point 8
注意:“u”类型编码对应于Python的unicode字符。在窄构建是2字节, 宽构建是4字节。
注意:‘q’和`Q’类型代码仅在用于构建Python的平台C编译器支持’long long’或在Windows上支持’ int64’时可用。
方法:
append() – append a new item to the end of the array
buffer_info() – return information giving the current memory info
byteswap() – byteswap all the items of the array
count() – return number of occurrences of an object
extend() – extend array by appending multiple elements from an iterable
fromfile() – read items from a file object
fromlist() – append items from the list
frombytes() – append items from the string
index() – return index of first occurrence of an object
insert() – insert a new item into the array at a provided position
pop() – remove and return item (default last)
remove() – remove first occurrence of an object
reverse() – reverse the order of the items in the array
tofile() – write all items to a file object
tolist() – return the array converted to an ordinary list
tobytes() – return the array converted to a string
属性:
typecode – the typecode character used to create the array
itemsize – the length in bytes of one array item
#### data
> 1 itemsize=<attribute 'itemsize`of`array.array' objects> kind:data type:getset_descriptor class:<class 'array.array'>
> 2 typecode=<attribute 'typecode`of`array.array' objects> kind:data type:getset_descriptor class:<class 'array.array'>
#### method
> #### 3 append()
> kind=method class=array objtype=method_descriptor
将新值v追加到数组的末尾。
> #### 4 buffer_info()
> kind=method class=array objtype=method_descriptor
返回一个元组(address, length),给出当前内存地址和用于保存数组内容的缓冲区项的长度。
长度应该乘以itemsize属性来计算缓冲区长度(以字节为单位)。
> #### 5 byteswap()
> kind=method class=array objtype=method_descriptor
Byteswap数组的所有项。如果数组中的项的大小不是1、2、4或8字节,则会引发RuntimeError。
> #### 6 count()
> kind=method class=array objtype=method_descriptor
返回v在数组中出现的次数。
> #### 7 extend()
> kind=method class=array objtype=method_descriptor
将项追加到数组的末尾。
> #### 8 frombytes()
> kind=method class=array objtype=method_descriptor
从字符串中追加项目,将其解释为一个机器值数组,就像使用fromfile()方法从文件中读取一样。
> #### 9 fromfile()
> kind=method class=array objtype=method_descriptor
从文件对象f中读取n个对象,并将它们附加到数组的末尾。
> #### 10 fromlist()
> kind=method class=array objtype=method_descriptor
从列表中将项追加到数组。
> #### 11 fromstring()
> kind=method class=array objtype=method_descriptor
从字符串中追加项目,将其解释为一个机器值数组,就像使用fromfile()方法从文件中读取一样。此方法已弃用。请改用frombytes。
> #### 12 fromunicode()
> kind=method class=array objtype=method_descriptor
使用unicode字符串ustr中的数据扩展此数组。
数组必须是unicode类型数组;否则抛出ValueError。
使用array.frombytes(ustr.encode(…))将Unicode数据附加到其他类型的数组中。
> #### 13 index()
> kind=method class=array objtype=method_descriptor
返回v在数组中第一次出现的索引。
> #### 14 insert()
> kind=method class=array objtype=method_descriptor
在数组位置i之前插入一个新项v。
> #### 15 pop()
> kind=method class=array objtype=method_descriptor
返回第i个元素并将其从数组中删除。I默认为-1。
> #### 16 remove()
> kind=method class=array objtype=method_descriptor
删除数组中第一个出现的v。
> #### 17 reverse()
> kind=method class=array objtype=method_descriptor
颠倒数组中项目的顺序。
> #### 18 tobytes()
> kind=method class=array objtype=method_descriptor
将数组转换为机器值数组并返回字节表示。
> #### 19 tofile()
> kind=method class=array objtype=method_descriptor
将所有项(作为机器值)写入文件对象f。
> #### 20 tolist()
> kind=method class=array objtype=method_descriptor
将数组转换为具有相同项的普通列表。
> #### 21 tostring()
> kind=method class=array objtype=method_descriptor
将数组转换为机器值数组并返回字节表示。此方法已弃用。请改用tobytes。
This method is deprecated. Use tobytes instead.』
> #### 22 tounicode()
> kind=method class=array objtype=method_descriptor
使用unicode字符串ustr中的数据扩展此数组。将数组转换为unicode字符串。
数组必须是unicode类型数组;否则抛出ValueError。使用array.tobytes().decode()从其他类型的数组中获取unicode字符串。
### 166 _io.BytesIO
> BytesIO, _io.BytesIO, module=_io
### 167 range
> range, range, module=builtins
### 168 xlrd.biffh.XLRDError
> XLRDError, xlrd.biffh.XLRDError, module=xlrd.biffh
从Excel文件读取数据时出现问题的异常。
### 169 xlrd.biffh.BaseObject
> BaseObject, xlrd.biffh.BaseObject, module=xlrd.biffh
包中几乎所有其他类的父类。定义一个用于调试的通用:meth:dump
方法。
#### method
> #### 1 dump()
> kind=method class=BaseObject objtype=function
:param f: 转储文件写入的打开文件对象
:param header: 转储前写入的文本
:param footer: 转储后写入的文本
:param indent: 前导空格数(用于递归调用)
### 170 xlrd.formatting.Format
> Format, xlrd.formatting.Format, module=xlrd.formatting
来自“format”记录的“数字格式”信息。
versionadded: 0.6.1
#### data
> 1 format_key=0 kind:data type:int class:<class 'xlrd.formatting.Format'>
> 2 format_str= kind:data type:str class:<class 'xlrd.formatting.Format'>
> 3 type=0 kind:data type:int class:<class 'xlrd.formatting.Format'>
### 171 xlrd.sheet.Sheet
> Sheet, xlrd.sheet.Sheet, module=xlrd.sheet
包含一个工作表的数据。
在单元格访问函数中,rowx
是一个行索引,从0开始计数,colx
是一个列索引,从0开始计数。
以预期的方式支持行/列索引和切片位置为负值。有关单元格类型和单元格值的信息,请参阅:class:cell
类的文档。
不要自己实例化这个类。你访问:class:Sheet
对象通过:class:~xlrd.book。 当你调用:func:
xlrd.open_workbook 时返回的Book
对象。
#### data
> 1 book=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 2 cell_note_map={} kind:data type:dict class:<class 'xlrd.sheet.Sheet'>
> 3 col_label_ranges=[] kind:data type:list class:<class 'xlrd.sheet.Sheet'>
> 4 colinfo_map={} kind:data type:dict class:<class 'xlrd.sheet.Sheet'>
> 5 default_additional_space_above=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 6 default_additional_space_below=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 7 default_row_height=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 8 default_row_height_mismatch=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 9 default_row_hidden=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 10 defcolwidth=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 11 gcw=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... kind:data type:tuple class:<class 'xlrd.sheet.Sheet'>
> 12 has_pane_record=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 13 horizontal_page_breaks=[] kind:data type:list class:<class 'xlrd.sheet.Sheet'>
> 14 horz_split_first_visible=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 15 horz_split_pos=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 16 hyperlink_list=[] kind:data type:list class:<class 'xlrd.sheet.Sheet'>
> 17 hyperlink_map={} kind:data type:dict class:<class 'xlrd.sheet.Sheet'>
> 18 merged_cells=[] kind:data type:list class:<class 'xlrd.sheet.Sheet'>
> 19 name= kind:data type:str class:<class 'xlrd.sheet.Sheet'>
> 20 ncols=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 21 nrows=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 22 rich_text_runlist_map={} kind:data type:dict class:<class 'xlrd.sheet.Sheet'>
> 23 row_label_ranges=[] kind:data type:list class:<class 'xlrd.sheet.Sheet'>
> 24 rowinfo_map={} kind:data type:dict class:<class 'xlrd.sheet.Sheet'>
> 25 split_active_pane=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 26 standardwidth=None kind:data type:NoneType class:<class 'xlrd.sheet.Sheet'>
> 27 vert_split_first_visible=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 28 vert_split_pos=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
> 29 vertical_page_breaks=[] kind:data type:list class:<class 'xlrd.sheet.Sheet'>
> 30 visibility=0 kind:data type:int class:<class 'xlrd.sheet.Sheet'>
#### method
> #### 31 cell()
> kind=method class=Sheet objtype=function
:class: 'Cell’对象在给定的行和列。
> #### 32 cell_type()
> kind=method class=Sheet objtype=function
给定行和列中的单元格类型。请参阅:class:Cell
类的文档。
> #### 33 cell_value()
> kind=method class=Sheet objtype=function
给定行和列中的单元格的值。
> #### 34 cell_xf_index()
> kind=method class=Sheet objtype=function
给定行和列中单元格的XF索引。这是一个到::attr:~xlrd.book.Book.xf_list
…versionadded: 0.6.1
> #### 35 col()
> kind=method class=Sheet objtype=function
返回给定列中:class:Cell
对象的一个切片。
> #### 36 col_slice()
> kind=method class=Sheet objtype=function
返回给定列中:class:Cell
对象的一个切片。
> #### 37 col_types()
> kind=method class=Sheet objtype=function
返回给定列中单元格类型的切片。
> #### 38 col_values()
> kind=method class=Sheet objtype=function
返回给定列中单元格值的一个切片。
> #### 39 computed_column_width()
> kind=method class=Sheet objtype=function
确定列显示宽度。
:param colx:
查询列的索引,取值范围0 ~ 255。
请注意,可以找出用于显示没有单元格信息的列的宽度,例如列IV (colx=255)。
:return:
用于Excel显示给定列的列宽,单位为标准字符宽度的1/256(第一个字体中的数字0)
…versionadded: 0.6.1
> #### 40 fake_XF_from_BIFF20_cell_attr()
> kind=method class=Sheet objtype=function
> #### 41 fixed_BIFF2_xfindex()
> kind=method class=Sheet objtype=function
> #### 42 get_rows()
> kind=method class=Sheet objtype=function
返回一个用于遍历每行的生成器。
> #### 43 handle_feat11()
> kind=method class=Sheet objtype=function
> #### 44 handle_hlink()
> kind=method class=Sheet objtype=function
> #### 45 handle_msodrawingetc()
> kind=method class=Sheet objtype=function
> #### 46 handle_note()
> kind=method class=Sheet objtype=function
> #### 47 handle_obj()
> kind=method class=Sheet objtype=function
> #### 48 handle_quicktip()
> kind=method class=Sheet objtype=function
> #### 49 handle_txo()
> kind=method class=Sheet objtype=function
> #### 50 insert_new_BIFF20_xf()
> kind=method class=Sheet objtype=function
> #### 51 put_cell_ragged()
> kind=method class=Sheet objtype=function
> #### 52 put_cell_unragged()
> kind=method class=Sheet objtype=function
> #### 53 read()
> kind=method class=Sheet objtype=function
> #### 54 req_fmt_info()
> kind=method class=Sheet objtype=function
> #### 55 row()
> kind=method class=Sheet objtype=function
返回给定行中:class:Cell
对象的序列。
> #### 56 row_len()
> kind=method class=Sheet objtype=function
返回给定行的有效单元格数。
用于open_workbook(ragged_rows=True)
,这可能会产生小于 :attr:~Sheet.ncols
的行。
versionadded: 0.7.2
> #### 57 row_slice()
> kind=method class=Sheet objtype=function
返回给定行中:class:Cell
对象的一个切片。
> #### 58 row_types()
> kind=method class=Sheet objtype=function
返回给定行中单元格类型的切片。
> #### 59 row_values()
> kind=method class=Sheet objtype=function
返回给定行中单元格值的一个切片。
> #### 60 string_record_contents()
> kind=method class=Sheet objtype=function
> #### 61 tidy_dimensions()
> kind=method class=Sheet objtype=function
> #### 62 update_cooked_mag_factors()
> kind=method class=Sheet objtype=function
### 172 xlrd.sheet.MSODrawing
> MSODrawing, xlrd.sheet.MSODrawing, module=xlrd.sheet
### 173 xlrd.sheet.MSObj
> MSObj, xlrd.sheet.MSObj, module=xlrd.sheet
### 174 xlrd.sheet.MSTxo
> MSTxo, xlrd.sheet.MSTxo, module=xlrd.sheet
### 175 xlrd.sheet.Note
> Note, xlrd.sheet.Note, module=xlrd.sheet
表示用户“评论”或“注释”。
notes对象可以通过:attr:Sheet.cell_note_map
访问。
versionadded: 0.7.2
#### data
> 1 author= kind:data type:str class:<class 'xlrd.sheet.Note'>
> 2 col_hidden=0 kind:data type:int class:<class 'xlrd.sheet.Note'>
> 3 colx=0 kind:data type:int class:<class 'xlrd.sheet.Note'>
> 4 rich_text_runlist=None kind:data type:NoneType class:<class 'xlrd.sheet.Note'>
> 5 row_hidden=0 kind:data type:int class:<class 'xlrd.sheet.Note'>
> 6 rowx=0 kind:data type:int class:<class 'xlrd.sheet.Note'>
> 7 show=0 kind:data type:int class:<class 'xlrd.sheet.Note'>
> 8 text= kind:data type:str class:<class 'xlrd.sheet.Note'>
### 176 xlrd.sheet.Hyperlink
> Hyperlink, xlrd.sheet.Hyperlink, module=xlrd.sheet
包含超链接的属性。超链接对象可以通过:attr:Sheet.hyperlink_list
访问。
versionadded: 0.7.2
#### data
> 1 desc=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 2 fcolx=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 3 frowx=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 4 lcolx=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 5 lrowx=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 6 quicktip=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 7 target=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 8 textmark=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 9 type=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
> 10 url_or_path=None kind:data type:NoneType class:<class 'xlrd.sheet.Hyperlink'>
### 177 xlrd.sheet.Cell
> Cell, xlrd.sheet.Cell, module=xlrd.sheet
包含一个单元格的数据。
警告:不要自己调用这个类。您可以通过在:class:~xlrd.book.Book
中找到的:class:Sheet
对象的方法访问:class:Cell
对象。
当你调用:func:~xlrd.open_workbook
对象。
Cell对象有三个属性:
“ctype”是一个int,“value”(取决于“ctype”)和“xf_index”。如果打开工作簿时没有启用formatting_info
,则xf_index
将为None
。
下表描述了单元格的类型及其值用Python表示。
… raw:: html
Type symbol | Type number | Python value |
---|---|---|
XL_CELL_EMPTY | 0 | empty string ‘’ |
XL_CELL_TEXT | 1 | a Unicode string |
XL_CELL_NUMBER | 2 | float |
XL_CELL_DATE | 3 | float |
XL_CELL_BOOLEAN | 4 | int; 1 means TRUE, 0 means FALSE |
XL_CELL_ERROR | 5 | int representing internal Excel codes; for a text representation, refer to the supplied dictionary error_text_from_code |
XL_CELL_BLANK | 6 | empty string ‘’. Note: this type will appear only when open_workbook(…, formatting_info=True) is used. |
#### data
> 1 ctype=<member 'ctype`of`Cell' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Cell'>
> 2 value=<member 'value`of`Cell' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Cell'>
> 3 xf_index=<member 'xf_index`of`Cell' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Cell'>
### 178 xlrd.sheet.Colinfo
> Colinfo, xlrd.sheet.Colinfo, module=xlrd.sheet
应用于工作表中的一个或多个列的宽度和默认格式信息。
从COLINFO
记录派生。
根据OOo文档,下面是宽度的默认层次结构:
在BIFF3中,如果一个列缺少COLINFO
记录,则使用记录DEFCOLWIDTH
中指定的宽度。
在BIFF4-BIFF7中,只有当该列的对应位在“GCW”中被清除时,才会使用此“COLINFO”记录中设置的宽度。
记录,否则使用DEFCOLWIDTH
记录中设置的列宽度(STANDARDWIDTH
记录在这种情况下总是被忽略[#f1]_)。
在BIFF8中,如果某列缺少COLINFO
记录,则使用记录STANDARDWIDTH
中指定的宽度。
如果STANDARDWIDTH
记录也没有,则使用DEFCOLWIDTH
记录的列宽度。
[#f1] GCW
记录上的文档说:如果设置了位,则对应的列使用“STANDARDWIDTH“记录。
如果一个位被清除,对应的列使用COLINFO
记录中为该列设置的宽度。
如果设置了位,并且工作表不包含STANDARDWIDTH
记录,或者如果位被清除,并且工作表不包含COLINFO
记录,
则将使用工作表的DEFCOLWIDTH
记录。
xlrd是GCW版本的故事。对源代码的引用可能有用:参见 :meth:Sheet.computed_column_width
。
…versionadded: 0.6.1
#### data
> 1 bit1_flag=0 kind:data type:int class:<class 'xlrd.sheet.Colinfo'>
> 2 collapsed=0 kind:data type:int class:<class 'xlrd.sheet.Colinfo'>
> 3 hidden=0 kind:data type:int class:<class 'xlrd.sheet.Colinfo'>
> 4 outline_level=0 kind:data type:int class:<class 'xlrd.sheet.Colinfo'>
> 5 width=0 kind:data type:int class:<class 'xlrd.sheet.Colinfo'>
> 6 xf_index=-1 kind:data type:int class:<class 'xlrd.sheet.Colinfo'>
### 179 xlrd.sheet.Rowinfo
> Rowinfo, xlrd.sheet.Rowinfo, module=xlrd.sheet
应用于工作表中的行的高度和默认格式信息。
派生自ROW
记录。
versionadded: 0.6.1
#### data
> 1 additional_space_above=<member 'additional_space_above`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 2 additional_space_below=<member 'additional_space_below`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 3 has_default_height=<member 'has_default_height`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 4 has_default_xf_index=<member 'has_default_xf_index`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 5 height=<member 'height`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 6 height_mismatch=<member 'height_mismatch`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 7 hidden=<member 'hidden`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 8 outline_group_starts_ends=<member 'outline_group_starts_ends`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 9 outline_level=<member 'outline_level`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
> 10 xf_index=<member 'xf_index`of`Rowinfo' objects> kind:data type:member_descriptor class:<class 'xlrd.sheet.Rowinfo'>
## 内嵌函数或方法
> 180 calcsize <built-in function calcsize>
> 181 unpack <built-in function unpack>
> 182 REPR <built-in function ascii>
> 183 unichr <built-in function chr>
## 私有或局部
> 184 _WINDOW2_options (('show_formulas', 0), ('show_grid_lines', 1), ('show_sheet_headers', 1), ('panes_are_frozen', 0), ('show_zero_values', ...
> 185 _USE_SLOTS 1
## 剩余
> 186 __doc__ None
> 187 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FD4F88>
> 188 __spec__ ModuleSpec(name='xlrd.sheet', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FD4F88>, origin='...\\lib\\site-packages\\xlrd\\sheet.py')
> 189 print_function _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
> 190 empty_cell empty:''
## 【xlrd.book】
> book, fullname=xlrd.book, file=xlrd\book.py
## 统计
序号|类别|数量
---|---|---
1|int|144
4|str|4
5|tuple|5
8|dict|9
9|module|6
10|class|8
11|function|29
12|builtin_function_or_method|4
13|residual|5
14|system|8
16|all|214
## 常量
### int
> 1 DEBUG 0
> 2 FUN 0
> 3 FDT 1
> 4 FNU 2
> 5 FGE 3
> 6 FTX 4
> 7 DATEFORMAT 1
> 8 NUMBERFORMAT 2
> 9 XL_CELL_EMPTY 0
> 10 XL_CELL_TEXT 1
> 11 XL_CELL_NUMBER 2
> 12 XL_CELL_DATE 3
> 13 XL_CELL_BOOLEAN 4
> 14 XL_CELL_ERROR 5
> 15 XL_CELL_BLANK 6
> 16 BIFF_FIRST_UNICODE 80
> 17 XL_WORKBOOK_GLOBALS 5
> 18 WBKBLOBAL 5
> 19 XL_WORKBOOK_GLOBALS_4W 256
> 20 XL_WORKSHEET 16
> 21 WRKSHEET 16
> 22 XL_BOUNDSHEET_WORKSHEET 0
> 23 XL_BOUNDSHEET_CHART 2
> 24 XL_BOUNDSHEET_VB_MODULE 6
> 25 XL_ARRAY 545
> 26 XL_ARRAY2 33
> 27 XL_BLANK 513
> 28 XL_BLANK_B2 1
> 29 XL_BOF 2057
> 30 XL_BOOLERR 517
> 31 XL_BOOLERR_B2 5
> 32 XL_BOUNDSHEET 133
> 33 XL_BUILTINFMTCOUNT 86
> 34 XL_CF 433
> 35 XL_CODEPAGE 66
> 36 XL_COLINFO 125
> 37 XL_COLUMNDEFAULT 32
> 38 XL_COLWIDTH 36
> 39 XL_CONDFMT 432
> 40 XL_CONTINUE 60
> 41 XL_COUNTRY 140
> 42 XL_DATEMODE 34
> 43 XL_DEFAULTROWHEIGHT 549
> 44 XL_DEFCOLWIDTH 85
> 45 XL_DIMENSION 512
> 46 XL_DIMENSION2 0
> 47 XL_EFONT 69
> 48 XL_EOF 10
> 49 XL_EXTERNNAME 35
> 50 XL_EXTERNSHEET 23
> 51 XL_EXTSST 255
> 52 XL_FEAT11 2162
> 53 XL_FILEPASS 47
> 54 XL_FONT 49
> 55 XL_FONT_B3B4 561
> 56 XL_FORMAT 1054
> 57 XL_FORMAT2 30
> 58 XL_FORMULA 6
> 59 XL_FORMULA3 518
> 60 XL_FORMULA4 1030
> 61 XL_GCW 171
> 62 XL_HLINK 440
> 63 XL_QUICKTIP 2048
> 64 XL_HORIZONTALPAGEBREAKS 27
> 65 XL_INDEX 523
> 66 XL_INTEGER 2
> 67 XL_IXFE 68
> 68 XL_LABEL 516
> 69 XL_LABEL_B2 4
> 70 XL_LABELRANGES 351
> 71 XL_LABELSST 253
> 72 XL_LEFTMARGIN 38
> 73 XL_TOPMARGIN 40
> 74 XL_RIGHTMARGIN 39
> 75 XL_BOTTOMMARGIN 41
> 76 XL_HEADER 20
> 77 XL_FOOTER 21
> 78 XL_HCENTER 131
> 79 XL_VCENTER 132
> 80 XL_MERGEDCELLS 229
> 81 XL_MSO_DRAWING 236
> 82 XL_MSO_DRAWING_GROUP 235
> 83 XL_MSO_DRAWING_SELECTION 237
> 84 XL_MULRK 189
> 85 XL_MULBLANK 190
> 86 XL_NAME 24
> 87 XL_NOTE 28
> 88 XL_NUMBER 515
> 89 XL_NUMBER_B2 3
> 90 XL_OBJ 93
> 91 XL_PAGESETUP 161
> 92 XL_PALETTE 146
> 93 XL_PANE 65
> 94 XL_PRINTGRIDLINES 43
> 95 XL_PRINTHEADERS 42
> 96 XL_RK 638
> 97 XL_ROW 520
> 98 XL_ROW_B2 8
> 99 XL_RSTRING 214
> 100 XL_SCL 160
> 101 XL_SHEETHDR 143
> 102 XL_SHEETPR 129
> 103 XL_SHEETSOFFSET 142
> 104 XL_SHRFMLA 1212
> 105 XL_SST 252
> 106 XL_STANDARDWIDTH 153
> 107 XL_STRING 519
> 108 XL_STRING_B2 7
> 109 XL_STYLE 659
> 110 XL_SUPBOOK 430
> 111 XL_TABLEOP 566
> 112 XL_TABLEOP2 55
> 113 XL_TABLEOP_B2 54
> 114 XL_TXO 438
> 115 XL_UNCALCED 94
> 116 XL_UNKNOWN 65535
> 117 XL_VERTICALPAGEBREAKS 26
> 118 XL_WINDOW2 574
> 119 XL_WINDOW2_B2 62
> 120 XL_WRITEACCESS 92
> 121 XL_WSBOOL 129
> 122 XL_XF 224
> 123 XL_XF2 67
> 124 XL_XF3 579
> 125 XL_XF4 1091
> 126 oBOOL 3
> 127 oERR 4
> 128 oNUM 2
> 129 oREF -1
> 130 oREL -2
> 131 oSTRG 1
> 132 oUNK 0
> 133 FMLA_TYPE_CELL 1
> 134 FMLA_TYPE_SHARED 2
> 135 FMLA_TYPE_ARRAY 4
> 136 FMLA_TYPE_COND_FMT 8
> 137 FMLA_TYPE_DATA_VAL 16
> 138 FMLA_TYPE_NAME 32
> 139 MY_EOF 251706026
> 140 SUPBOOK_UNK 0
> 141 SUPBOOK_INTERNAL 1
> 142 SUPBOOK_EXTERNAL 2
> 143 SUPBOOK_ADDIN 3
> 144 SUPBOOK_DDEOLE 4
### tuple
> 145 python_version (3, 7)
> 146 EXCEL_TEXT_TYPES (<class 'str'>, <class 'bytes'>, <class 'bytearray'>)
> 147 bofcodes (2057, 1033, 521, 9)
> 148 XL_FORMULA_OPCODES (6, 1030, 518)
> 149 SUPPORTED_VERSIONS (80, 70, 50, 45, 40, 30, 21, 20)
### dict
> 150 biff_text_from_num {0: '(not BIFF)', 20: '2.0', 21: '2.1', 30: '3', 40: '4S', 45: '4W', 50: '5', 70: '7', 80: '8', 85: '8X'}
> 151 error_text_from_code {0: '#NULL!', 7: '#DIV/0!', 15: '#VALUE!', 23: '#REF!', 29: '#NAME?', 36: '#NUM!', 42: '#N/A'}
> 152 boflen {2057: 8, 1033: 6, 521: 6, 9: 4}
> 153 biff_rec_name_dict {0: 'DIMENSIONS_B2', 1: 'BLANK_B2', 2: 'INTEGER_B2_ONLY', 3: 'NUMBER_B2', 4: 'LABEL_B2', 5: 'BOOLERR_B2', 6: 'FORMULA', ...
> 154 encoding_from_codepage {1200: 'utf_16_le', 10000: 'mac_roman', 10006: 'mac_greek', 10007: 'mac_cyrillic', 10029: 'mac_latin2', 10079: 'mac_icel...
> 155 okind_dict {-2: 'oREL', -1: 'oREF', 0: 'oUNK', 1: 'oSTRG', 2: 'oNUM', 3: 'oBOOL', 4: 'oERR', 5: 'oMSNG'}
> 156 builtin_name_from_code {'\x00': 'Consolidate_Area', '\x01': 'Auto_Open', '\x02': 'Auto_Close', '\x03': 'Extract', '\x04': 'Database', '\x05': '...
> 157 code_from_builtin_name {'Consolidate_Area': '\x00', 'Auto_Open': '\x01', 'Auto_Close': '\x02', 'Extract': '\x03', 'Database': '\x04', 'Criteria...
## 模块
### 158 struct
> struct, fullname=struct, file=struct.py
### 159 xlrd.compdoc
> compdoc, fullname=xlrd.compdoc, file=xlrd\compdoc.py
实现从OLE2复合文档文件中提取“工作簿”或“图书”流(作为一个大字符串)所需的最小功能。
### 160 xlrd.formatting
> formatting, fullname=xlrd.formatting, file=xlrd\formatting.py
模块用于格式化信息。
### 161 xlrd.sheet
> sheet, fullname=xlrd.sheet, file=xlrd\sheet.py
### 162 sys
> sys, fullname=sys, file=
### 163 mmap
> mmap, fullname=mmap, file=
## 函数
### 164 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:18 at site-packages\xlrd\timemachine.py
### 165 <lambda>(x)
> <lambda>(x), module=xlrd.timemachine, line:19 at site-packages\xlrd\timemachine.py
### 166 <lambda>(byte)
> <lambda>(byte), module=xlrd.timemachine, line:20 at site-packages\xlrd\timemachine.py
### 167 fprintf(f, fmt, *vargs)
> fprintf(f, fmt, *vargs), module=xlrd.timemachine, line:22 at site-packages\xlrd\timemachine.py
### 168 <lambda>(b, enc)
> <lambda>(b, enc), module=xlrd.timemachine, line:31 at site-packages\xlrd\timemachine.py
### 169 <lambda>(s)
> <lambda>(s), module=xlrd.timemachine, line:32 at site-packages\xlrd\timemachine.py
### 170 is_cell_opcode(c)
> is_cell_opcode(c), module=xlrd.biffh, line:236 at site-packages\xlrd\biffh.py
### 171 upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>)
> upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>), module=xlrd.biffh, line:239 at site-packages\xlrd\biffh.py
### 172 upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>)
> upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<class 'int'>), module=xlrd.biffh, line:243 at site-packages\xlrd\biffh.py
### 173 unpack_string(data, pos, encoding, lenlen=1)
> unpack_string(data, pos, encoding, lenlen=1), module=xlrd.biffh, line:247 at site-packages\xlrd\biffh.py
### 174 unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None)
> unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None), module=xlrd.biffh, line:252 at site-packages\xlrd\biffh.py
### 175 unpack_unicode(data, pos, lenlen=2)
> unpack_unicode(data, pos, lenlen=2), module=xlrd.biffh, line:262 at site-packages\xlrd\biffh.py
返回unicode_strg
### 176 unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)
> unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None), module=xlrd.biffh, line:301 at site-packages\xlrd\biffh.py
返回(unicode_strg,更新后的pos值)
### 177 unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6)
> unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6), module=xlrd.biffh, line:336 at site-packages\xlrd\biffh.py
### 178 hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
> hex_char_dump(strg, ofs, dlen, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False), module=xlrd.biffh, line:521 at site-packages\xlrd\biffh.py
### 179 biff_dump(mem, stream_offset, stream_len, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False)
> biff_dump(mem, stream_offset, stream_len, base=0, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, unnumbered=False), module=xlrd.biffh, line:552 at site-packages\xlrd\biffh.py
### 180 biff_count_records(mem, stream_offset, stream_len, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>)
> biff_count_records(mem, stream_offset, stream_len, fout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>), module=xlrd.biffh, line:598 at site-packages\xlrd\biffh.py
### 181 decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0)
> decompile_formula(bk, fmla, fmlalen, fmlatype=None, browx=None, bcolx=None, blah=0, level=0, r1c1=0), module=xlrd.formula, line:1360 at site-packages\xlrd\formula.py
### 182 dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
> dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0), module=xlrd.formula, line:1886 at site-packages\xlrd\formula.py
### 183 evaluate_name_formula(bk, nobj, namex, blah=0, level=0)
> evaluate_name_formula(bk, nobj, namex, blah=0, level=0), module=xlrd.formula, line:752 at site-packages\xlrd\formula.py
### 184 rangename3d(book, ref3d)
> rangename3d(book, ref3d), module=xlrd.formula, line:2130 at site-packages\xlrd\formula.py
实用函数:
``Ref3D(1, 4, 5, 20, 7, 10)`` =>
``'Sheet2:Sheet3!$H$6:$J$20'``
(假设Excel的默认表名)
### 185 rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0)
> rangename3drel(book, ref3d, browx=None, bcolx=None, r1c1=0), module=xlrd.formula, line:2142 at site-packages\xlrd\formula.py
实用函数:
``Ref3D(coords=(0, 1, -32, -22, -13, 13), relflags=(0, 0, 1, 1, 1, 1))``
在R1C1模式 => ``'Sheet1!R[-32]C[-13]:R[-23]C[12]'``
在A1模式 => 依赖于基本单元格 ``(browx, bcolx)``
### 186 cellname(rowx, colx)
> cellname(rowx, colx), module=xlrd.formula, line:2078 at site-packages\xlrd\formula.py
实用函数:(5, 7)
=> '$H$6'
### 187 cellnameabs(rowx, colx, r1c1=0)
> cellnameabs(rowx, colx, r1c1=0), module=xlrd.formula, line:2082 at site-packages\xlrd\formula.py
实用函数:(5, 7)
=> '$H$6'
### 188 colname(colx, _A2Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ')
> colname(colx, _A2Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'), module=xlrd.book, line:1368 at site-packages\xlrd\book.py
### 189 open_workbook_xls(filename=None, logfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False)
> open_workbook_xls(filename=None, logfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='GB18030'>, verbosity=0, use_mmap=True, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False, ragged_rows=False, ignore_workbook_corruption=False), module=xlrd.book, line:59 at site-packages\xlrd\book.py
### 190 expand_cell_address(inrow, incol)
> expand_cell_address(inrow, incol), module=xlrd.book, line:1350 at site-packages\xlrd\book.py
### 191 display_cell_address(rowx, colx, relrow, relcol)
> display_cell_address(rowx, colx, relrow, relcol), module=xlrd.book, line:1378 at site-packages\xlrd\book.py
### 192 unpack_SST_table(datatab, nstrings)
> unpack_SST_table(datatab, nstrings), module=xlrd.book, line:1389 at site-packages\xlrd\book.py
返回字符串列表
## 类
### 193 _io.BytesIO
> BytesIO, _io.BytesIO, module=_io
### 194 range
> range, range, module=builtins
### 195 xlrd.biffh.XLRDError
> XLRDError, xlrd.biffh.XLRDError, module=xlrd.biffh
从Excel文件读取数据时出现问题的异常。
### 196 xlrd.biffh.BaseObject
> BaseObject, xlrd.biffh.BaseObject, module=xlrd.biffh
包中几乎所有其他类的父类。定义一个用于调试的通用:meth:dump
方法。
#### method
> #### 1 dump()
> kind=method class=BaseObject objtype=function
:param f: 转储文件写入的打开文件对象
:param header: 转储前写入的文本
:param footer: 转储后写入的文本
:param indent: 前导空格数(用于递归调用)
### 197 xlrd.formula.Operand
> Operand, xlrd.formula.Operand, module=xlrd.formula
用于计算公式。(见前)
#### data
> 1 kind=0 kind:data type:int class:<class 'xlrd.formula.Operand'>
> 2 text=? kind:data type:str class:<class 'xlrd.formula.Operand'>
> 3 value=None kind:data type:NoneType class:<class 'xlrd.formula.Operand'>
### 198 xlrd.formula.Ref3D
> Ref3D, xlrd.formula.Ref3D, module=xlrd.formula
表示对包含一个或多个单元格的方框的绝对或相对三维引用。(见前)
### 199 xlrd.book.Name
> Name, xlrd.book.Name, module=xlrd.book
与已命名引用、公式、宏等相关的信息。
注意:名称信息是不是从Excel 5.0以上的文件中提取的Book.biff_version < 50
#### data
> 1 binary=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 2 book=None kind:data type:NoneType class:<class 'xlrd.book.Name'>
> 3 builtin=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 4 complex=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 5 func=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 6 funcgroup=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 7 hidden=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 8 macro=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 9 name= kind:data type:str class:<class 'xlrd.book.Name'>
> 10 name_index=0 kind:data type:int class:<class 'xlrd.book.Name'>
> 11 raw_formula=b'' kind:data type:bytes class:<class 'xlrd.book.Name'>
> 12 result=None kind:data type:NoneType class:<class 'xlrd.book.Name'>
> 13 scope=-1 kind:data type:int class:<class 'xlrd.book.Name'>
> 14 vbasic=0 kind:data type:int class:<class 'xlrd.book.Name'>
#### method
> #### 15 area2d()
> kind=method class=Name objtype=function
对于名称指工作表中的一个矩形区域的用例,这是一种方便的方法。
:param clipped:
如果默认为True
,返回的矩形将被剪切以适应(0, sheet.nrows, 0, sheet.ncols)
。
它保证 0 <= rowxlo <= rowxhi <= sheet.nrows
并且该区域中的可用行数(可能为零)为rowxhi - rowxlo
;列也是如此。
:返回: 一个元组(sheet_object, rowxlo, rowxhi, colxlo, colxhi)
。
:引发xlrd.biffh.XLRDError: 该名称不是对单个表中单个区域的常量绝对引用。
> #### 16 cell()
> kind=method class=Name objtype=function
对于名称引用单个单元格的频繁用例,这是一种方便的方法。
:返回: :class:~xlrd.sheet.Cell
的实例。
:引发 xlrd.biffh.XLRDError: 该名称不是对单个单元格的常量绝对引用。
### 200 xlrd.book.Book
> Book, xlrd.book.Book, module=xlrd.book
“工作簿”的内容。
你不应该自己实例化这个类。你可以使用调用 :func:~xlrd.open_workbook
时返回的:class:Book
对象。
#### data
> 1 biff_version=0 kind:data type:int class:<class 'xlrd.book.Book'>
> 2 codepage=None kind:data type:NoneType class:<class 'xlrd.book.Book'>
> 3 colour_map={} kind:data type:dict class:<class 'xlrd.book.Book'>
> 4 countries=(0, 0) kind:data type:tuple class:<class 'xlrd.book.Book'>
> 5 datemode=0 kind:data type:int class:<class 'xlrd.book.Book'>
> 6 encoding=None kind:data type:NoneType class:<class 'xlrd.book.Book'>
> 7 font_list=[] kind:data type:list class:<class 'xlrd.book.Book'>
> 8 format_list=[] kind:data type:list class:<class 'xlrd.book.Book'>
> 9 format_map={} kind:data type:dict class:<class 'xlrd.book.Book'>
> 10 load_time_stage_1=-1.0 kind:data type:float class:<class 'xlrd.book.Book'>
> 11 load_time_stage_2=-1.0 kind:data type:float class:<class 'xlrd.book.Book'>
> 12 name_and_scope_map={} kind:data type:dict class:<class 'xlrd.book.Book'>
> 13 name_map={} kind:data type:dict class:<class 'xlrd.book.Book'>
> 14 name_obj_list=[] kind:data type:list class:<class 'xlrd.book.Book'>
> 15 nsheets=0 kind:data type:int class:<class 'xlrd.book.Book'>
> 16 palette_record=[] kind:data type:list class:<class 'xlrd.book.Book'>
> 17 style_name_map={} kind:data type:dict class:<class 'xlrd.book.Book'>
> 18 user_name= kind:data type:str class:<class 'xlrd.book.Book'>
> 19 xf_list=[] kind:data type:list class:<class 'xlrd.book.Book'>
#### method
> #### 20 biff2_8_load()
> kind=method class=Book objtype=function
> #### 21 derive_encoding()
> kind=method class=Book objtype=function
> #### 22 fake_globals_get_sheet()
> kind=method class=Book objtype=function
> #### 23 get2bytes()
> kind=method class=Book objtype=function
> #### 24 get_record_parts()
> kind=method class=Book objtype=function
> #### 25 get_record_parts_conditional()
> kind=method class=Book objtype=function
> #### 26 get_sheet()
> kind=method class=Book objtype=function
> #### 27 get_sheets()
> kind=method class=Book objtype=function
> #### 28 getbof()
> kind=method class=Book objtype=function
> #### 29 handle_boundsheet()
> kind=method class=Book objtype=function
> #### 30 handle_builtinfmtcount()
> kind=method class=Book objtype=function
> #### 31 handle_codepage()
> kind=method class=Book objtype=function
> #### 32 handle_country()
> kind=method class=Book objtype=function
> #### 33 handle_datemode()
> kind=method class=Book objtype=function
> #### 34 handle_externname()
> kind=method class=Book objtype=function
> #### 35 handle_externsheet()
> kind=method class=Book objtype=function
> #### 36 handle_filepass()
> kind=method class=Book objtype=function
> #### 37 handle_name()
> kind=method class=Book objtype=function
> #### 38 handle_obj()
> kind=method class=Book objtype=function
> #### 39 handle_sheethdr()
> kind=method class=Book objtype=function
> #### 40 handle_sheetsoffset()
> kind=method class=Book objtype=function
> #### 41 handle_sst()
> kind=method class=Book objtype=function
> #### 42 handle_supbook()
> kind=method class=Book objtype=function
> #### 43 handle_writeaccess()
> kind=method class=Book objtype=function
> #### 44 initialise_format_info()
> kind=method class=Book objtype=function
> #### 45 names_epilogue()
> kind=method class=Book objtype=function
> #### 46 parse_globals()
> kind=method class=Book objtype=function
> #### 47 read()
> kind=method class=Book objtype=function
> #### 48 release_resources()
> kind=method class=Book objtype=function
这种方法有双重目的。你可以调用它来释放占用内存的对象和(可能的)内存映射文件(:class:mmap.mmap
)。
当你在on_demand
模式下完成了加载工作表,但仍然需要:class:Book
对象来检查加载的工作表。
当:func:~xlrd.open_workbook
时,它也被自动(a)调用。
打开工作簿的引发一个异常(b)如果你正在使用with
语句,当with
块被退出时。在同一对象上多次调用此方法不会产生不良影响。
> #### 49 sheet_by_index()
> kind=method class=Book objtype=function
:param sheetx: 表索引``range(nsheets)``
:returns: 类:class:`~xlrd.sheet.Sheet`
> #### 50 sheet_by_name()
> kind=method class=Book objtype=function
:param sheet_name: 所需的表的名称。
:returns: 类:class:`~xlrd.sheet.Sheet`
> #### 51 sheet_loaded()
> kind=method class=Book objtype=function
:param sheet_name_or_index: 查询表的名称或索引
:returns:``True`` 如果表已加载, ``False`` 否则.
.. versionadded:: 0.7.1
> #### 52 sheet_names()
> kind=method class=Book objtype=function
:返回:
工作簿文件中所有工作表的名称列表。即使在还没有加载表的情况下,这些信息也是可用的。
> #### 53 sheets()
> kind=method class=Book objtype=function
:返回:
book中所有表的列表。所有尚未装入的页都将装入。
> #### 54 unload_sheet()
> kind=method class=Book objtype=function
:param sheet_name_or_index: 要卸载的表的名称或索引。
.. versionadded:: 0.7.1
## 内嵌函数或方法
> 201 unpack <built-in function unpack>
> 202 REPR <built-in function ascii>
> 203 unichr <built-in function chr>
> 204 perf_counter <built-in function perf_counter>
## 剩余
> 205 __doc__ None
> 206 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x0000000002FA94C8>
> 207 __spec__ ModuleSpec(name='xlrd.book', loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000002FA94C8>, origin='...\\lib\\site-packages\\xlrd\\book.py')
> 208 print_function _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
> 209 empty_cell empty:''
## 【xlrd.info】
> info, fullname=xlrd.info, file=xlrd\info.py
## 统计
序号|类别|数量
---|---|---
4|str|6
8|dict|1
13|residual|3
14|system|10
16|all|10
## 常量
## 【xlrd.xldate】
> xldate, fullname=xlrd.xldate, file=xlrd\xldate.py
用于在Excel文件中处理日期和时间的工具。
从“日”到“日”(年、月、日)的转换以一个整数“儒略历日”(又名JDN)开始。
FWIW:
- JDN 0对应于公历年-4713年11月24日星期一的中午。
更重要的是:
公历1900-03-01日的中午(基于1900年的系统中的第61天)为JDN 2415080.0;
公历1904-01-02日的中午(基于1904年的系统中的第1天)为JDN 2416482.0
## 统计
序号|类别|数量
---|---|---
4|str|5
5|tuple|3
8|dict|1
9|module|1
10|class|6
11|function|6
13|residual|5
14|system|8
15|private|4
16|all|27
## 常量
### tuple
> 1 _JDN_delta (2415019, 2416481)
> 2 _XLDAYS_TOO_LARGE (2958466, 2957004)
> 3 _days_in_month (None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
## 模块
### 4 datetime
> datetime, fullname=datetime, file=datetime.py
datetime类型的快速实现。
## 函数
### 5 xldate_as_tuple(xldate, datemode)
> xldate_as_tuple(xldate, datemode), module=xlrd.xldate, line:59 at site-packages\xlrd\xldate.py
将一个Excel数字(假定表示日期、datetime或时间)转换为适合提供给datetime或mx.DateTime构造函数。
见前。
### 6 xldate_as_datetime(xldate, datemode)
> xldate_as_datetime(xldate, datemode), module=xlrd.xldate, line:130 at site-packages\xlrd\xldate.py
将一个Excel日期/时间数字转换为:class:datetime.datetime
对象。
:param xldate: The Excel number
:param datemode: 0: 1900-based, 1: 1904-based.
:returns: A :class:datetime.datetime
object.
### 7 _leap(y)
> _leap(y), module=xlrd.xldate, line:164 at site-packages\xlrd\xldate.py
### 8 xldate_from_date_tuple(date_tuple, datemode)
> xldate_from_date_tuple(date_tuple, datemode), module=xlrd.xldate, line:173 at site-packages\xlrd\xldate.py
将日期元组(年、月、日)转换为Excel日期。
:param year: Gregorian year.
:param month:1 <= month <= 12
:param day:1 <= day <= last day of that (year, month)
:param datemode: 0: 1900-based, 1: 1904-based.
:raises xlrd.xldate.XLDateAmbiguous:
:raises xlrd.xldate.XLDateBadDatemode:
:raises xlrd.xldate.XLDateBadTuple:
(year, month, day)
is too early/late or has invalid component(s)
:raises xlrd.xldate.XLDateError:
### 9 xldate_from_time_tuple(time_tuple)
> xldate_from_time_tuple(time_tuple), module=xlrd.xldate, line:220 at site-packages\xlrd\xldate.py
将时间元组“”(小时,分钟,秒)“”转换为Excel“日期”值(一天的分数)。
:param hour:0 <= hour < 24
:param minute:0 <= minute < 60
:param second:0 <= second < 60
:raises xlrd.xldate.XLDateBadTuple: Out-of-range hour, minute, or second
### 10 xldate_from_datetime_tuple(datetime_tuple, datemode)
> xldate_from_datetime_tuple(datetime_tuple, datemode), module=xlrd.xldate, line:236 at site-packages\xlrd\xldate.py
将datetime元组(年,月,日,时,分,秒)
转换为Excel日期值。
有关更多详细信息,请参阅 xldate_from_*_tuple 其他函数。
:param datetime_tuple:(year, month, day, hour, minute, second)
:param datemode: 0: 1900-based, 1: 1904-based.
## 类
### 11 xlrd.xldate.XLDateError
> XLDateError, xlrd.xldate.XLDateError, module=xlrd.xldate
所有日期时间相关错误的基类。
### 12 xlrd.xldate.XLDateNegative
> XLDateNegative, xlrd.xldate.XLDateNegative, module=xlrd.xldate
xldate < 0.00
### 13 xlrd.xldate.XLDateAmbiguous
> XLDateAmbiguous, xlrd.xldate.XLDateAmbiguous, module=xlrd.xldate
1900年闰年问题(datemode = 0 and 1.0 <= xldate < 61.0)
### 14 xlrd.xldate.XLDateTooLarge
> XLDateTooLarge, xlrd.xldate.XLDateTooLarge, module=xlrd.xldate
公历10000年或更晚
### 15 xlrd.xldate.XLDateBadDatemode
> XLDateBadDatemode, xlrd.xldate.XLDateBadDatemode, module=xlrd.xldate
参数“datemode”既不是0也不是1
### 16 xlrd.xldate.XLDateBadTuple
> XLDateBadTuple, xlrd.xldate.XLDateBadTuple, module=xlrd.xldate
## 私有或局部
> 17 _JDN_delta (2415019, 2416481)
> 18 _XLDAYS_TOO_LARGE (2958466, 2957004)
> 19 _leap <function _leap at 0x000000000301B678>
> 20 _days_in_month (None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
## 剩余
> 21 __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x000000000300FB08>
> 22 __spec__ ModuleSpec(name='xlrd.xldate', loader=<_frozen_importlib_external.SourceFileLoader object at 0x000000000300FB08>, origin='...\\lib\\site-packages\\xlrd\\xldate.py')
> 23 epoch_1904 1904-01-01 00:00:00
> 24 epoch_1900 1899-12-31 00:00:00
> 25 epoch_1900_minus_1 1899-12-30 00:00:00