Skip to content

PyTQL Table

This section contains information about how to create a PyTQL table and beautify it.

Class

class pytql.table.Table (model: Model, data=None, file=None, header_color, row_color, table_color)

         Class used to create Table data type.

Parameters:

  • model (Model) - Model to be used to validate table data.
  • data (Any) - Data to be populated in table. Defaults to None.
  • file (str) - File conatining data to be populated. Defaults to None.
  • header_color (Color) - Table header color. Defaults to Color.default.
  • row_color (Color) - Table row color. Defaults to Color.default.
  • table_color (Color) - Table style color. Defaults to Color.default.


Methods

add_row(row, position=None)

         Adds additional row data to the table at a specified position.

         Args:
             row (List) : Row data to be added to table.
             position (int) : Position of the row data to be added.


draw_table(data=None)

         Method to draw table with data provided.

         Args:
             data (List) : Table data to draw.

Tip

Don't pass any data when you want to draw the table.
Only pass data returned from performing queries or any List of data when you want to visualize the data.


get_data( )

         Returns current state of table data.

query( )

         Opens up the table for querying/filtering.

update(column)

         Specifies the table column to update.

         Args:
             column (str) : Column to be updated.


where(value, updated_value)

         Specifies which table data to alter.

         Args:
             value (str) : Current value in table.
             updated_value (str) : New value to replace old table value.