dataframe-textual 2.10.0__py3-none-any.whl → 2.11.0__py3-none-any.whl
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/data_frame_table.py +11 -16
- dataframe_textual/data_frame_viewer.py +30 -13
- dataframe_textual/table_screen.py +4 -2
- {dataframe_textual-2.10.0.dist-info → dataframe_textual-2.11.0.dist-info}/METADATA +6 -6
- {dataframe_textual-2.10.0.dist-info → dataframe_textual-2.11.0.dist-info}/RECORD +8 -8
- {dataframe_textual-2.10.0.dist-info → dataframe_textual-2.11.0.dist-info}/WHEEL +0 -0
- {dataframe_textual-2.10.0.dist-info → dataframe_textual-2.11.0.dist-info}/entry_points.txt +0 -0
- {dataframe_textual-2.10.0.dist-info → dataframe_textual-2.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -242,7 +242,7 @@ class DataFrameTable(DataTable):
|
|
|
242
242
|
("ctrl+u", "reset", "Reset to initial state"),
|
|
243
243
|
# Display
|
|
244
244
|
("h", "hide_column", "Hide column"),
|
|
245
|
-
("H", "
|
|
245
|
+
("H", "show_hidden_columns", "Show hidden column(s)"),
|
|
246
246
|
("tilde", "toggle_row_labels", "Toggle row labels"), # `~`
|
|
247
247
|
("K", "cycle_cursor_type", "Cycle cursor mode"), # `K`
|
|
248
248
|
("z", "freeze_row_column", "Freeze rows/columns"),
|
|
@@ -731,9 +731,9 @@ class DataFrameTable(DataTable):
|
|
|
731
731
|
"""Set cursor row as the new header row."""
|
|
732
732
|
self.do_set_cursor_row_as_header()
|
|
733
733
|
|
|
734
|
-
def
|
|
735
|
-
"""Show all hidden
|
|
736
|
-
self.
|
|
734
|
+
def action_show_hidden_columns(self) -> None:
|
|
735
|
+
"""Show all hidden columns."""
|
|
736
|
+
self.do_show_hidden_columns()
|
|
737
737
|
|
|
738
738
|
def action_sort_ascending(self) -> None:
|
|
739
739
|
"""Sort by current column in ascending order."""
|
|
@@ -1847,27 +1847,22 @@ class DataFrameTable(DataTable):
|
|
|
1847
1847
|
|
|
1848
1848
|
# self.notify(f"Set row [$success]{ridx + 1}[/] as header", title="Set Row as Header")
|
|
1849
1849
|
|
|
1850
|
-
def
|
|
1851
|
-
"""Show all hidden
|
|
1852
|
-
if not self.hidden_columns
|
|
1853
|
-
# self.notify("No hidden
|
|
1850
|
+
def do_show_hidden_columns(self) -> None:
|
|
1851
|
+
"""Show all hidden columns by recreating the table."""
|
|
1852
|
+
if not self.hidden_columns:
|
|
1853
|
+
# self.notify("No hidden columns to show", title="Show Hidden Column(s)", severity="warning")
|
|
1854
1854
|
return
|
|
1855
1855
|
|
|
1856
1856
|
# Add to history
|
|
1857
|
-
self.add_history("Showed hidden
|
|
1857
|
+
self.add_history("Showed hidden column(s)")
|
|
1858
1858
|
|
|
1859
|
-
#
|
|
1860
|
-
if self.df_view is not None:
|
|
1861
|
-
self.df = self.df_view
|
|
1862
|
-
self.df_view = None
|
|
1863
|
-
|
|
1864
|
-
# Clear hidden rows/columns tracking
|
|
1859
|
+
# Clear hidden columns tracking
|
|
1865
1860
|
self.hidden_columns.clear()
|
|
1866
1861
|
|
|
1867
1862
|
# Recreate table for display
|
|
1868
1863
|
self.setup_table()
|
|
1869
1864
|
|
|
1870
|
-
# self.notify("Showed hidden
|
|
1865
|
+
# self.notify("Showed hidden column(s)", title="Show Hidden Column(s)")
|
|
1871
1866
|
|
|
1872
1867
|
# Sort
|
|
1873
1868
|
def do_sort_by_column(self, descending: bool = False) -> None:
|
|
@@ -58,8 +58,8 @@ class DataFrameViewer(App):
|
|
|
58
58
|
""").strip()
|
|
59
59
|
|
|
60
60
|
BINDINGS = [
|
|
61
|
-
("q", "
|
|
62
|
-
("Q", "
|
|
61
|
+
("q", "quit", "Quit from view or close current tab"),
|
|
62
|
+
("Q", "quit_all", "Quit app after closing all tabs"),
|
|
63
63
|
("B", "toggle_tab_bar", "Toggle Tab Bar"),
|
|
64
64
|
("f1", "toggle_help_panel", "Help"),
|
|
65
65
|
("ctrl+o", "open_file", "Open File"),
|
|
@@ -242,21 +242,21 @@ class DataFrameViewer(App):
|
|
|
242
242
|
"""
|
|
243
243
|
self.push_screen(OpenFileScreen(), self.do_open_file)
|
|
244
244
|
|
|
245
|
-
def
|
|
246
|
-
"""
|
|
245
|
+
def action_quit(self) -> None:
|
|
246
|
+
"""Quit from the view or the current tab.
|
|
247
247
|
|
|
248
248
|
Checks for unsaved changes and prompts the user to save if needed.
|
|
249
249
|
If this is the last tab, exits the app.
|
|
250
250
|
"""
|
|
251
|
-
self.
|
|
251
|
+
self.do_quit()
|
|
252
252
|
|
|
253
|
-
def
|
|
254
|
-
"""
|
|
253
|
+
def action_quit_all(self) -> None:
|
|
254
|
+
"""Quit app after closing all tabs.
|
|
255
255
|
|
|
256
256
|
Checks if any tabs have unsaved changes. If yes, opens a confirmation dialog.
|
|
257
257
|
Otherwise, quits immediately.
|
|
258
258
|
"""
|
|
259
|
-
self.
|
|
259
|
+
self.do_quit_all()
|
|
260
260
|
|
|
261
261
|
def action_save_current_tab(self) -> None:
|
|
262
262
|
"""Open a save dialog to save current tab to file."""
|
|
@@ -486,16 +486,33 @@ class DataFrameViewer(App):
|
|
|
486
486
|
self.tabbed.active = tab.id
|
|
487
487
|
table.focus()
|
|
488
488
|
|
|
489
|
-
def
|
|
490
|
-
"""
|
|
489
|
+
def do_quit(self) -> None:
|
|
490
|
+
"""Quit from the view or the current tab.
|
|
491
491
|
|
|
492
|
-
|
|
493
|
-
can be closed, the application
|
|
492
|
+
When in a view, return to main table. Otherwise, close the active tab.
|
|
493
|
+
If only one tab remains and no more tabs can be closed, exits the application.
|
|
494
494
|
"""
|
|
495
495
|
try:
|
|
496
496
|
if not (table := self.active_table):
|
|
497
497
|
return
|
|
498
498
|
|
|
499
|
+
# In a view - return to main table
|
|
500
|
+
if table.df_view is not None:
|
|
501
|
+
# Remove from history
|
|
502
|
+
while table.histories_undo:
|
|
503
|
+
h = table.histories_undo[-1]
|
|
504
|
+
if h.description.startswith("Viewed rows by expression"):
|
|
505
|
+
table.histories_undo.pop()
|
|
506
|
+
else:
|
|
507
|
+
break
|
|
508
|
+
|
|
509
|
+
table.add_history("Return to main table")
|
|
510
|
+
table.df = table.df_view
|
|
511
|
+
table.df_view = None
|
|
512
|
+
table.setup_table()
|
|
513
|
+
|
|
514
|
+
return
|
|
515
|
+
|
|
499
516
|
def _on_save_confirm(result: bool) -> None:
|
|
500
517
|
"""Handle the "save before closing?" confirmation."""
|
|
501
518
|
if result:
|
|
@@ -540,7 +557,7 @@ class DataFrameViewer(App):
|
|
|
540
557
|
except Exception:
|
|
541
558
|
pass
|
|
542
559
|
|
|
543
|
-
def
|
|
560
|
+
def do_quit_all(self) -> None:
|
|
544
561
|
"""Close all tabs and quit the app.
|
|
545
562
|
|
|
546
563
|
Checks if any tabs have unsaved changes. If yes, opens a confirmation dialog.
|
|
@@ -134,8 +134,10 @@ class TableScreen(ModalScreen):
|
|
|
134
134
|
else:
|
|
135
135
|
self.dftable.view_rows((expr, cidx, False, True))
|
|
136
136
|
|
|
137
|
-
# Dismiss
|
|
138
|
-
self.app.
|
|
137
|
+
# Dismiss modal screen(s) to return to main table
|
|
138
|
+
while len(self.app._screen_stack) > 1:
|
|
139
|
+
self.app.pop_screen()
|
|
140
|
+
break
|
|
139
141
|
|
|
140
142
|
def show_frequency(self, cidx_name_value: tuple[int, str, Any] | None) -> None:
|
|
141
143
|
"""Show frequency by the selected value.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dataframe-textual
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.11.0
|
|
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
|
|
@@ -247,8 +247,8 @@ zcat compressed_data.csv.gz | dv -f csv
|
|
|
247
247
|
| `<` | Move to previous tab |
|
|
248
248
|
| `b` | Cycle through tabs |
|
|
249
249
|
| `B` | Toggle tab bar visibility |
|
|
250
|
-
| `q` |
|
|
251
|
-
| `Q` |
|
|
250
|
+
| `q` | Quit current tab (prompts to save unsaved changes) |
|
|
251
|
+
| `Q` | Quit all tabs and app (prompts to save unsaved changes) |
|
|
252
252
|
| `Ctrl+Q` | Force to quit app (regardless of unsaved changes) |
|
|
253
253
|
| `Ctrl+T` | Save current tab to file |
|
|
254
254
|
| `Ctrl+S` | Save all tabs to file |
|
|
@@ -308,7 +308,7 @@ zcat compressed_data.csv.gz | dv -f csv
|
|
|
308
308
|
| `,` | Toggle thousand separator for numeric display |
|
|
309
309
|
| `&` | Set current row as the new header row |
|
|
310
310
|
| `h` | Hide current column |
|
|
311
|
-
| `H` | Show all hidden
|
|
311
|
+
| `H` | Show all hidden columns |
|
|
312
312
|
|
|
313
313
|
#### Editing
|
|
314
314
|
|
|
@@ -499,7 +499,7 @@ Both operations show selected rows but with fundamentally different effects:
|
|
|
499
499
|
**When to use View** (`v` or `V`):
|
|
500
500
|
- Exploring or analyzing data safely
|
|
501
501
|
- Switching between different perspectives
|
|
502
|
-
- Press `
|
|
502
|
+
- Press `q` to return to main table
|
|
503
503
|
|
|
504
504
|
**When to use Filter** (`"`):
|
|
505
505
|
- Cleaning data (removing unwanted rows)
|
|
@@ -678,7 +678,7 @@ This is useful for:
|
|
|
678
678
|
|
|
679
679
|
**Hide/Show Columns** (`h` / `H`):
|
|
680
680
|
- `h` - Temporarily hide current column (data preserved)
|
|
681
|
-
- `H` - Restore all hidden columns
|
|
681
|
+
- `H` - Restore all hidden columns
|
|
682
682
|
|
|
683
683
|
### 12. Column & Row Reordering
|
|
684
684
|
|
|
@@ -2,13 +2,13 @@ dataframe_textual/__init__.py,sha256=E53fW1spQRA4jW9grxSqPEmoe9zofzr6twdveMbt_W8
|
|
|
2
2
|
dataframe_textual/__main__.py,sha256=tJ6FjjV25ZQzaMdqD5XcDVRZfj8l6kgGvXyrn975rjo,3999
|
|
3
3
|
dataframe_textual/common.py,sha256=CNRdHP3N1li2dy9OsTiW-zfpzf8zcrt2fW8mmYY-YVA,29073
|
|
4
4
|
dataframe_textual/data_frame_help_panel.py,sha256=UEtj64XsVRdtLzuwOaITfoEQUkAfwFuvpr5Npip5WHs,3381
|
|
5
|
-
dataframe_textual/data_frame_table.py,sha256=
|
|
6
|
-
dataframe_textual/data_frame_viewer.py,sha256=
|
|
5
|
+
dataframe_textual/data_frame_table.py,sha256=Vi02ombWWUV8lehj6vTNWakXpkRWWPJU4eUl6aCiG2o,148263
|
|
6
|
+
dataframe_textual/data_frame_viewer.py,sha256=L1QEKS2L6g6ZtwXMznl1C632Ttqca-tXbo-glopHCRU,29352
|
|
7
7
|
dataframe_textual/sql_screen.py,sha256=P3j1Fv45NIKEYo9adb7NPod54FaU-djFIvCUMMHbvjY,7534
|
|
8
|
-
dataframe_textual/table_screen.py,sha256=
|
|
8
|
+
dataframe_textual/table_screen.py,sha256=kk5dpVu-ExkMh7BunQdCNvHC1RmLl6nHLHHulWucloY,22046
|
|
9
9
|
dataframe_textual/yes_no_screen.py,sha256=LC42DeJRIWb-PdpR3FDNvwxhnfZ6OXfU9Kxiu340BNE,26132
|
|
10
|
-
dataframe_textual-2.
|
|
11
|
-
dataframe_textual-2.
|
|
12
|
-
dataframe_textual-2.
|
|
13
|
-
dataframe_textual-2.
|
|
14
|
-
dataframe_textual-2.
|
|
10
|
+
dataframe_textual-2.11.0.dist-info/METADATA,sha256=QaKrM5-fDhJcYnyQpS1m_7lTRmeHqKpXRYdyIag4dpI,29789
|
|
11
|
+
dataframe_textual-2.11.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
12
|
+
dataframe_textual-2.11.0.dist-info/entry_points.txt,sha256=R_GoooOxcq6ab4RaHiVoZ4zrZJ-phMcGmlL2rwqncW8,107
|
|
13
|
+
dataframe_textual-2.11.0.dist-info/licenses/LICENSE,sha256=AVTg0gk1X-LHI-nnHlAMDQetrwuDZK4eypgSMDO46Yc,1069
|
|
14
|
+
dataframe_textual-2.11.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|