xlrd Package

xlrd Package

class xlrd.__init__.Book

Bases: xlrd.biffh.BaseObject

biff2_8_load(filename=None, file_contents=None, logfile=<open file '<stdout>', mode 'w' at 0x7f41f891e150>, verbosity=0, pickleable=True, use_mmap=1, encoding_override=None, formatting_info=False, on_demand=False)
biff_version = 0
codepage = None
colour_map = {}
countries = (0, 0)
datemode = 0
derive_encoding()
encoding = None
fake_globals_get_sheet()
font_list = []
format_list = []
format_map = {}
get2bytes()
get_record_parts()
get_record_parts_conditional(reqd_record)
get_sheet(sh_number, update_pos=True)
get_sheets()
getbof(rqd_stream)
handle_boundsheet(data)
handle_builtinfmtcount(data)
handle_codepage(data)
handle_country(data)
handle_datemode(data)
handle_externname(data)
handle_externsheet(data)
handle_filepass(data)
handle_name(data)
handle_obj(data)
handle_sheethdr(data)
handle_sheetsoffset(data)
handle_sst(data)
handle_supbook(data)
handle_writeaccess(data)
initialise_format_info()
load_time_stage_1 = -1.0
load_time_stage_2 = -1.0
name_and_scope_map = {}
name_map = {}
name_obj_list = []
names_epilogue()
nsheets = 0
palette_record = []
parse_globals()
read(pos, length)
release_resources()
sheet_by_index(sheetx)
sheet_by_name(sheet_name)
sheet_loaded(sheet_name_or_index)
sheet_names()
sheets()
style_name_map = {}
unload_sheet(sheet_name_or_index)
user_name = u''
xf_list = []
class xlrd.__init__.Name

Bases: xlrd.biffh.BaseObject

