Class FormatTableItem

New in version 0.6.6.

class ooodev.formatters.format_table_item.FormatTableItem(format, idxs_inc=None, row_idxs_exc=None)[source]
Parameters:
  • format (str | Tuple[str, ...]) –

  • idxs_inc (Tuple[int, ...] | None) –

  • row_idxs_exc (Tuple[int, ...] | None) –

__init__(format, idxs_inc=None, row_idxs_exc=None)[source]
Parameters:
  • format (str | Tuple[str, ...]) –

  • idxs_inc (Tuple[int, ...] | None) –

  • row_idxs_exc (Tuple[int, ...] | None) –

Return type:

None

is_index(idx)[source]

Gets if instance includes idx for formatting.

Parameters:

idx (int) – Index value

Returns:

True if index is found; Otherwise, False

Return type:

bool

is_row_exc_index(idx)[source]

Gets if instance excludes row idx from formatting.

Parameters:

idx (int) – Index value

Returns:

True if index is found; Otherwise, False

Return type:

bool

property format: str | Tuple[str, ...]

Gets Format

Format option such as .2f

Multiple formats can be added such as (".2f", "<10"). Formats are applied in the order they are added. In this case first float is formatted as string with two decimal places, and then value is padded to the right with spaces.

Return type:

str | Tuple[str, …]

property idxs_inc: Tuple[int, ...]

Gets indexes that formatting applies to

Return type:

Tuple[int, ...]

property item_kind: TableItemKind

Gets/Sets Item Kind

Return type:

TableItemKind

property row_idxs_exc: Tuple[int, ...]

Gets indexes of rows that are excluded from formatted

Return type:

Tuple[int, ...]