Constants and Types

ExcelTableKit exposes a small set of constants and type aliases that are used throughout the library. They are importable directly from exceltablekit.constants.

from exceltablekit.constants import BorderStyle, COLUMN_MAX, ROW_MAX

BorderStyle

exceltablekit.constants.BorderStyle

A Literal type alias listing the 13 border styles supported by Excel (and openpyxl). Used as the type for all *_style parameters in set_border() and set_header_border().

from exceltablekit.constants import BorderStyle

Accepted values:

Value

Description

"thin"

Thin solid line (default for all border methods)

"medium"

Medium-weight solid line

"thick"

Thick solid line

"double"

Two parallel thin lines

"hair"

Hairline — thinnest visible line

"dashed"

Short dashes

"dotted"

Dots

"dashDot"

Alternating dash–dot pattern

"dashDotDot"

Alternating dash–dot–dot pattern

"mediumDashed"

Medium-weight dashes

"mediumDashDot"

Medium-weight dash–dot

"mediumDashDotDot"

Medium-weight dash–dot–dot

"slantDashDot"

Slanted dash–dot pattern

Excel grid limits

exceltablekit.constants.COLUMN_MAX
Type:

int

Value:

16384

Maximum column index in Excel, corresponding to column XFD. Column values that exceed this limit raise ColumnOutOfBoundsError.

exceltablekit.constants.ROW_MAX
Type:

int

Value:

1048576

Maximum row index in Excel. Row values that exceed this limit raise InvalidRowValueError.

Alphabet lookup tables

These dictionaries are used internally by the Alphabet utility and are exported for completeness. Direct use is rarely needed.

exceltablekit.constants.STRING_ALPHABET
Type:

dict[str, int]

Maps each uppercase letter "A""Z" to its 1-based column index (126).

from exceltablekit.constants import STRING_ALPHABET

STRING_ALPHABET["A"]  # 1
STRING_ALPHABET["Z"]  # 26
exceltablekit.constants.NUMBER_ALPHABET
Type:

dict[int, str]

Inverse of STRING_ALPHABET. Maps each integer 126 to its uppercase letter "A""Z".

from exceltablekit.constants import NUMBER_ALPHABET

NUMBER_ALPHABET[1]   # "A"
NUMBER_ALPHABET[26]  # "Z"