area2d(clipped=True)
binary = 0
book = None
builtin = 0
cell()
complex = 0
func = 0
funcgroup = 0
hidden = 0
macro = 0
name = u''
name_index = 0
raw_formula = ''
result = None
scope = -1
vbasic = 0
xlrd.__init__.colname(colx, _A2Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ')
xlrd.__init__.count_records(filename, outfile=<open file '<stdout>', mode 'w' at 0x7f41f891e150>)
xlrd.__init__.display_cell_address(rowx, colx, relrow, relcol)
xlrd.__init__.dump(filename, outfile=<open file '<stdout>', mode 'w' at 0x7f41f891e150>, unnumbered=False)
xlrd.__init__.expand_cell_address(inrow, incol)
xlrd.__init__.is_cell_opcode()

D.has_key(k) -> True if D has a key k, else False

xlrd.__init__.open_workbook(filename=None, logfile=<open file '<stdout>', mode 'w' at 0x7f41f891e150>, verbosity=0, pickleable=True, use_mmap=1, file_contents=None, encoding_override=None, formatting_info=False, on_demand=False)
xlrd.__init__.unpack_SST_table(datatab, nstrings)

Return list of strings

biffh Module

class xlrd.biffh.BaseObject

Bases: object

dump(f=None, header=None, footer=None, indent=0)
exception xlrd.biffh.XLRDError

Bases: exceptions.Exception

xlrd.biffh.biff_count_records(mem, stream_offset, stream_len, fout=<open file '<stdout>', mode 'w' at 0x7f41f891e150>)
xlrd.biffh.biff_dump(mem, stream_offset, stream_len, base=0, fout=<open file '<stdout>', mode 'w' at 0x7f41f891e150>, unnumbered=False)
xlrd.biffh.fprintf(f, fmt, *vargs)
xlrd.biffh.hex_char_dump(strg, ofs, dlen, base=0, fout=<open file '<stdout>', mode 'w' at 0x7f41f891e150>, unnumbered=False)
xlrd.biffh.is_cell_opcode()

D.has_key(k) -> True if D has a key k, else False

xlrd.biffh.unpack_cell_range_address_list_update_pos(output_list, data, pos, biff_version, addr_size=6)
xlrd.biffh.unpack_string(data, pos, encoding, lenlen=1)
xlrd.biffh.unpack_string_update_pos(data, pos, encoding, lenlen=1, known_len=None)
xlrd.biffh.unpack_unicode(data, pos, lenlen=2)

Return unicode_strg

xlrd.biffh.unpack_unicode_update_pos(data, pos, lenlen=2, known_len=None)

Return (unicode_strg, updated value of pos)

xlrd.biffh.upkbits(tgt_obj, src, manifest, local_setattr=<built-in function setattr>)
xlrd.biffh.upkbitsL(tgt_obj, src, manifest, local_setattr=<built-in function setattr>, local_int=<type 'int'>)

compdoc Module

class xlrd.compdoc.CompDoc(mem, logfile=<open file '<stdout>', mode 'w' at 0x7f41f891e150>, DEBUG=0)

Bases: object

get_named_stream(qname)
locate_named_stream(qname)
exception xlrd.compdoc.CompDocError

Bases: exceptions.Exception

class xlrd.compdoc.DirNode(DID, dent, DEBUG=0)

Bases: object

dump(DEBUG=1)

formatting Module

class xlrd.formatting.EqNeAttrs

Bases: object

class xlrd.formatting.Font

Bases: xlrd.biffh.BaseObject, xlrd.formatting.EqNeAttrs

bold = 0
character_set = 0
colour_index = 0
escapement = 0
family = 0
font_index = 0
height = 0
italic = 0
name = u''
outline = 0
shadow = 0
struck_out = 0
underline_type = 0
underlined = 0
weight = 400
class xlrd.formatting.Format(format_key, ty, format_str)

Bases: xlrd.biffh.BaseObject, xlrd.formatting.EqNeAttrs

format_key = 0
format_str = u''
type = 0
class xlrd.formatting.XF

Bases: xlrd.biffh.BaseObject

alignment = None
background = None
border = None
font_index = 0
format_key = 0
is_style = 0
parent_style_index = 0
protection = None
xf_index = 0
class xlrd.formatting.XFAlignment

Bases: xlrd.biffh.BaseObject, xlrd.formatting.EqNeAttrs

hor_align = 0
indent_level = 0
rotation = 0
shrink_to_fit = 0
text_direction = 0
text_wrapped = 0
vert_align = 0
class xlrd.formatting.XFBackground

Bases: xlrd.biffh.BaseObject, xlrd.formatting.EqNeAttrs

background_colour_index = 0
fill_pattern = 0
pattern_colour_index = 0
class xlrd.formatting.XFBorder

Bases: xlrd.biffh.BaseObject, xlrd.formatting.EqNeAttrs

bottom_colour_index = 0
bottom_line_style = 0
diag_colour_index = 0
diag_down = 0
diag_line_style = 0
diag_up = 0
left_colour_index = 0
left_line_style = 0
right_colour_index = 0
right_line_style = 0
top_colour_index = 0
top_line_style = 0
class xlrd.formatting.XFProtection

Bases: xlrd.biffh.BaseObject, xlrd.formatting.EqNeAttrs

cell_locked = 0
formula_hidden = 0
xlrd.formatting.check_colour_indexes_in_obj(book, obj, orig_index)
xlrd.formatting.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), (128, 0, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128), (153, 153, 255), (153, 51, 102), (255, 255, 204), (204, 255, 255), (102, 0, 102), (255, 128, 128), (0, 102, 204), (204, 204, 255), (0, 0, 128), (255, 0, 255), (255, 255, 0), (0, 255, 255), (128, 0, 128), (128, 0, 0), (0, 128, 128), (0, 0, 255), (0, 204, 255), (204, 255, 255), (204, 255, 204), (255, 255, 153), (153, 204, 255), (255, 153, 204), (204, 153, 255), (255, 204, 153), (51, 102, 255), (51, 204, 204), (153, 204, 0), (255, 204, 0), (255, 153, 0), (255, 102, 0), (102, 102, 153), (150, 150, 150), (0, 51, 102), (51, 153, 102), (0, 51, 0), (51, 51, 0), (153, 51, 0), (153, 51, 102), (51, 51, 153), (51, 51, 51)), 50: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128), (153, 153, 255), (153, 51, 102), (255, 255, 204), (204, 255, 255), (102, 0, 102), (255, 128, 128), (0, 102, 204), (204, 204, 255), (0, 0, 128), (255, 0, 255), (255, 255, 0), (0, 255, 255), (128, 0, 128), (128, 0, 0), (0, 128, 128), (0, 0, 255), (0, 204, 255), (204, 255, 255), (204, 255, 204), (255, 255, 153), (153, 204, 255), (255, 153, 204), (204, 153, 255), (227, 227, 227), (51, 102, 255), (51, 204, 204), (153, 204, 0), (255, 204, 0), (255, 153, 0), (255, 102, 0), (102, 102, 153), (150, 150, 150), (0, 51, 102), (51, 153, 102), (0, 51, 0), (51, 51, 0), (153, 51, 0), (153, 51, 102), (51, 51, 153), (51, 51, 51)), 20: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128)), 21: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128)), 70: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128), (153, 153, 255), (153, 51, 102), (255, 255, 204), (204, 255, 255), (102, 0, 102), (255, 128, 128), (0, 102, 204), (204, 204, 255), (0, 0, 128), (255, 0, 255), (255, 255, 0), (0, 255, 255), (128, 0, 128), (128, 0, 0), (0, 128, 128), (0, 0, 255), (0, 204, 255), (204, 255, 255), (204, 255, 204), (255, 255, 153), (153, 204, 255), (255, 153, 204), (204, 153, 255), (227, 227, 227), (51, 102, 255), (51, 204, 204), (153, 204, 0), (255, 204, 0), (255, 153, 0), (255, 102, 0), (102, 102, 153), (150, 150, 150), (0, 51, 102), (51, 153, 102), (0, 51, 0), (51, 51, 0), (153, 51, 0), (153, 51, 102), (51, 51, 153), (51, 51, 51)), 40: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128)), 45: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128)), 30: ((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, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), (192, 192, 192), (128, 128, 128))}

