dataframe-textual 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/PKG-INFO +1 -1
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/pyproject.toml +1 -1
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/data_frame_table.py +67 -54
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/data_frame_viewer.py +13 -8
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/uv.lock +1 -1
- dataframe_textual-2.2.2/x +0 -40532
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/.gitignore +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/1811.csv.gz +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/LICENSE +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/README.md +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/large_malformed.tsv.gz +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/main.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/__init__.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/__main__.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/common.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/data_frame_help_panel.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/sql_screen.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/table_screen.py +0 -0
- {dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/yes_no_screen.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dataframe-textual
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Interactive terminal viewer/editor for tabular data
|
|
5
5
|
Project-URL: Homepage, https://github.com/need47/dataframe-textual
|
|
6
6
|
Project-URL: Repository, https://github.com/need47/dataframe-textual.git
|
{dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/data_frame_table.py
RENAMED
|
@@ -245,7 +245,7 @@ class DataFrameTable(DataTable):
|
|
|
245
245
|
("tilde", "toggle_row_labels", "Toggle row labels"), # `~`
|
|
246
246
|
("K", "cycle_cursor_type", "Cycle cursor mode"), # `K`
|
|
247
247
|
("z", "freeze_row_column", "Freeze rows/columns"),
|
|
248
|
-
("comma", "
|
|
248
|
+
("comma", "toggle_thousand_separator", "Toggle thousand separator"), # `,`
|
|
249
249
|
("underscore", "expand_column", "Expand column to full width"), # `_`
|
|
250
250
|
("circumflex_accent", "toggle_rid", "Toggle internal row index"), # `^`
|
|
251
251
|
# Copy
|
|
@@ -905,7 +905,7 @@ class DataFrameTable(DataTable):
|
|
|
905
905
|
"""Toggle row labels visibility."""
|
|
906
906
|
self.show_row_labels = not self.show_row_labels
|
|
907
907
|
# status = "shown" if self.show_row_labels else "hidden"
|
|
908
|
-
# self.notify(f"Row labels {status}", title="Labels")
|
|
908
|
+
# self.notify(f"Row labels {status}", title="Toggle Row Labels")
|
|
909
909
|
|
|
910
910
|
def action_cast_column_dtype(self, dtype: str | pl.DataType) -> None:
|
|
911
911
|
"""Cast the current column to a different data type."""
|
|
@@ -921,8 +921,8 @@ class DataFrameTable(DataTable):
|
|
|
921
921
|
self.do_copy_to_clipboard(cell_str, f"Copied: [$success]{cell_str[:50]}[/]")
|
|
922
922
|
except IndexError:
|
|
923
923
|
self.notify(
|
|
924
|
-
f"Error copying cell ([$error]{ridx}[/], [$accent]{cidx}[/])",
|
|
925
|
-
title="
|
|
924
|
+
f"Error copying cell ([$error]{ridx}[/], [$accent]{cidx}[/]) to clipboard",
|
|
925
|
+
title="Copy Cell",
|
|
926
926
|
severity="error",
|
|
927
927
|
timeout=10,
|
|
928
928
|
)
|
|
@@ -941,7 +941,12 @@ class DataFrameTable(DataTable):
|
|
|
941
941
|
f"Copied [$accent]{len(col_values)}[/] values from column [$success]{col_name}[/]",
|
|
942
942
|
)
|
|
943
943
|
except (FileNotFoundError, IndexError):
|
|
944
|
-
self.notify(
|
|
944
|
+
self.notify(
|
|
945
|
+
f"Error copying column [$error]{col_name}[/] to clipboard",
|
|
946
|
+
title="Copy Column",
|
|
947
|
+
severity="error",
|
|
948
|
+
timeout=10,
|
|
949
|
+
)
|
|
945
950
|
|
|
946
951
|
def action_copy_row(self) -> None:
|
|
947
952
|
"""Copy the current row to clipboard (values separated by tabs)."""
|
|
@@ -957,14 +962,16 @@ class DataFrameTable(DataTable):
|
|
|
957
962
|
f"Copied row [$accent]{ridx + 1}[/] with [$success]{len(row_values)}[/] values",
|
|
958
963
|
)
|
|
959
964
|
except (FileNotFoundError, IndexError):
|
|
960
|
-
self.notify(
|
|
965
|
+
self.notify(
|
|
966
|
+
f"Error copying row [$error]{ridx}[/] to clipboard", title="Copy Row", severity="error", timeout=10
|
|
967
|
+
)
|
|
961
968
|
|
|
962
|
-
def
|
|
969
|
+
def action_toggle_thousand_separator(self) -> None:
|
|
963
970
|
"""Toggle thousand separator for numeric display."""
|
|
964
971
|
self.thousand_separator = not self.thousand_separator
|
|
965
972
|
self.setup_table()
|
|
966
973
|
# status = "enabled" if self.thousand_separator else "disabled"
|
|
967
|
-
# self.notify(f"Thousand separator {status}", title="
|
|
974
|
+
# self.notify(f"Thousand separator {status}", title="Toggle Thousand Separator")
|
|
968
975
|
|
|
969
976
|
def action_next_match(self) -> None:
|
|
970
977
|
"""Go to the next matched cell."""
|
|
@@ -1344,7 +1351,7 @@ class DataFrameTable(DataTable):
|
|
|
1344
1351
|
return range_count
|
|
1345
1352
|
|
|
1346
1353
|
except Exception as e:
|
|
1347
|
-
self.notify("Error loading rows", title="Load", severity="error", timeout=10)
|
|
1354
|
+
self.notify("Error loading rows", title="Load Rows", severity="error", timeout=10)
|
|
1348
1355
|
self.log(f"Error loading rows: {str(e)}")
|
|
1349
1356
|
return 0
|
|
1350
1357
|
|
|
@@ -1593,7 +1600,7 @@ class DataFrameTable(DataTable):
|
|
|
1593
1600
|
def do_undo(self) -> None:
|
|
1594
1601
|
"""Undo the last action."""
|
|
1595
1602
|
if not self.histories_undo:
|
|
1596
|
-
self.notify("No actions to undo", title="Undo", severity="warning")
|
|
1603
|
+
# self.notify("No actions to undo", title="Undo", severity="warning")
|
|
1597
1604
|
return
|
|
1598
1605
|
|
|
1599
1606
|
# Pop the last history state for undo and save to redo stack
|
|
@@ -1608,7 +1615,7 @@ class DataFrameTable(DataTable):
|
|
|
1608
1615
|
def do_redo(self) -> None:
|
|
1609
1616
|
"""Redo the last undone action."""
|
|
1610
1617
|
if not self.histories_redo:
|
|
1611
|
-
self.notify("No actions to redo", title="Redo", severity="warning")
|
|
1618
|
+
# self.notify("No actions to redo", title="Redo", severity="warning")
|
|
1612
1619
|
return
|
|
1613
1620
|
|
|
1614
1621
|
# Pop the last undone state from redo stack
|
|
@@ -1635,7 +1642,7 @@ class DataFrameTable(DataTable):
|
|
|
1635
1642
|
next_type = get_next_item(CURSOR_TYPES, self.cursor_type)
|
|
1636
1643
|
self.cursor_type = next_type
|
|
1637
1644
|
|
|
1638
|
-
# self.notify(f"Changed cursor type to [$success]{next_type}[/]", title="Cursor")
|
|
1645
|
+
# self.notify(f"Changed cursor type to [$success]{next_type}[/]", title="Cycle Cursor Type")
|
|
1639
1646
|
|
|
1640
1647
|
def do_view_row_detail(self) -> None:
|
|
1641
1648
|
"""Open a modal screen to view the selected row's details."""
|
|
@@ -1697,7 +1704,7 @@ class DataFrameTable(DataTable):
|
|
|
1697
1704
|
if fixed_columns >= 0:
|
|
1698
1705
|
self.fixed_columns = fixed_columns
|
|
1699
1706
|
|
|
1700
|
-
# self.notify(f"Pinned [$success]{fixed_rows}[/] rows and [$accent]{fixed_columns}[/] columns", title="Pin")
|
|
1707
|
+
# self.notify(f"Pinned [$success]{fixed_rows}[/] rows and [$accent]{fixed_columns}[/] columns", title="Pin Row/Column")
|
|
1701
1708
|
|
|
1702
1709
|
def do_hide_column(self) -> None:
|
|
1703
1710
|
"""Hide the currently selected column from the table display."""
|
|
@@ -1718,7 +1725,9 @@ class DataFrameTable(DataTable):
|
|
|
1718
1725
|
if col_idx >= len(self.columns):
|
|
1719
1726
|
self.move_cursor(column=len(self.columns) - 1)
|
|
1720
1727
|
|
|
1721
|
-
# self.notify(
|
|
1728
|
+
# self.notify(
|
|
1729
|
+
# f"Hid column [$success]{col_name}[/]. Press [$accent]H[/] to show hidden columns", title="Hide Column"
|
|
1730
|
+
# )
|
|
1722
1731
|
|
|
1723
1732
|
def do_expand_column(self) -> None:
|
|
1724
1733
|
"""Expand the current column to show the widest cell in the loaded data."""
|
|
@@ -1773,7 +1782,7 @@ class DataFrameTable(DataTable):
|
|
|
1773
1782
|
self._require_update_dimensions = True
|
|
1774
1783
|
self.refresh(layout=True)
|
|
1775
1784
|
|
|
1776
|
-
# self.notify(f"Expanded column [$success]{col_name}[/] to width [$accent]{max_width}[/]", title="Expand")
|
|
1785
|
+
# self.notify(f"Expanded column [$success]{col_name}[/] to width [$accent]{max_width}[/]", title="Expand Column")
|
|
1777
1786
|
|
|
1778
1787
|
def do_toggle_rid(self) -> None:
|
|
1779
1788
|
"""Toggle display of the internal RID column."""
|
|
@@ -1785,7 +1794,7 @@ class DataFrameTable(DataTable):
|
|
|
1785
1794
|
def do_show_hidden_rows_columns(self) -> None:
|
|
1786
1795
|
"""Show all hidden rows/columns by recreating the table."""
|
|
1787
1796
|
if not self.hidden_columns and self.df_view is None:
|
|
1788
|
-
self.notify("No hidden rows or columns to show", title="Show", severity="warning")
|
|
1797
|
+
# self.notify("No hidden rows or columns to show", title="Show Hidden Rows/Columns", severity="warning")
|
|
1789
1798
|
return
|
|
1790
1799
|
|
|
1791
1800
|
# Add to history
|
|
@@ -1802,7 +1811,7 @@ class DataFrameTable(DataTable):
|
|
|
1802
1811
|
# Recreate table for display
|
|
1803
1812
|
self.setup_table()
|
|
1804
1813
|
|
|
1805
|
-
self.notify("Showed hidden row(s) and/or hidden column(s)", title="Show")
|
|
1814
|
+
# self.notify("Showed hidden row(s) and/or hidden column(s)", title="Show Hidden Rows/Columns")
|
|
1806
1815
|
|
|
1807
1816
|
# Sort
|
|
1808
1817
|
def do_sort_by_column(self, descending: bool = False) -> None:
|
|
@@ -1979,7 +1988,7 @@ class DataFrameTable(DataTable):
|
|
|
1979
1988
|
except Exception:
|
|
1980
1989
|
self.notify(
|
|
1981
1990
|
f"Error converting [$error]{term}[/] to [$accent]{dtype}[/]. Cast to string.",
|
|
1982
|
-
title="Edit",
|
|
1991
|
+
title="Edit Column",
|
|
1983
1992
|
severity="error",
|
|
1984
1993
|
)
|
|
1985
1994
|
expr = pl.lit(str(term))
|
|
@@ -2084,7 +2093,7 @@ class DataFrameTable(DataTable):
|
|
|
2084
2093
|
# Move cursor to the renamed column
|
|
2085
2094
|
self.move_cursor(column=col_idx)
|
|
2086
2095
|
|
|
2087
|
-
# self.notify(f"Renamed column [$success]{col_name}[/] to [$success]{new_name}[/]", title="Column")
|
|
2096
|
+
# self.notify(f"Renamed column [$success]{col_name}[/] to [$success]{new_name}[/]", title="Rename Column")
|
|
2088
2097
|
|
|
2089
2098
|
def do_clear_cell(self) -> None:
|
|
2090
2099
|
"""Clear the current cell by setting its value to None."""
|
|
@@ -2296,7 +2305,7 @@ class DataFrameTable(DataTable):
|
|
|
2296
2305
|
# Move cursor to the new column
|
|
2297
2306
|
self.move_cursor(column=cidx + 1)
|
|
2298
2307
|
|
|
2299
|
-
self.notify(f"Added link column [$success]{new_col_name}[/]. Use Ctrl/Cmd click to open.", title="Add Link")
|
|
2308
|
+
# self.notify(f"Added link column [$success]{new_col_name}[/]. Use Ctrl/Cmd click to open.", title="Add Link")
|
|
2300
2309
|
|
|
2301
2310
|
except Exception as e:
|
|
2302
2311
|
self.notify(
|
|
@@ -2311,7 +2320,7 @@ class DataFrameTable(DataTable):
|
|
|
2311
2320
|
try:
|
|
2312
2321
|
col_name = self.cursor_col_name
|
|
2313
2322
|
except CellDoesNotExist:
|
|
2314
|
-
self.notify("No column to delete at the current cursor position", title="Delete Column", severity="warning")
|
|
2323
|
+
# self.notify("No column to delete at the current cursor position", title="Delete Column", severity="warning")
|
|
2315
2324
|
return
|
|
2316
2325
|
|
|
2317
2326
|
col_key = self.cursor_col_key
|
|
@@ -2378,7 +2387,7 @@ class DataFrameTable(DataTable):
|
|
|
2378
2387
|
if self.df_view is not None:
|
|
2379
2388
|
self.df_view = self.df_view.drop(col_names_to_remove)
|
|
2380
2389
|
|
|
2381
|
-
self.notify(message, title="Delete Column")
|
|
2390
|
+
# self.notify(message, title="Delete Column")
|
|
2382
2391
|
|
|
2383
2392
|
def do_duplicate_column(self) -> None:
|
|
2384
2393
|
"""Duplicate the currently selected column, inserting it right after the current column."""
|
|
@@ -2417,7 +2426,7 @@ class DataFrameTable(DataTable):
|
|
|
2417
2426
|
# Move cursor to the new duplicated column
|
|
2418
2427
|
self.move_cursor(column=col_idx + 1)
|
|
2419
2428
|
|
|
2420
|
-
# self.notify(f"Duplicated column [$success]{col_name}[/] as [$accent]{new_col_name}[/]", title="Duplicate")
|
|
2429
|
+
# self.notify(f"Duplicated column [$success]{col_name}[/] as [$accent]{new_col_name}[/]", title="Duplicate Column")
|
|
2421
2430
|
|
|
2422
2431
|
def do_delete_row(self, more: str = None) -> None:
|
|
2423
2432
|
"""Delete rows from the table and dataframe.
|
|
@@ -2459,7 +2468,7 @@ class DataFrameTable(DataTable):
|
|
|
2459
2468
|
try:
|
|
2460
2469
|
df_filtered = self.df.lazy().filter(~pl.col(RID).is_in(rids_to_delete)).collect()
|
|
2461
2470
|
except Exception as e:
|
|
2462
|
-
self.notify(f"Error deleting row(s): {e}", title="Delete", severity="error", timeout=10)
|
|
2471
|
+
self.notify(f"Error deleting row(s): {e}", title="Delete Row(s)", severity="error", timeout=10)
|
|
2463
2472
|
self.histories_undo.pop() # Remove last history entry
|
|
2464
2473
|
return
|
|
2465
2474
|
|
|
@@ -2486,7 +2495,7 @@ class DataFrameTable(DataTable):
|
|
|
2486
2495
|
|
|
2487
2496
|
deleted_count = old_count - len(self.df)
|
|
2488
2497
|
if deleted_count > 0:
|
|
2489
|
-
self.notify(f"Deleted [$success]{deleted_count}[/] row(s)", title="Delete")
|
|
2498
|
+
self.notify(f"Deleted [$success]{deleted_count}[/] row(s)", title="Delete Row(s)")
|
|
2490
2499
|
|
|
2491
2500
|
def do_duplicate_row(self) -> None:
|
|
2492
2501
|
"""Duplicate the currently selected row, inserting it right after the current row."""
|
|
@@ -2521,7 +2530,7 @@ class DataFrameTable(DataTable):
|
|
|
2521
2530
|
# Move cursor to the new duplicated row
|
|
2522
2531
|
self.move_cursor(row=ridx + 1)
|
|
2523
2532
|
|
|
2524
|
-
# self.notify(f"Duplicated row [$success]{ridx + 1}[/]", title="Row")
|
|
2533
|
+
# self.notify(f"Duplicated row [$success]{ridx + 1}[/]", title="Duplicate Row")
|
|
2525
2534
|
|
|
2526
2535
|
def do_move_column(self, direction: str) -> None:
|
|
2527
2536
|
"""Move the current column left or right.
|
|
@@ -2537,12 +2546,12 @@ class DataFrameTable(DataTable):
|
|
|
2537
2546
|
# Validate move is possible
|
|
2538
2547
|
if direction == "left":
|
|
2539
2548
|
if col_idx <= 0:
|
|
2540
|
-
self.notify("Cannot move column left", title="Move", severity="warning")
|
|
2549
|
+
# self.notify("Cannot move column left", title="Move Column", severity="warning")
|
|
2541
2550
|
return
|
|
2542
2551
|
swap_idx = col_idx - 1
|
|
2543
2552
|
elif direction == "right":
|
|
2544
2553
|
if col_idx >= len(self.columns) - 1:
|
|
2545
|
-
self.notify("Cannot move column right", title="Move", severity="warning")
|
|
2554
|
+
# self.notify("Cannot move column right", title="Move Column", severity="warning")
|
|
2546
2555
|
return
|
|
2547
2556
|
swap_idx = col_idx + 1
|
|
2548
2557
|
|
|
@@ -2583,7 +2592,7 @@ class DataFrameTable(DataTable):
|
|
|
2583
2592
|
if self.df_view is not None:
|
|
2584
2593
|
self.df_view = self.df_view.select(cols)
|
|
2585
2594
|
|
|
2586
|
-
# self.notify(f"Moved column [$success]{col_name}[/] {direction}", title="Move")
|
|
2595
|
+
# self.notify(f"Moved column [$success]{col_name}[/] {direction}", title="Move Column")
|
|
2587
2596
|
|
|
2588
2597
|
def do_move_row(self, direction: str) -> None:
|
|
2589
2598
|
"""Move the current row up or down.
|
|
@@ -2596,12 +2605,12 @@ class DataFrameTable(DataTable):
|
|
|
2596
2605
|
# Validate move is possible
|
|
2597
2606
|
if direction == "up":
|
|
2598
2607
|
if curr_row_idx <= 0:
|
|
2599
|
-
self.notify("Cannot move row up", title="Move", severity="warning")
|
|
2608
|
+
# self.notify("Cannot move row up", title="Move Row", severity="warning")
|
|
2600
2609
|
return
|
|
2601
2610
|
swap_row_idx = curr_row_idx - 1
|
|
2602
2611
|
elif direction == "down":
|
|
2603
2612
|
if curr_row_idx >= len(self.rows) - 1:
|
|
2604
|
-
self.notify("Cannot move row down", title="Move", severity="warning")
|
|
2613
|
+
# self.notify("Cannot move row down", title="Move Row", severity="warning")
|
|
2605
2614
|
return
|
|
2606
2615
|
swap_row_idx = curr_row_idx + 1
|
|
2607
2616
|
else:
|
|
@@ -2688,15 +2697,17 @@ class DataFrameTable(DataTable):
|
|
|
2688
2697
|
try:
|
|
2689
2698
|
target_dtype = eval(dtype)
|
|
2690
2699
|
except Exception:
|
|
2691
|
-
self.notify(
|
|
2700
|
+
self.notify(
|
|
2701
|
+
f"Invalid target data type: [$error]{dtype}[/]", title="Cast Column", severity="error", timeout=10
|
|
2702
|
+
)
|
|
2692
2703
|
return
|
|
2693
2704
|
|
|
2694
2705
|
if current_dtype == target_dtype:
|
|
2695
|
-
self.notify(
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
)
|
|
2706
|
+
# self.notify(
|
|
2707
|
+
# f"Column [$warning]{col_name}[/] is already of type [$accent]{target_dtype}[/]",
|
|
2708
|
+
# title="Cast Column",
|
|
2709
|
+
# severity="warning",
|
|
2710
|
+
# )
|
|
2700
2711
|
return # No change needed
|
|
2701
2712
|
|
|
2702
2713
|
# Add to history
|
|
@@ -2716,11 +2727,11 @@ class DataFrameTable(DataTable):
|
|
|
2716
2727
|
# Recreate table for display
|
|
2717
2728
|
self.setup_table()
|
|
2718
2729
|
|
|
2719
|
-
self.notify(f"Cast column [$success]{col_name}[/] to [$accent]{target_dtype}[/]", title="Cast")
|
|
2730
|
+
# self.notify(f"Cast column [$success]{col_name}[/] to [$accent]{target_dtype}[/]", title="Cast")
|
|
2720
2731
|
except Exception as e:
|
|
2721
2732
|
self.notify(
|
|
2722
2733
|
f"Error casting column [$error]{col_name}[/] to [$accent]{target_dtype}[/]",
|
|
2723
|
-
title="Cast",
|
|
2734
|
+
title="Cast Column",
|
|
2724
2735
|
severity="error",
|
|
2725
2736
|
timeout=10,
|
|
2726
2737
|
)
|
|
@@ -2865,7 +2876,7 @@ class DataFrameTable(DataTable):
|
|
|
2865
2876
|
|
|
2866
2877
|
# Check if we're highlighting or un-highlighting
|
|
2867
2878
|
if selected_count := len(self.selected_rows):
|
|
2868
|
-
self.notify(f"Toggled selection for [$success]{selected_count}[/] rows", title="Toggle")
|
|
2879
|
+
self.notify(f"Toggled selection for [$success]{selected_count}[/] rows", title="Toggle Selection(s)")
|
|
2869
2880
|
|
|
2870
2881
|
# Recreate table for display
|
|
2871
2882
|
self.setup_table()
|
|
@@ -2907,7 +2918,7 @@ class DataFrameTable(DataTable):
|
|
|
2907
2918
|
"""Clear all selected rows and matches without removing them from the dataframe."""
|
|
2908
2919
|
# Check if any selected rows or matches
|
|
2909
2920
|
if not self.selected_rows and not self.matches:
|
|
2910
|
-
self.notify("No selections to clear", title="Clear", severity="warning")
|
|
2921
|
+
# self.notify("No selections to clear", title="Clear Selections and Matches", severity="warning")
|
|
2911
2922
|
return
|
|
2912
2923
|
|
|
2913
2924
|
row_count = len(self.selected_rows | set(self.matches.keys()))
|
|
@@ -2922,7 +2933,7 @@ class DataFrameTable(DataTable):
|
|
|
2922
2933
|
# Recreate table for display
|
|
2923
2934
|
self.setup_table()
|
|
2924
2935
|
|
|
2925
|
-
self.notify(f"Cleared selections for [$success]{row_count}[/] rows", title="Clear")
|
|
2936
|
+
self.notify(f"Cleared selections for [$success]{row_count}[/] rows", title="Clear Selections and Matches")
|
|
2926
2937
|
|
|
2927
2938
|
# Find & Replace
|
|
2928
2939
|
def find_matches(
|
|
@@ -3096,7 +3107,7 @@ class DataFrameTable(DataTable):
|
|
|
3096
3107
|
def do_next_match(self) -> None:
|
|
3097
3108
|
"""Move cursor to the next match."""
|
|
3098
3109
|
if not self.matches:
|
|
3099
|
-
self.notify("No matches to navigate", title="Next Match", severity="warning")
|
|
3110
|
+
# self.notify("No matches to navigate", title="Next Match", severity="warning")
|
|
3100
3111
|
return
|
|
3101
3112
|
|
|
3102
3113
|
# Get sorted list of matched coordinates
|
|
@@ -3118,7 +3129,7 @@ class DataFrameTable(DataTable):
|
|
|
3118
3129
|
def do_previous_match(self) -> None:
|
|
3119
3130
|
"""Move cursor to the previous match."""
|
|
3120
3131
|
if not self.matches:
|
|
3121
|
-
self.notify("No matches to navigate", title="Previous Match", severity="warning")
|
|
3132
|
+
# self.notify("No matches to navigate", title="Previous Match", severity="warning")
|
|
3122
3133
|
return
|
|
3123
3134
|
|
|
3124
3135
|
# Get sorted list of matched coordinates
|
|
@@ -3146,7 +3157,7 @@ class DataFrameTable(DataTable):
|
|
|
3146
3157
|
def do_next_selected_row(self) -> None:
|
|
3147
3158
|
"""Move cursor to the next selected row."""
|
|
3148
3159
|
if not self.selected_rows:
|
|
3149
|
-
self.notify("No selected rows to navigate", title="Next Selected Row", severity="warning")
|
|
3160
|
+
# self.notify("No selected rows to navigate", title="Next Selected Row", severity="warning")
|
|
3150
3161
|
return
|
|
3151
3162
|
|
|
3152
3163
|
# Get list of selected row indices in order
|
|
@@ -3168,7 +3179,7 @@ class DataFrameTable(DataTable):
|
|
|
3168
3179
|
def do_previous_selected_row(self) -> None:
|
|
3169
3180
|
"""Move cursor to the previous selected row."""
|
|
3170
3181
|
if not self.selected_rows:
|
|
3171
|
-
self.notify("No selected rows to navigate", title="Previous Selected Row", severity="warning")
|
|
3182
|
+
# self.notify("No selected rows to navigate", title="Previous Selected Row", severity="warning")
|
|
3172
3183
|
return
|
|
3173
3184
|
|
|
3174
3185
|
# Get list of selected row indices in order
|
|
@@ -3567,7 +3578,7 @@ class DataFrameTable(DataTable):
|
|
|
3567
3578
|
expr = validate_expr(term, self.df.columns, cidx)
|
|
3568
3579
|
except Exception as e:
|
|
3569
3580
|
self.notify(
|
|
3570
|
-
f"Error validating expression [$error]{term}[/]", title="Filter", severity="error", timeout=10
|
|
3581
|
+
f"Error validating expression [$error]{term}[/]", title="Filter Rows", severity="error", timeout=10
|
|
3571
3582
|
)
|
|
3572
3583
|
self.log(f"Error validating expression `{term}`: {str(e)}")
|
|
3573
3584
|
return
|
|
@@ -3592,7 +3603,9 @@ class DataFrameTable(DataTable):
|
|
|
3592
3603
|
term = f"(?i){term}"
|
|
3593
3604
|
expr = pl.col(col_name).cast(pl.String).str.contains(term)
|
|
3594
3605
|
self.notify(
|
|
3595
|
-
f"Unknown column type [$warning]{dtype}[/]. Cast to string.",
|
|
3606
|
+
f"Unknown column type [$warning]{dtype}[/]. Cast to string.",
|
|
3607
|
+
title="View Rows",
|
|
3608
|
+
severity="warning",
|
|
3596
3609
|
)
|
|
3597
3610
|
|
|
3598
3611
|
# Lazyframe with row indices
|
|
@@ -3605,13 +3618,13 @@ class DataFrameTable(DataTable):
|
|
|
3605
3618
|
df_filtered = lf.filter(expr).collect()
|
|
3606
3619
|
except Exception as e:
|
|
3607
3620
|
self.histories_undo.pop() # Remove last history entry
|
|
3608
|
-
self.notify(f"Error applying filter [$error]{expr_str}[/]", title="
|
|
3621
|
+
self.notify(f"Error applying filter [$error]{expr_str}[/]", title="View Rows", severity="error", timeout=10)
|
|
3609
3622
|
self.log(f"Error applying filter `{expr_str}`: {str(e)}")
|
|
3610
3623
|
return
|
|
3611
3624
|
|
|
3612
3625
|
matched_count = len(df_filtered)
|
|
3613
3626
|
if not matched_count:
|
|
3614
|
-
self.notify(f"No rows match the expression: [$success]{expr}[/]", title="
|
|
3627
|
+
self.notify(f"No rows match the expression: [$success]{expr}[/]", title="View Rows", severity="warning")
|
|
3615
3628
|
return
|
|
3616
3629
|
|
|
3617
3630
|
# Add to history
|
|
@@ -3637,7 +3650,7 @@ class DataFrameTable(DataTable):
|
|
|
3637
3650
|
# Recreate table for display
|
|
3638
3651
|
self.setup_table()
|
|
3639
3652
|
|
|
3640
|
-
self.notify(f"Filtered to [$success]{matched_count}[/] matching row(s)", title="
|
|
3653
|
+
self.notify(f"Filtered to [$success]{matched_count}[/] matching row(s)", title="View Rows")
|
|
3641
3654
|
|
|
3642
3655
|
def do_filter_rows(self) -> None:
|
|
3643
3656
|
"""Filter rows.
|
|
@@ -3691,7 +3704,7 @@ class DataFrameTable(DataTable):
|
|
|
3691
3704
|
# Recreate table for display
|
|
3692
3705
|
self.setup_table()
|
|
3693
3706
|
|
|
3694
|
-
self.notify(f"{message}. Now showing [$success]{len(self.df)}[/] rows.", title="Filter")
|
|
3707
|
+
self.notify(f"{message}. Now showing [$success]{len(self.df)}[/] rows.", title="Filter Rows")
|
|
3695
3708
|
|
|
3696
3709
|
# Copy & Save
|
|
3697
3710
|
def do_copy_to_clipboard(self, content: str, message: str) -> None:
|
|
@@ -3713,9 +3726,9 @@ class DataFrameTable(DataTable):
|
|
|
3713
3726
|
input=content,
|
|
3714
3727
|
text=True,
|
|
3715
3728
|
)
|
|
3716
|
-
self.notify(message, title="Clipboard")
|
|
3729
|
+
self.notify(message, title="Copy to Clipboard")
|
|
3717
3730
|
except FileNotFoundError:
|
|
3718
|
-
self.notify("Error copying to clipboard", title="Clipboard", severity="error", timeout=10)
|
|
3731
|
+
self.notify("Error copying to clipboard", title="Copy to Clipboard", severity="error", timeout=10)
|
|
3719
3732
|
|
|
3720
3733
|
def do_save_to_file(self, all_tabs: bool | None = None, task_after_save: str | None = None) -> None:
|
|
3721
3734
|
"""Open screen to save file."""
|
{dataframe_textual-2.2.2 → dataframe_textual-2.2.3}/src/dataframe_textual/data_frame_viewer.py
RENAMED
|
@@ -137,7 +137,9 @@ class DataFrameViewer(App):
|
|
|
137
137
|
except Exception as e:
|
|
138
138
|
self.notify(
|
|
139
139
|
f"Error loading [$error]{filename}[/]: Try [$accent]-I[/] to disable schema inference",
|
|
140
|
+
title="Load File",
|
|
140
141
|
severity="error",
|
|
142
|
+
timeout=10,
|
|
141
143
|
)
|
|
142
144
|
self.log(f"Error loading `{filename}`: {str(e)}")
|
|
143
145
|
|
|
@@ -166,7 +168,7 @@ class DataFrameViewer(App):
|
|
|
166
168
|
"""
|
|
167
169
|
if event.key == "k":
|
|
168
170
|
self.theme = get_next_item(list(BUILTIN_THEMES.keys()), self.theme)
|
|
169
|
-
self.notify(f"Switched to theme: [$success]{self.theme}[/]", title="
|
|
171
|
+
self.notify(f"Switched to theme: [$success]{self.theme}[/]", title="SwitchTheme")
|
|
170
172
|
|
|
171
173
|
def on_click(self, event: Click) -> None:
|
|
172
174
|
"""Handle mouse click events on tabs.
|
|
@@ -360,7 +362,7 @@ class DataFrameViewer(App):
|
|
|
360
362
|
tabs = self.query_one(ContentTabs)
|
|
361
363
|
tabs.display = not tabs.display
|
|
362
364
|
# status = "shown" if tabs.display else "hidden"
|
|
363
|
-
# self.notify(f"Tab bar [$success]{status}[/]", title="Toggle")
|
|
365
|
+
# self.notify(f"Tab bar [$success]{status}[/]", title="Toggle Tab Bar")
|
|
364
366
|
|
|
365
367
|
def get_active_table(self) -> DataFrameTable | None:
|
|
366
368
|
"""Get the currently active DataFrameTable widget.
|
|
@@ -376,7 +378,8 @@ class DataFrameViewer(App):
|
|
|
376
378
|
if active_pane := tabbed.active_pane:
|
|
377
379
|
return active_pane.query_one(DataFrameTable)
|
|
378
380
|
except (NoMatches, AttributeError):
|
|
379
|
-
self.notify("No active table found", title="Locate", severity="error")
|
|
381
|
+
self.notify("No active table found", title="Locate Table", severity="error", timeout=10)
|
|
382
|
+
|
|
380
383
|
return None
|
|
381
384
|
|
|
382
385
|
def get_unique_tabname(self, tab_name: str) -> str:
|
|
@@ -414,11 +417,13 @@ class DataFrameViewer(App):
|
|
|
414
417
|
for source in load_file(filename, prefix_sheet=True):
|
|
415
418
|
self.add_tab(source.frame, filename, source.tabname, after=self.tabbed.active_pane)
|
|
416
419
|
n_tab += 1
|
|
417
|
-
# self.notify(f"Added [$accent]{n_tab}[/] tab(s) for [$success]{filename}[/]", title="Open")
|
|
420
|
+
# self.notify(f"Added [$accent]{n_tab}[/] tab(s) for [$success]{filename}[/]", title="Open File")
|
|
418
421
|
except Exception as e:
|
|
419
|
-
self.notify(
|
|
422
|
+
self.notify(
|
|
423
|
+
f"Error loading [$error]{filename}[/]: {str(e)}", title="Open File", severity="error", timeout=10
|
|
424
|
+
)
|
|
420
425
|
else:
|
|
421
|
-
self.notify(f"File does not exist: [$warning]{filename}[/]", title="Open", severity="warning")
|
|
426
|
+
self.notify(f"File does not exist: [$warning]{filename}[/]", title="Open File", severity="warning")
|
|
422
427
|
|
|
423
428
|
def add_tab(
|
|
424
429
|
self,
|
|
@@ -610,7 +615,7 @@ class DataFrameViewer(App):
|
|
|
610
615
|
content_tab, new_name = result
|
|
611
616
|
|
|
612
617
|
# Update the tab name
|
|
613
|
-
old_name = content_tab.label_text
|
|
618
|
+
# old_name = content_tab.label_text
|
|
614
619
|
content_tab.label = new_name
|
|
615
620
|
|
|
616
621
|
# Mark tab as dirty to indicate name change
|
|
@@ -622,4 +627,4 @@ class DataFrameViewer(App):
|
|
|
622
627
|
table.focus()
|
|
623
628
|
break
|
|
624
629
|
|
|
625
|
-
self.notify(f"Renamed tab [$accent]{old_name}[/] to [$success]{new_name}[/]", title="Rename")
|
|
630
|
+
# self.notify(f"Renamed tab [$accent]{old_name}[/] to [$success]{new_name}[/]", title="Rename Tab")
|