How to use the termtables.styles function in termtables

To help you get started, we’ve selected a few termtables 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 nschloe / termtables / termtables / main.py View on Github external
def to_string(
    data, header=None, alignment="l", padding=(0, 1), style=styles.thin_double
):
    try:
        depth = len(data.shape)
    except AttributeError:
        depth = _get_depth(data)

    if depth == 2:
        data = [data]
    else:
        assert depth == 3

    if header:
        data = [[header]] + data

    # Make sure the data is consistent
    num_columns = len(data[0][0])

termtables

Pretty tables in the terminal

GPL-3.0
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Popular termtables functions