dataframe-textual 2.11.0__py3-none-any.whl → 2.12.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/__main__.py +19 -1
- dataframe_textual/data_frame_viewer.py +3 -1
- {dataframe_textual-2.11.0.dist-info → dataframe_textual-2.12.0.dist-info}/METADATA +6 -2
- {dataframe_textual-2.11.0.dist-info → dataframe_textual-2.12.0.dist-info}/RECORD +7 -7
- {dataframe_textual-2.11.0.dist-info → dataframe_textual-2.12.0.dist-info}/WHEEL +0 -0
- {dataframe_textual-2.11.0.dist-info → dataframe_textual-2.12.0.dist-info}/entry_points.txt +0 -0
- {dataframe_textual-2.11.0.dist-info → dataframe_textual-2.12.0.dist-info}/licenses/LICENSE +0 -0
dataframe_textual/__main__.py
CHANGED
|
@@ -4,6 +4,8 @@ import argparse
|
|
|
4
4
|
import sys
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
|
+
from textual.theme import BUILTIN_THEMES
|
|
8
|
+
|
|
7
9
|
from . import __version__
|
|
8
10
|
from .common import SUPPORTED_FORMATS, load_dataframe
|
|
9
11
|
from .data_frame_viewer import DataFrameViewer
|
|
@@ -81,7 +83,23 @@ def cli() -> argparse.Namespace:
|
|
|
81
83
|
parser.add_argument("-N", "--n-rows", metavar="N", type=int, help="Stop after reading N rows from CSV/TSV")
|
|
82
84
|
parser.add_argument("-n", "--null", nargs="+", help="Values to interpret as null values when reading CSV/TSV")
|
|
83
85
|
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
"--theme",
|
|
88
|
+
nargs="?",
|
|
89
|
+
const="list",
|
|
90
|
+
help="Set the theme for the application (use 'list' to see available themes)",
|
|
91
|
+
)
|
|
92
|
+
|
|
84
93
|
args = parser.parse_args()
|
|
94
|
+
|
|
95
|
+
# List available themes and exit
|
|
96
|
+
if args.theme == "list":
|
|
97
|
+
print("Available themes:")
|
|
98
|
+
for theme in BUILTIN_THEMES:
|
|
99
|
+
print(f" - {theme}")
|
|
100
|
+
sys.exit(0)
|
|
101
|
+
|
|
102
|
+
# Handle files
|
|
85
103
|
if args.files is None:
|
|
86
104
|
args.files = []
|
|
87
105
|
|
|
@@ -119,7 +137,7 @@ def main() -> None:
|
|
|
119
137
|
truncate_ragged_lines=args.truncate_ragged_lines,
|
|
120
138
|
n_rows=args.n_rows,
|
|
121
139
|
)
|
|
122
|
-
app = DataFrameViewer(*sources)
|
|
140
|
+
app = DataFrameViewer(*sources, theme=args.theme)
|
|
123
141
|
app.run()
|
|
124
142
|
|
|
125
143
|
|
|
@@ -88,7 +88,7 @@ class DataFrameViewer(App):
|
|
|
88
88
|
}
|
|
89
89
|
"""
|
|
90
90
|
|
|
91
|
-
def __init__(self, *sources: Source) -> None:
|
|
91
|
+
def __init__(self, *sources: Source, theme: str | None = None) -> None:
|
|
92
92
|
"""Initialize the DataFrame Viewer application.
|
|
93
93
|
|
|
94
94
|
Loads data from provided sources and prepares the tabbed interface.
|
|
@@ -96,9 +96,11 @@ class DataFrameViewer(App):
|
|
|
96
96
|
Args:
|
|
97
97
|
sources: sources to load dataframes from, each as a tuple of
|
|
98
98
|
(DataFrame, filename, tabname).
|
|
99
|
+
theme: Optional; The theme to use for the application.
|
|
99
100
|
"""
|
|
100
101
|
super().__init__()
|
|
101
102
|
self.sources = sources
|
|
103
|
+
self.theme = theme
|
|
102
104
|
self.tabs: dict[TabPane, DataFrameTable] = {}
|
|
103
105
|
self.help_panel = None
|
|
104
106
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dataframe-textual
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.12.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
|
|
@@ -195,6 +195,7 @@ options:
|
|
|
195
195
|
-N, --n-rows N Stop after reading N rows from CSV/TSV
|
|
196
196
|
-n, --null NULL [NULL ...]
|
|
197
197
|
Values to interpret as null values when reading CSV/TSV
|
|
198
|
+
--theme [THEME] Set the theme for the application (use 'list' to see available themes)
|
|
198
199
|
```
|
|
199
200
|
|
|
200
201
|
### CLI Examples
|
|
@@ -233,6 +234,9 @@ dv -l 3 -a 1 -I messy_scientific_data.csv
|
|
|
233
234
|
# Process compressed data
|
|
234
235
|
dv data.csv.gz
|
|
235
236
|
zcat compressed_data.csv.gz | dv -f csv
|
|
237
|
+
|
|
238
|
+
# Choose the `monokai` theme
|
|
239
|
+
dv --theme monokai data.csv
|
|
236
240
|
```
|
|
237
241
|
|
|
238
242
|
## Keyboard Shortcuts
|
|
@@ -306,7 +310,7 @@ zcat compressed_data.csv.gz | dv -f csv
|
|
|
306
310
|
| `_` (underscore) | Toggle column full width |
|
|
307
311
|
| `z` | Freeze rows and columns |
|
|
308
312
|
| `,` | Toggle thousand separator for numeric display |
|
|
309
|
-
| `&` | Set current row as the new header row |
|
|
313
|
+
| `&` | Set current row as the new header row |
|
|
310
314
|
| `h` | Hide current column |
|
|
311
315
|
| `H` | Show all hidden columns |
|
|
312
316
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
dataframe_textual/__init__.py,sha256=E53fW1spQRA4jW9grxSqPEmoe9zofzr6twdveMbt_W8,1310
|
|
2
|
-
dataframe_textual/__main__.py,sha256=
|
|
2
|
+
dataframe_textual/__main__.py,sha256=OXnvZkLEK5SPMJWtchQRyXwHFofgvdvZp7M9XjzN3AQ,4451
|
|
3
3
|
dataframe_textual/common.py,sha256=CNRdHP3N1li2dy9OsTiW-zfpzf8zcrt2fW8mmYY-YVA,29073
|
|
4
4
|
dataframe_textual/data_frame_help_panel.py,sha256=UEtj64XsVRdtLzuwOaITfoEQUkAfwFuvpr5Npip5WHs,3381
|
|
5
5
|
dataframe_textual/data_frame_table.py,sha256=Vi02ombWWUV8lehj6vTNWakXpkRWWPJU4eUl6aCiG2o,148263
|
|
6
|
-
dataframe_textual/data_frame_viewer.py,sha256=
|
|
6
|
+
dataframe_textual/data_frame_viewer.py,sha256=1NvP6Jf5Pcw-yT7jUzOMJzQlmEiufQ0LZQwwcoqBC3Q,29472
|
|
7
7
|
dataframe_textual/sql_screen.py,sha256=P3j1Fv45NIKEYo9adb7NPod54FaU-djFIvCUMMHbvjY,7534
|
|
8
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.12.0.dist-info/METADATA,sha256=96eysYGwTTebGPrzIiQ9Fijyb9FkeSq8QfFAKUQ8XG0,29941
|
|
11
|
+
dataframe_textual-2.12.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
12
|
+
dataframe_textual-2.12.0.dist-info/entry_points.txt,sha256=R_GoooOxcq6ab4RaHiVoZ4zrZJ-phMcGmlL2rwqncW8,107
|
|
13
|
+
dataframe_textual-2.12.0.dist-info/licenses/LICENSE,sha256=AVTg0gk1X-LHI-nnHlAMDQetrwuDZK4eypgSMDO46Yc,1069
|
|
14
|
+
dataframe_textual-2.12.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|