faust.utils.terminal.tables

Using https://pypi.org/project/terminaltables/ to draw ANSI tables.

faust.utils.terminal.tables.Table

alias of BaseTable

faust.utils.terminal.tables.table(data: Sequence[Sequence[str]], *, title: str, target: Optional[IO] = None, tty: Optional[bool] = None, **kwargs: Any) BaseTable[source]

Create suitable https://pypi.org/project/terminaltables/ table for target.

Parameters:
  • data (Sequence[Sequence[str]]) – Table data.

  • target (IO) – Target should be the destination output file for your table, and defaults to sys.stdout. ANSI codes will be used if the target has a controlling terminal, but not otherwise, which is why it’s important to pass the correct output file.

Return type:

BaseTable

faust.utils.terminal.tables.logtable(data: Sequence[Sequence[str]], *, title: str, target: Optional[IO] = None, tty: Optional[bool] = None, headers: Optional[Sequence[str]] = None, **kwargs: Any) str[source]

Prepare table for logging.

Will use ANSI escape codes if the log file is a tty.

Return type:

str