How to use the tabulate._build_simple_row function in tabulate

To help you get started, we’ve selected a few tabulate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IncOQ / incoq / experiments / View on Github external
def latex_build_headerrow(self, padded_cells, rowfmt):
        """Hook for custom header row behavior."""
        from tabulate import _build_simple_row
        padded_cells = [self.normalize_string(cell, latex=True)
                        for cell in padded_cells]
        return _build_simple_row(padded_cells, rowfmt)
github IncOQ / incoq / experiments / View on Github external
padded_cells = [self.normalize_string(cell, latex=True,
                                              align='l', vertalign='t')
                        for cell in padded_cells]
        if self.bold_firstcol:
            first_cell, *remaining_cells = padded_cells
            first_cell = r'\c{' + first_cell.lstrip() + '}'
            remaining_cells = [cell if not cell.isspace() else 
                                    'N/A '.rjust(len(cell))
                               for cell in remaining_cells]
            padded_cells = [first_cell] + remaining_cells
        return _build_simple_row(padded_cells, rowfmt)
github lethe3000 / ctable / View on Github external
Print colorful(256) tables for terminal
    with built-in themes: dark, blue, red, green
Based on tabulate 0.7.7
from collections import namedtuple
import tabulate

def build_simple_row(padded_cells, rowfmt):
    "Format row according to DataRow format without padding."
    begin, sep, end = rowfmt
    # hack here remove rstrip()
    return (begin + sep.join(padded_cells) + end)  # .rstrip()

tabulate._build_simple_row = build_simple_row

Color = namedtuple("Color", ["fg", "bg"])
ColorStyle = namedtuple("ColorStyle", ["head", "row"])

_color_templates = {'dark':
                    ColorStyle(head=Color(fg=15, bg=0),
                               row=[Color(fg=15, bg=0)]
                    ColorStyle(head=Color(fg=3, bg=18),
                               row=[Color(fg=15, bg=18)]
                    ColorStyle(head=Color(fg=15, bg=196),
                               row=[Color(fg=236, bg=15),