Contains the data for one worksheet.
In the cell access functions, “rowx” is a row index, counting from zero, and “colx” is acolumn index, counting from zero. Negative values for row/column indexes and slice positions are supported in the expected fashion.
For information about cell types and cell values, refer to the documentation of the Cell class.
Warning
You don’t call this class yourself. You access Sheet objects via the Book object that was returned when you called open_workbook().
List of address ranges of cells containing column labels. These are set up in Excel by Insert > Name > Labels > Columns.
How to deconstruct the list:
for crange in thesheet.col_label_ranges:
rlo, rhi, clo, chi = crange
for rx in xrange(rlo, rhi):
for cx in xrange(clo, chi):
print "Column label at (rowx=%d, colx=%d) is %r" \
(rx, cx, thesheet.cell_value(rx, cx))
The map from a column index to a Colinfo object. Often there is an entry in COLINFO records for all column indexes in range(257).
Note that xlrd ignores the entry for the non-existent 257th column. On the other hand, there may be no entry for unused columns.
Default value to be used for a row if there is no ROW record for that row.
From the optional DEFAULTROWHEIGHT record.
Default value to be used for a row if there is no ROW record for that row.
From the optional DEFAULTROWHEIGHT record.
Default value to be used for a row if there is no ROW record for that row.
From the optional DEFAULTROWHEIGHT record.
Default value to be used for a row if there is no ROW record for that row.
From the optional DEFAULTROWHEIGHT record.
Default column width from DEFCOLWIDTH record, else None.
From the OOo docs:
“Column width in characters, using the width of the zero character from default font (first FONT record in the file). Excel adds some extra space to the default width, depending on the default font and default font size. The algorithm how to exactly calculate the resulting column width is not known.<br /> Example: The default width of 8 set in this record results in a column width of 8.43 using Arial font with a size of 10 points.”
For the default hierarchy, refer to the Colinfo class above.
A 256-element tuple corresponding to the contents of the GCW record for this sheet.
If no such record, treat as all bits zero.
Applies to BIFF4-7 only. See docs of Colinfo class for discussion.
List of address ranges of cells which have been merged.
These are set up in Excel by Format > Cells > Alignment, then ticking the “Merge cells” box.
How to deconstruct the list:
for crange in thesheet.merged_cells:
rlo, rhi, clo, chi = crange
for rowx in xrange(rlo, rhi):
for colx in xrange(clo, chi):
# cell (rlo, clo) (the top left one) will carry the data
# and formatting info; the remainder will be recorded as
# blank cells, but a renderer will apply the formatting info
# for the top left cell (e.g. border, pattern) to all cells in
# the range.
Name of sheet.
Number of columns in sheet. A column index is in range(thesheet.ncols).
Number of rows in sheet. A row index is in range(thesheet.nrows).
The map from a row index to a Rowinfo object. Note that it is possible to have missing entries – at least one source of XLS files doesn’t bother writing ROW records.
Default column width from STANDARDWIDTH record, else None.
From the OOo docs:
“Default width of the columns in 1/256 of the width of the zero character, using default font (first FONT record in the file).”
For the default hierarchy, refer to the Colinfo class above.
Visibility of the sheet. 0 = visible, 1 = hidden (can be unhidden by user – Format/Sheet/Unhide), 2 = “very hidden” (can be unhidden only by VBA macro).
Cell object in the given row and column.
Type of the cell in the given row and column. Refer to the documentation of the Cell class.
Value of the cell in the given row and column.
XF index of the cell in the given row and column. This is an index into Book.xf_list.
Returns a sequence of the Cell objects in the given column.
Returns a slice of the Cell objects in the given column.
Returns a slice of the types of the cells in the given column.
Returns a slice of the values of the cells in the given column.
Determine column display width.
Parameters: |
|
---|---|
Returns: | The column width that will be used for displaying the given column by Excel, in units of 1/256th of the width of a standard character (the digit zero in the first font). |
Returns a sequence of the Cell objects in the given row.
List of address ranges of cells containing row labels.
For more details, see <i>col_label_ranges</i> above.
Returns a slice of the Cell objects in the given row.
Returns a slice of the types of the cells in the given row.
Returns a slice of the values of the cells in the given row.