00H = Normal 01H = RowLevel_lv (see next field) 02H = ColLevel_lv (see next field) 03H = Comma 04H = Currency 05H = Percent 06H = Comma [0] (BIFF4-BIFF8) 07H = Currency [0] (BIFF4-BIFF8) 08H = Hyperlink (BIFF8) 09H = Followed Hyperlink (BIFF8)

xlrd.formatting.fmt_bracketed_sub()

sub(repl, string[, count = 0]) –> newstring Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.

xlrd.formatting.handle_efont(book, data)
xlrd.formatting.handle_font(book, data)
xlrd.formatting.handle_format(self, data, rectype=1054)
xlrd.formatting.handle_palette(book, data)
xlrd.formatting.handle_style(book, data)
xlrd.formatting.handle_xf(self, data)
xlrd.formatting.initialise_book(book)
xlrd.formatting.initialise_colour_map(book)
xlrd.formatting.is_date_format_string(book, fmt)
xlrd.formatting.nearest_colour_index(colour_map, rgb, debug=0)
xlrd.formatting.palette_epilogue(book)
xlrd.formatting.xf_epilogue(self)

formula Module

xlrd.formula.decompile_formula(bk, fmla, fmlalen, reldelta, browx=None, bcolx=None, blah=0, level=0)
xlrd.formula.dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0)
xlrd.formula.evaluate_name_formula(bk, nobj, namex, blah=0, level=0)
xlrd.formula.rangename3d(book, ref3d)

Ref3D(1, 4, 5, 20, 7, 10) => ‘Sheet2:Sheet3!$H$6:$J$20’ (assuming Excel’s default sheetnames)

xlrd.formula.rangename3drel(book, ref3d)
xlrd.formula.cellname(rowx, colx)

(5, 7) => ‘H6’

xlrd.formula.cellnameabs(rowx, colx)

(5, 7) => ‘$H$6’

xlrd.formula.colname(colx)

7 => ‘H’, 27 => ‘AB’

licences Module

Portions copyright © 2005-2009, Stephen John Machin, Lingfo Pty Ltd All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. None of the names of Stephen John Machin, Lingfo Pty Ltd and any contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

