String Table Parser

0.0.1 · maintenance · verified Tue Apr 14

sttable is a Python library (version 0.0.1, alpha status) designed to parse string representations of tables, converting them into structured data formats. It extracts table data, making it accessible by rows (as a list of dictionaries) or by columns (as a dictionary of lists). The library currently has an infrequent release cadence, with the last release in November 2019.

Warnings

Install

Imports

Quickstart

Initialize an STTable object with a string representation of a table and then retrieve data by rows, columns, or field names.

from sttable import STTable

table_string = (
    "header_1st_col | header_2nd_col |\n"
    "row_1_of_1st_col | row_1_of_2nd_col |\n"
    "row_2_of_1st_col | row_2_of_2nd_col |"
)

table = STTable(table_string)

# Access data by rows
rows_data = table.get_rows()
print("Rows:", rows_data)

# Access data by columns
columns_data = table.get_columns()
print("Columns:", columns_data)

# Access field names
fields = table.get_fields()
print("Fields:", fields)

view raw JSON →