Package: pyqttable
pyqttableA simple configurable table widget based on PyQt5 and pandasHow to useGet versionfrom pyqttable import version

print(version.VERSION)Create tablefrom pyqttable import PyQtTable

table_widget = PyQtTable(
    parent=None,              # parent widget
    column_config=my_config,  # column configurations
    show_filter=True,         # show filter in header
    sortable=True,            # sortable column (triggered by right click)
    draggable=True,           # draggable column
)Column ConfigA list of configurations for each columnConfig KeyDescriptionValue TypeDefault Valuekeykey of column (used to access data from DataFrame)str# requirednamecolumn name to displaystr# same as keytypecolumn value type (required for conversion between real value and string)# see Column.Typestreditablecontrolling the cell value is read-only or notboolTruedefaultdefault value when key is missing in data (not recommended)-Noneh_alignhorizontal alignment# see Column.Align'l'v_alignvertical alignment# see Column.Align'c'selectionlist of valid valueslistNonesort_ltDIY __lt__ methods for sorting (only effective when sortable is True)# see Column.SortNonefilter_typefilter type (only effective when show_filter is True)# see Column.Filter'contain'colorfont color (in string or tuple indicating RGB)# see Column.ColorNonebg_colorbackground color (same format as color)# see Column.ColorNoneExample{
    'key': 'gender',                        # same as DataFrame column
    'name': 'Gender',                       # shown as table header
    'type': str,                            # string variable
    'editable': False,                      # read-only
    'selection': ['male', 'female'],        # could be either 'male' or 'female'
    'h_align': 'r',                         # align right
    'sort_lt': lambda x, y: x == 'female',  # 'female' < 'male'
    'filter_type': 'multiple_choice',       # multiple-choice filter
    'bg_color': (135, 206, 250)},           # blue opaque background
}Column.TypeColumn type should be following class (not instance)Column typeintfloatstrbooldatetime.datetimedatetime.datedatetime.timeColumn type can also be instance of ColumnType
Inherit from ColumnType to make DIY column type
Inherit from EditorFactory to make DIY editor for DIY column type (if required)from pyqttable.column import type_
from pyqttable.editor import EditorFactory

class MyEditorFactory(EditorFactory):
    ...

class MyColumnType(type_.ColumnType):
    EditorFactory = MyEditorFactory()
    ...Column.AlignKeyValid valueFlagh_align'l' / 'left'AlignLefth_align'r' / 'right'AlignRighth_align'c' / 'center'AlignHCenterv_align't' / 'top'AlignTopv_align'b' / 'bottom'AlignBottomv_align'c' / 'center'AlignVCenterColumn.ColorValue typeValue formatstr'#RRGGBB'Tuple[int](R, G, B, Optional[T])Column.FilterColumn filter type should by following stringFilter type'exact''contain''expression''regex''multiple_choice'Column filter type can also be instance of Filter
Inherit from Filter to make DIY filter typefrom pyqttable.column import filter_

class MyFilterType(filter_.Filter):
    ...Column.SortSorting is triggered by right click on headers
Variable sort_lt should be a function with same signature as __lt__
When sort_lt is defined, sorting action will based on sort_lt instead of default __lt__How to set dataimport pandas as pd
my_data = pd.DataFrame(...)
table_widget.set_data(my_data)How to get datamy_data = table_widget.get_data(data)
shown_data = table_widget.get_data(data, full=False)How to get filter datacurrent_filter_dict = table_widget.get_filter_data()