sheet Module

class xlrd.sheet.Cell(ctype, value, xf_index=None)

Bases: xlrd.biffh.BaseObject

ctype
value
xf_index
class xlrd.sheet.Colinfo

Bases: xlrd.biffh.BaseObject

bit1_flag = 0
collapsed = 0
hidden = 0
outline_level = 0
width = 0
xf_index = -1
class xlrd.sheet.MSNote

Bases: xlrd.biffh.BaseObject

class xlrd.sheet.MSODrawing

Bases: xlrd.biffh.BaseObject

class xlrd.sheet.MSObj

Bases: xlrd.biffh.BaseObject

class xlrd.sheet.MSTxo

Bases: xlrd.biffh.BaseObject

class xlrd.sheet.Rowinfo

Bases: xlrd.biffh.BaseObject

additional_space_above = 0
additional_space_below = 0
has_default_height = 0
has_default_xf_index = 0
height = 0
height_mismatch = 0
hidden = 0
outline_group_starts_ends = 0
outline_level = 0
xf_index = -9999
class xlrd.sheet.Sheet(book, position, name, number)

Bases: xlrd.biffh.BaseObject

cell(rowx, colx)
cell_type(rowx, colx)
cell_value(rowx, colx)
cell_xf_index(rowx, colx)
col(colx, start_rowx=0, end_rowx=None)
col_label_ranges = []
col_slice(colx, start_rowx=0, end_rowx=None)
col_types(colx, start_rowx=0, end_rowx=None)
col_values(colx, start_rowx=0, end_rowx=None)
colinfo_map = {}
computed_column_width(colx)
default_additional_space_above = None
default_additional_space_below = None
default_row_height = None
default_row_height_mismatch = None
default_row_hidden = None
defcolwidth = None
extend_cells(nr, nc)
fake_XF_from_BIFF20_cell_attr(cell_attr)
fix_ragged_rows()
fixed_BIFF2_xfindex(cell_attr, rowx, colx, true_xfx=None)
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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
handle_feat11(data)
handle_msodrawingetc(recid, data_len, data)
handle_note(data)
handle_obj(data)
handle_txo(data)
merged_cells = []
name = ''
ncols = 0
nrows = 0
put_blank_cell(rowx, colx, xf_index)
put_cell(rowx, colx, ctype, value, xf_index)
put_number_cell(rowx, colx, value, xf_index)
read(bk)
req_fmt_info()
row(rowx)
row_label_ranges = []
row_slice(rowx, start_colx=0, end_colx=None)
row_types(rowx, start_colx=0, end_colx=None)
row_values(rowx, start_colx=0, end_colx=None)
rowinfo_map = {}
standardwidth = None
tidy_dimensions()
visibility = 0
xlrd.sheet.is_cell_opcode()

D.has_key(k) -> True if D has a key k, else False

xlrd.sheet.unpack_RK(rk_str)

timemachine Module

xlrd.timemachine.int_floor_div(x, y)
xlrd.timemachine.intbool(x)

xldate Module

exception xlrd.xldate.XLDateAmbiguous

Bases: xlrd.xldate.XLDateError

exception xlrd.xldate.XLDateBadDatemode

Bases: xlrd.xldate.XLDateError

exception xlrd.xldate.XLDateBadTuple

Bases: xlrd.xldate.XLDateError

exception xlrd.xldate.XLDateError

Bases: exceptions.ValueError

exception xlrd.xldate.XLDateNegative

Bases: xlrd.xldate.XLDateError

exception xlrd.xldate.XLDateTooLarge

Bases: xlrd.xldate.XLDateError

xlrd.xldate.xldate_as_tuple(xldate, datemode)
xlrd.xldate.xldate_from_date_tuple((year, month, day), datemode)
xlrd.xldate.xldate_from_datetime_tuple(datetime_tuple, datemode)
xlrd.xldate.xldate_from_time_tuple((hour, minute, second))

Project Versions

Table Of Contents

Previous topic

view Package

Next topic

xlwt Package

This Page