vimsheet.model.range
A1 notation helpers and named-range registry.
- vimsheet.model.range.col_letters_to_index(letters)[source]
Convert column letters (A, B, …, ZZ) to a 0-based column index.
>>> col_letters_to_index("A") 0 >>> col_letters_to_index("Z") 25 >>> col_letters_to_index("AA") 26
- vimsheet.model.range.col_index_to_letters(index)[source]
Convert a 0-based column index to column letters.
>>> col_index_to_letters(0) 'A' >>> col_index_to_letters(25) 'Z' >>> col_index_to_letters(26) 'AA'
- vimsheet.model.range.a1_to_rowcol(address)[source]
Parse an A1-notation address to a (row, col) pair (0-based).
Supports absolute references ($A$1).
>>> a1_to_rowcol("A1") (0, 0) >>> a1_to_rowcol("B3") (2, 1) >>> a1_to_rowcol("$C$5") (4, 2)
- vimsheet.model.range.rowcol_to_a1(row, col)[source]
Convert a 0-based (row, col) pair to an A1-notation address.
>>> rowcol_to_a1(0, 0) 'A1' >>> rowcol_to_a1(2, 1) 'B3'
- class vimsheet.model.range.CellRange(start_row, start_col, end_row, end_col)[source]
Bases:
objectA rectangular range identified by its top-left and bottom-right corners (0-based).
- classmethod from_a1(range_str)[source]
Parse an A1:B5 range string.
Also accepts single-cell addresses like “A1”.
- class vimsheet.model.range.NamedRangeRegistry(_names=<factory>)[source]
Bases:
objectStores name → range-string mappings for a single sheet or workbook.
- delete(name)[source]
Remove a named range. Raises KeyError if not found.
- Parameters:
name (str)
- Return type:
None