Package: easy-console-table
Easy Console Table PackageA package to easily create a console table that can render this :-------------------------
|   Hello   |   World   |
-------------------------
|     Hello |         1 |
| _________ | _________ |
|     World |         2 |
| _________ | _________ |
|           |         3 |
| _________ | _________ |How to use it ?Introduction codeCode to make the introduction table :fromeasy_console_tableimportTablet=Table()t.add_column("Hello",["Hello","World"])t.add_column("World",[1,2,3])print(t)FunctionnalitiesAll methods refer toTableclass.Create a tableYou need to create an object ofTablethat uses**kwargsparameters so you can configure table appearance.Here's all you can configure :alignment=str, title_separator=str, column_separator=str, line_separator=str.Base settings are :"alignment": "right", "title_separator": "-", "column_separator": "|", "line_separator": "_"Even after creating the table you can configure it by using the methodconfigwhich takes the same arguments.Add and Delete a columnAdd : methodadd_columnthat takes as parameters a column's name and a list of values.Delete : methodsDelete_columnthat takes as parameter a column's name in the table. If a column is delete, it gets removed in the filter.Set and Get a columnSet : methodset_columnthat takes as parameters a column's name and a list of values.Get : methodget_columnthat takes as parameter a column's name and return a list of values.Get tableYou can get the whole table implemented using dict of list by using methodget_table.Perfect tableA perfect table is like a perfect graph. It's a table where all the columns have the same lenght.Use the methodget_is_perfectthat returns a boolean to know if the table is perfect (True) or not (False).Filter systemAn attribute ofTableis afilter. It is a list that contains all the column's names that you don't want to show.Filter methodsAdd : methodadd_filtermakes you add a column's name into the filter. It takes as parameter a column's name that must be in the table.Remove : methodremove_filtermakes you remove an element of the filter, remove it by the column's name.Clear : methodclear_filterclear the whole filter.Sort tableYou can sort the whole table by following a column sorting. You can use it with the methodsort_table_from_columnthat takes a column's name as parameter. Table have to be perfect to sort.Export to CSVYou can export the table to a CSV file by usingexport_as_csvmethod that takes as parameter the file path or name. Columns filtered will not be exported.Mixed exampleCode :fromeasy_console_tableimportTablet=Table(alignment="center",title_separator="#",line_separator="-",column_separator="I")t.add_column("Hello",["World","!","Hello"])t.add_column("Sort",[2,3,1])t.add_column("trash",["Dont","Work","As","It","Should"])print(t)print()t.add_filter("trash")print(t)print()t.delete_column("trash")t.sort_table_from_column("Sort")t.config(alignment="right",title_separator="-",line_separator="_",column_separator="|")t.add_filter("Sort")print(t)It returns :#####################################
I   Hello   I   Sort    I   trash   I
#####################################
I   World   I     2     I   Dont    I
I --------- I --------- I --------- I
I     !     I     3     I   Work    I
I --------- I --------- I --------- I
I   Hello   I     1     I    As     I
I --------- I --------- I --------- I
I           I           I    It     I
I --------- I --------- I --------- I
I           I           I  Should   I
I --------- I --------- I --------- I

#########################
I   Hello   I   Sort    I
#########################
I   World   I     2     I
I --------- I --------- I
I     !     I     3     I
I --------- I --------- I
I   Hello   I     1     I
I --------- I --------- I
I           I           I
I --------- I --------- I
I           I           I
I --------- I --------- I

-------------
|   Hello   |
-------------
|     Hello |
| _________ |
|     World |
| _________ |
|         ! |
| _________ |Github link