forte2.helpers.table ==================== .. py:module:: forte2.helpers.table Module Contents --------------- .. py:function:: format_ansi(text: str, fg: str | None = None, bg: str | None = None, bold: bool = False, use_color: bool | None = None) -> str Return `text` formatted with optional ANSI color and bold styling. :Parameters: **text** : str The text to format. **fg** : str, optional Foreground color name (e.g., "red", "bright_cyan"). **bg** : str, optional Background color name. **bold** : bool, optional If True, apply bold styling. **use_color** : bool, optional Force color on/off. If None, auto-detect via sys.stdout.isatty(). :Returns: str Formatted string with ANSI escape sequences if supported. .. !! processed by numpydoc !! .. py:class:: AsciiTable(columns, formats=None, sep_major='=', sep_minor='-', padding=3, header_fg='bright_white', header_bg=None, bold_header=True, footer_fg='bright_white', footer_bg=None, row_fg='bright_white', row_bg=None, use_color=None) .. py:attribute:: COLORS .. py:attribute:: columns .. py:attribute:: formats .. py:attribute:: padding :value: ' ' .. py:attribute:: sep_major :value: '=' .. py:attribute:: sep_minor :value: '-' .. py:attribute:: use_color .. py:attribute:: header_fg :value: 'bright_white' .. py:attribute:: header_bg :value: None .. py:attribute:: footer_fg :value: 'bright_white' .. py:attribute:: footer_bg :value: None .. py:attribute:: row_fg :value: 'bright_white' .. py:attribute:: row_bg :value: None .. py:attribute:: bold_header :value: True .. py:attribute:: col_widths :value: [] .. py:attribute:: total_width .. py:method:: header() -> str Return a formatted, optionally colored and bold header section. .. !! processed by numpydoc !! .. py:method:: row(*values, fg=None, bg=None) -> str Return one formatted row, optionally colored. .. !! processed by numpydoc !! .. py:method:: footer() -> str Return a formatted footer line. .. !! processed by numpydoc !!