dataframe-textual 2.40.1__tar.gz → 2.41.0__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.40.1 → dataframe_textual-2.41.0}/PKG-INFO +24 -21
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/README.md +23 -20
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/pyproject.toml +9 -1
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/data_frame_table.py +3 -3
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/table_screen.py +30 -13
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/uv.lock +1 -1
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/.gitignore +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/LICENSE +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/main.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/__init__.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/__main__.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/common.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/data_frame_help_panel.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/data_frame_viewer.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/file_picker_screen.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/loading_screen.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/theme_screen.py +0 -0
- {dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/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.
|
|
3
|
+
Version: 2.41.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
|
|
@@ -309,25 +309,25 @@ dv data.csv -o data.parquet
|
|
|
309
309
|
|
|
310
310
|
#### Display
|
|
311
311
|
|
|
312
|
-
| Key | Action
|
|
313
|
-
| ---------------- |
|
|
314
|
-
| `Enter` | Show details for the current row
|
|
315
|
-
| `Tab` | Show details
|
|
316
|
-
| `F` | Show frequency distribution for current column
|
|
317
|
-
| `i` | Show histogram for current column
|
|
318
|
-
| `I` | Show histogram for current column with custom bins
|
|
319
|
-
| `s` | Show statistics for current column
|
|
320
|
-
| `S` | Show statistics for entire dataframe
|
|
321
|
-
| `m` | Show metadata for row count and column count
|
|
322
|
-
| `M` | Show metadata for current column
|
|
323
|
-
| `K` | Cycle cursor types: cell → row → column → cell
|
|
324
|
-
| `~` | Toggle row labels
|
|
325
|
-
| `_` (underscore) | Toggle column full width
|
|
326
|
-
| `f` | Toggle freeze rows and/or columns
|
|
327
|
-
| `,` | Toggle thousand separator for numeric display
|
|
328
|
-
| `&` | Set current row as the new header row
|
|
329
|
-
| `h` | Hide current column
|
|
330
|
-
| `H` | Show all hidden columns
|
|
312
|
+
| Key | Action |
|
|
313
|
+
| ---------------- | ------------------------------------------------------------------ |
|
|
314
|
+
| `Enter` | Show details for the current row |
|
|
315
|
+
| `Tab` | Show current cell details; press `Tab` again there to drill deeper |
|
|
316
|
+
| `F` | Show frequency distribution for current column |
|
|
317
|
+
| `i` | Show histogram for current column |
|
|
318
|
+
| `I` | Show histogram for current column with custom bins |
|
|
319
|
+
| `s` | Show statistics for current column |
|
|
320
|
+
| `S` | Show statistics for entire dataframe |
|
|
321
|
+
| `m` | Show metadata for row count and column count |
|
|
322
|
+
| `M` | Show metadata for current column |
|
|
323
|
+
| `K` | Cycle cursor types: cell → row → column → cell |
|
|
324
|
+
| `~` | Toggle row labels |
|
|
325
|
+
| `_` (underscore) | Toggle column full width |
|
|
326
|
+
| `f` | Toggle freeze rows and/or columns |
|
|
327
|
+
| `,` | Toggle thousand separator for numeric display |
|
|
328
|
+
| `&` | Set current row as the new header row |
|
|
329
|
+
| `h` | Hide current column |
|
|
330
|
+
| `H` | Show all hidden columns |
|
|
331
331
|
|
|
332
332
|
#### Editing
|
|
333
333
|
|
|
@@ -456,9 +456,12 @@ Press `Tab` in the main table to inspect the current cell in its own modal.
|
|
|
456
456
|
|
|
457
457
|
You can also press `Tab` from the row-detail modal to drill into the selected field.
|
|
458
458
|
|
|
459
|
+
Inside the cell-detail modal, press `Tab` again on the selected row/column to keep drilling into nested values.
|
|
460
|
+
|
|
459
461
|
- Scalar values are shown directly
|
|
460
462
|
- String values are split into multiple rows using `|` by default
|
|
461
|
-
-
|
|
463
|
+
- List-like values are expanded into a one-column table
|
|
464
|
+
- Dict-like values are shown as key/value columns
|
|
462
465
|
- Press `q` or `Escape` to close the modal
|
|
463
466
|
|
|
464
467
|
### 4. Row Selection
|
|
@@ -270,25 +270,25 @@ dv data.csv -o data.parquet
|
|
|
270
270
|
|
|
271
271
|
#### Display
|
|
272
272
|
|
|
273
|
-
| Key | Action
|
|
274
|
-
| ---------------- |
|
|
275
|
-
| `Enter` | Show details for the current row
|
|
276
|
-
| `Tab` | Show details
|
|
277
|
-
| `F` | Show frequency distribution for current column
|
|
278
|
-
| `i` | Show histogram for current column
|
|
279
|
-
| `I` | Show histogram for current column with custom bins
|
|
280
|
-
| `s` | Show statistics for current column
|
|
281
|
-
| `S` | Show statistics for entire dataframe
|
|
282
|
-
| `m` | Show metadata for row count and column count
|
|
283
|
-
| `M` | Show metadata for current column
|
|
284
|
-
| `K` | Cycle cursor types: cell → row → column → cell
|
|
285
|
-
| `~` | Toggle row labels
|
|
286
|
-
| `_` (underscore) | Toggle column full width
|
|
287
|
-
| `f` | Toggle freeze rows and/or columns
|
|
288
|
-
| `,` | Toggle thousand separator for numeric display
|
|
289
|
-
| `&` | Set current row as the new header row
|
|
290
|
-
| `h` | Hide current column
|
|
291
|
-
| `H` | Show all hidden columns
|
|
273
|
+
| Key | Action |
|
|
274
|
+
| ---------------- | ------------------------------------------------------------------ |
|
|
275
|
+
| `Enter` | Show details for the current row |
|
|
276
|
+
| `Tab` | Show current cell details; press `Tab` again there to drill deeper |
|
|
277
|
+
| `F` | Show frequency distribution for current column |
|
|
278
|
+
| `i` | Show histogram for current column |
|
|
279
|
+
| `I` | Show histogram for current column with custom bins |
|
|
280
|
+
| `s` | Show statistics for current column |
|
|
281
|
+
| `S` | Show statistics for entire dataframe |
|
|
282
|
+
| `m` | Show metadata for row count and column count |
|
|
283
|
+
| `M` | Show metadata for current column |
|
|
284
|
+
| `K` | Cycle cursor types: cell → row → column → cell |
|
|
285
|
+
| `~` | Toggle row labels |
|
|
286
|
+
| `_` (underscore) | Toggle column full width |
|
|
287
|
+
| `f` | Toggle freeze rows and/or columns |
|
|
288
|
+
| `,` | Toggle thousand separator for numeric display |
|
|
289
|
+
| `&` | Set current row as the new header row |
|
|
290
|
+
| `h` | Hide current column |
|
|
291
|
+
| `H` | Show all hidden columns |
|
|
292
292
|
|
|
293
293
|
#### Editing
|
|
294
294
|
|
|
@@ -417,9 +417,12 @@ Press `Tab` in the main table to inspect the current cell in its own modal.
|
|
|
417
417
|
|
|
418
418
|
You can also press `Tab` from the row-detail modal to drill into the selected field.
|
|
419
419
|
|
|
420
|
+
Inside the cell-detail modal, press `Tab` again on the selected row/column to keep drilling into nested values.
|
|
421
|
+
|
|
420
422
|
- Scalar values are shown directly
|
|
421
423
|
- String values are split into multiple rows using `|` by default
|
|
422
|
-
-
|
|
424
|
+
- List-like values are expanded into a one-column table
|
|
425
|
+
- Dict-like values are shown as key/value columns
|
|
423
426
|
- Press `q` or `Escape` to close the modal
|
|
424
427
|
|
|
425
428
|
### 4. Row Selection
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dataframe-textual"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.41.0"
|
|
8
8
|
description = "Interactive terminal viewer/editor for tabular data"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -53,6 +53,14 @@ dev = [
|
|
|
53
53
|
|
|
54
54
|
[tool.hatch.build.targets.wheel]
|
|
55
55
|
packages = ["src/dataframe_textual"]
|
|
56
|
+
include = [
|
|
57
|
+
"main.py",
|
|
58
|
+
"src/*",
|
|
59
|
+
"LICENSE",
|
|
60
|
+
"README.md",
|
|
61
|
+
"pyproject.toml",
|
|
62
|
+
"uv.lock",
|
|
63
|
+
]
|
|
56
64
|
exclude = [
|
|
57
65
|
"*.png",
|
|
58
66
|
"*.gz",
|
{dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/data_frame_table.py
RENAMED
|
@@ -207,7 +207,7 @@ class DataFrameTable(DataTable):
|
|
|
207
207
|
|
|
208
208
|
## 👁️ Display
|
|
209
209
|
- **Enter** - 📋 Show row details in modal
|
|
210
|
-
- **Tab** - 🔍 Show current cell details in modal
|
|
210
|
+
- **Tab** - 🔍 Show current cell details in modal; use `Tab` again there to drill deeper
|
|
211
211
|
- **F** - 📊 Show frequency distribution for current column
|
|
212
212
|
- **i** - 📊 Show histogram for current column
|
|
213
213
|
- **I** - 📊 Show histogram for current column with custom bins
|
|
@@ -1870,7 +1870,7 @@ class DataFrameTable(DataTable):
|
|
|
1870
1870
|
cidx = self.cursor_cidx
|
|
1871
1871
|
|
|
1872
1872
|
# Push the modal screen
|
|
1873
|
-
self.app.push_screen(CellDetailScreen(self, ridx, cidx))
|
|
1873
|
+
self.app.push_screen(CellDetailScreen(self.df, ridx, cidx))
|
|
1874
1874
|
|
|
1875
1875
|
def do_show_frequency(self, cidx: int | None = None) -> None:
|
|
1876
1876
|
"""Show frequency distribution for a given columnn."""
|
|
@@ -2959,7 +2959,7 @@ class DataFrameTable(DataTable):
|
|
|
2959
2959
|
|
|
2960
2960
|
def do_uniq_rows(self) -> None:
|
|
2961
2961
|
"""Remove duplicate rows from the current dataframe, keeping the first occurrence."""
|
|
2962
|
-
subset = [col for col in self.df.columns if col != RID]
|
|
2962
|
+
subset = [col for col in self.df.columns if col != RID and col not in self.hidden_columns]
|
|
2963
2963
|
|
|
2964
2964
|
if not subset:
|
|
2965
2965
|
return
|
|
@@ -43,14 +43,14 @@ class TableScreen(ModalScreen):
|
|
|
43
43
|
}
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
|
-
def __init__(self, dftable: "DataFrameTable") -> None:
|
|
46
|
+
def __init__(self, dftable: "DataFrameTable | None") -> None:
|
|
47
47
|
"""Initialize the table screen.
|
|
48
48
|
|
|
49
49
|
Sets up the base modal screen with reference to the main DataFrameTable widget
|
|
50
50
|
and stores the DataFrame for display.
|
|
51
51
|
|
|
52
52
|
Args:
|
|
53
|
-
dftable: Reference to the parent DataFrameTable widget.
|
|
53
|
+
dftable: Reference to the parent DataFrameTable widget, if applicable.
|
|
54
54
|
"""
|
|
55
55
|
super().__init__()
|
|
56
56
|
self.dftable = dftable # DataFrameTable
|
|
@@ -302,7 +302,7 @@ class RowDetailScreen(TableScreen):
|
|
|
302
302
|
self.show_statistics(self.get_cidx_name_value())
|
|
303
303
|
event.stop()
|
|
304
304
|
elif event.key == "tab":
|
|
305
|
-
self.app.push_screen(CellDetailScreen(self.dftable, self.ridx, self.table.cursor_row))
|
|
305
|
+
self.app.push_screen(CellDetailScreen(self.dftable.df, self.ridx, self.table.cursor_row))
|
|
306
306
|
event.stop()
|
|
307
307
|
|
|
308
308
|
def get_cidx_name_value(self) -> tuple[int, str, Any] | None:
|
|
@@ -821,8 +821,9 @@ class MetaColumnScreen(TableScreen):
|
|
|
821
821
|
class CellDetailScreen(TableScreen):
|
|
822
822
|
"""Modal screen to display details of a cell value, including support for nested structures like lists and dicts."""
|
|
823
823
|
|
|
824
|
-
def __init__(self,
|
|
825
|
-
super().__init__(
|
|
824
|
+
def __init__(self, dfsrc: pl.DataFrame, ridx: int, cidx: int, delimiter: str | None = "|") -> None:
|
|
825
|
+
super().__init__(None)
|
|
826
|
+
self.dfsrc = dfsrc
|
|
826
827
|
self.cidx = cidx
|
|
827
828
|
self.ridx = ridx
|
|
828
829
|
self.delimiter = delimiter
|
|
@@ -834,18 +835,21 @@ class CellDetailScreen(TableScreen):
|
|
|
834
835
|
def build_table(self) -> None:
|
|
835
836
|
"""Build the list table."""
|
|
836
837
|
# Get the column values as a list
|
|
837
|
-
col_name = self.
|
|
838
|
-
dtype = self.
|
|
839
|
-
cell_value = self.
|
|
838
|
+
col_name = self.dfsrc.columns[self.cidx]
|
|
839
|
+
dtype = self.dfsrc.dtypes[self.cidx]
|
|
840
|
+
cell_value = self.dfsrc.item(self.ridx, self.cidx)
|
|
840
841
|
|
|
841
842
|
if isinstance(cell_value, pl.Series) and not cell_value.is_empty():
|
|
842
843
|
self.df = pl.DataFrame({col_name: cell_value})
|
|
843
844
|
df2table(self.df, table=self.table)
|
|
844
845
|
elif isinstance(cell_value, dict) and cell_value:
|
|
845
|
-
self.
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
846
|
+
self.df = pl.DataFrame(
|
|
847
|
+
{
|
|
848
|
+
f"{col_name} (Key)": pl.Series(cell_value.keys(), strict=False),
|
|
849
|
+
f"{col_name} (Value)": pl.Series(cell_value.values(), strict=False),
|
|
850
|
+
}
|
|
851
|
+
)
|
|
852
|
+
df2table(self.df, table=self.table)
|
|
849
853
|
elif dtype == pl.String and cell_value:
|
|
850
854
|
self.df = pl.DataFrame({col_name: cell_value.split(self.delimiter)})
|
|
851
855
|
df2table(self.df, table=self.table)
|
|
@@ -853,4 +857,17 @@ class CellDetailScreen(TableScreen):
|
|
|
853
857
|
self.df = pl.DataFrame({col_name: [cell_value]})
|
|
854
858
|
df2table(self.df, table=self.table)
|
|
855
859
|
|
|
856
|
-
|
|
860
|
+
def on_key(self, event) -> None:
|
|
861
|
+
"""Handle key press events on the column metadata screen.
|
|
862
|
+
|
|
863
|
+
Supports keys:
|
|
864
|
+
- 'tab': Show cell details for the selected value.
|
|
865
|
+
|
|
866
|
+
Args:
|
|
867
|
+
event: The key event object.
|
|
868
|
+
"""
|
|
869
|
+
if event.key == "tab":
|
|
870
|
+
cidx = self.table.cursor_column
|
|
871
|
+
ridx = self.table.cursor_row
|
|
872
|
+
self.app.push_screen(CellDetailScreen(self.df, ridx, cidx))
|
|
873
|
+
event.stop()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/data_frame_help_panel.py
RENAMED
|
File without changes
|
{dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/data_frame_viewer.py
RENAMED
|
File without changes
|
{dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/file_picker_screen.py
RENAMED
|
File without changes
|
{dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/loading_screen.py
RENAMED
|
File without changes
|
|
File without changes
|
{dataframe_textual-2.40.1 → dataframe_textual-2.41.0}/src/dataframe_textual/yes_no_screen.py
RENAMED
|
File without changes
|