Cell
- class exceltablekit.table.cell.Cell(column, row)[source]
Represents a single Excel cell identified by a column letter string and a 1-based integer row number.
Cellinstances are created automatically byTable. You rarely need to instantiate them directly unless you are extending the library.- Parameters:
- Raises:
InvalidColumnValueError – If column is not a non-empty alphabetic string, or the resulting column number exceeds 16 384.
InvalidRowValueError – If row is not a positive integer, or exceeds 1 048 576.
Example:
from exceltablekit import Cell cell = Cell("B", 5) print(cell.get_cell()) # "B5" print(cell.get_column()) # "B" print(cell.get_row()) # 5
Methods
- get_cell()[source]
Return the cell address in
"A1"notation.- Returns:
Cell address string (e.g.
"B5").- Return type:
- get_column()[source]
Return the column letter(s).
- Returns:
Column string, always uppercase (e.g.
"B").- Return type:
- set_property(worksheet, property, value)[source]
Set a style attribute on the underlying openpyxl cell object.
- Parameters:
worksheet (openpyxl.worksheet.worksheet.Worksheet) – The openpyxl
Worksheetthat contains this cell.property (str) – The cell attribute to set (e.g.
"fill","font","alignment","border").value – The value to assign — typically an openpyxl style object.
Example:
from openpyxl import Workbook from openpyxl.styles import PatternFill from exceltablekit import Cell wb = Workbook() ws = wb.active cell = Cell("C", 3) fill = PatternFill(fill_type="solid", fgColor="FFFF00") cell.set_property(ws, "fill", fill) wb.save("output.xlsx")