dataframe-textual 1.4.0__tar.gz → 1.9.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-1.4.0 → dataframe_textual-1.9.0}/PKG-INFO +141 -185
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/README.md +140 -184
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/pyproject.toml +1 -1
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/__main__.py +10 -4
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/common.py +201 -163
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/data_frame_table.py +1037 -881
- dataframe_textual-1.9.0/src/dataframe_textual/data_frame_viewer.py +587 -0
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/sql_screen.py +50 -11
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/table_screen.py +1 -1
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/yes_no_screen.py +89 -8
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/uv.lock +1 -1
- dataframe_textual-1.4.0/src/dataframe_textual/data_frame_viewer.py +0 -370
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/.gitignore +0 -0
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/LICENSE +0 -0
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/main.py +0 -0
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/__init__.py +0 -0
- {dataframe_textual-1.4.0 → dataframe_textual-1.9.0}/src/dataframe_textual/data_frame_help_panel.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dataframe-textual
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.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
|
|
@@ -48,7 +48,7 @@ A powerful, interactive terminal-based viewer/editor for CSV/TSV/Excel/Parquet/J
|
|
|
48
48
|
### Data Viewing
|
|
49
49
|
- 🚀 **Fast Loading** - Powered by Polars for efficient data handling
|
|
50
50
|
- 🎨 **Rich Terminal UI** - Beautiful, color-coded columns with various data types (e.g., integer, float, string)
|
|
51
|
-
- ⌨️ **Comprehensive Keyboard Navigation** - Intuitive controls
|
|
51
|
+
- ⌨️ **Comprehensive Keyboard Navigation** - Intuitive controls
|
|
52
52
|
- 📊 **Flexible Input** - Read from files and/or stdin (pipes/redirects)
|
|
53
53
|
- 🔄 **Smart Pagination** - Lazy load rows on demand for handling large datasets
|
|
54
54
|
|
|
@@ -62,8 +62,10 @@ A powerful, interactive terminal-based viewer/editor for CSV/TSV/Excel/Parquet/J
|
|
|
62
62
|
### Advanced Features
|
|
63
63
|
- 📂 **Multi-File Support** - Open multiple files in separate tabs
|
|
64
64
|
- 🔄 **Tab Management** - Seamlessly switch between open files with keyboard shortcuts
|
|
65
|
-
-
|
|
65
|
+
- � **Duplicate Tab** - Create a copy of the current tab with the same data
|
|
66
|
+
- �📌 **Freeze Rows/Columns** - Keep important rows and columns visible while scrolling
|
|
66
67
|
- 🎯 **Cursor Type Cycling** - Switch between cell, row, and column selection modes
|
|
68
|
+
- 🔗 **Link Column Creation** - Generate clickable URLs using template expressions with placeholder support
|
|
67
69
|
|
|
68
70
|
## Installation
|
|
69
71
|
|
|
@@ -126,16 +128,15 @@ python main.py pokemon.csv
|
|
|
126
128
|
# Or with uv
|
|
127
129
|
uv run python main.py pokemon.csv
|
|
128
130
|
|
|
129
|
-
# Read from stdin (
|
|
131
|
+
# Read from stdin (defaults to TSV)
|
|
130
132
|
cat data.tsv | dv
|
|
131
133
|
dv < data.tsv
|
|
132
134
|
|
|
133
|
-
# Gzipped files are supported
|
|
134
|
-
dv data.csv.gz
|
|
135
|
-
dv large_dataset.tsv.gz
|
|
136
|
-
|
|
137
135
|
# Specify format for gzipped stdin
|
|
138
136
|
zcat data.csv.gz | dv -f csv
|
|
137
|
+
|
|
138
|
+
# Gzipped files are supported
|
|
139
|
+
dv data.csv.gz
|
|
139
140
|
```
|
|
140
141
|
|
|
141
142
|
### Multi-File Usage - Multiple Tabs
|
|
@@ -147,24 +148,22 @@ dv file1.csv file2.csv file3.csv
|
|
|
147
148
|
# Open multiple sheets in tabs in an Excel file
|
|
148
149
|
dv file.xlsx
|
|
149
150
|
|
|
150
|
-
# Mix files and stdin
|
|
151
|
+
# Mix files and stdin
|
|
151
152
|
dv data1.tsv < data2.tsv
|
|
152
|
-
|
|
153
|
-
# Mix regular and gzipped files
|
|
154
|
-
dv data1.csv data2.csv.gz data3.tsv.gz
|
|
155
153
|
```
|
|
156
154
|
|
|
157
155
|
When multiple files are opened:
|
|
158
|
-
- Each file appears as a separate tab
|
|
159
|
-
- Switch between tabs using `>` (next) or `<` (previous)
|
|
156
|
+
- Each file appears as a separate tab
|
|
157
|
+
- Switch between tabs using `>` (next) or `<` (previous), or use `b` for cycling tabs
|
|
158
|
+
- Save current tab or all tabs with `Ctrl+S`
|
|
159
|
+
- Duplicate the current tab with `Ctrl+D`
|
|
160
160
|
- Open additional files with `Ctrl+O`
|
|
161
|
-
- Close the current tab with `Ctrl+W`
|
|
162
161
|
- Each file maintains its own state (edits, sort order, selections, history, etc.)
|
|
163
162
|
|
|
164
163
|
## Command Line Options
|
|
165
164
|
|
|
166
165
|
```
|
|
167
|
-
usage: dv [-h] [-f {csv,excel,tsv,parquet,json,ndjson}] [-H] [-I] [-
|
|
166
|
+
usage: dv [-h] [-f {csv,excel,tsv,parquet,json,ndjson}] [-H] [-I] [-E] [-c COMMENT_PREFIX] [-q QUOTE_CHAR] [-l SKIP_LINES] [-a SKIP_ROWS_AFTER_HEADER] [-n NULL [NULL ...]] [files ...]
|
|
168
167
|
|
|
169
168
|
Interactive terminal based viewer/editor for tabular data (e.g., CSV/Excel).
|
|
170
169
|
|
|
@@ -177,49 +176,55 @@ options:
|
|
|
177
176
|
Specify the format of the input files
|
|
178
177
|
-H, --no-header Specify that input files have no header row
|
|
179
178
|
-I, --no-inferrence Do not infer data types when reading CSV/TSV
|
|
180
|
-
-
|
|
179
|
+
-E, --ignore-errors Ignore errors when reading CSV/TSV
|
|
180
|
+
-c, --comment-prefix COMMENT_PREFIX
|
|
181
|
+
Comment lines are skipped when reading CSV/TSV (default: skip none)
|
|
182
|
+
-q, --quote-char QUOTE_CHAR
|
|
183
|
+
Quote character for reading CSV/TSV (default: "; use None to disable)
|
|
184
|
+
-l, --skip-lines SKIP_LINES
|
|
181
185
|
Skip lines when reading CSV/TSV (default: 0)
|
|
182
|
-
-
|
|
186
|
+
-a, --skip-rows-after-header SKIP_ROWS_AFTER_HEADER
|
|
183
187
|
Skip rows after header when reading CSV/TSV (default: 0)
|
|
184
|
-
-
|
|
188
|
+
-n, --null NULL [NULL ...]
|
|
185
189
|
Values to interpret as null values when reading CSV/TSV
|
|
186
190
|
```
|
|
187
191
|
|
|
188
192
|
### CLI Examples
|
|
189
193
|
|
|
190
194
|
```bash
|
|
191
|
-
# View CSV file
|
|
195
|
+
# View headless CSV file
|
|
192
196
|
dv -H data_no_header.csv
|
|
193
197
|
|
|
194
198
|
# Disable type inference for faster loading
|
|
195
199
|
dv -I large_data.csv
|
|
196
200
|
|
|
197
|
-
#
|
|
198
|
-
dv -
|
|
201
|
+
# Ignore parsing errors in malformed CSV
|
|
202
|
+
dv -E data_with_errors.csv
|
|
199
203
|
|
|
200
|
-
# Skip
|
|
201
|
-
dv -
|
|
204
|
+
# Skip first 3 lines of file (e.g., metadata)
|
|
205
|
+
dv -l 3 data_with_meta.csv
|
|
202
206
|
|
|
203
|
-
#
|
|
204
|
-
dv -
|
|
207
|
+
# Skip 1 row after header (e.g., units row)
|
|
208
|
+
dv -a 1 data_with_units.csv
|
|
205
209
|
|
|
206
|
-
#
|
|
207
|
-
dv -
|
|
210
|
+
# CSV with comment lines
|
|
211
|
+
dv -c "#" commented_data.csv
|
|
208
212
|
|
|
209
|
-
#
|
|
210
|
-
dv -
|
|
213
|
+
# Treat specific values as null/missing (e.g., 'NA', 'N/A', '-')
|
|
214
|
+
dv -n NA N/A - data.csv
|
|
211
215
|
|
|
212
|
-
#
|
|
213
|
-
dv -
|
|
216
|
+
# Use different quote character (e.g., single quote for CSV)
|
|
217
|
+
dv -q "'" data.csv
|
|
214
218
|
|
|
215
|
-
#
|
|
216
|
-
|
|
219
|
+
# Disable quote character processing for TSV with embedded quotes
|
|
220
|
+
dv -q data.tsv
|
|
217
221
|
|
|
218
|
-
# CSV with
|
|
219
|
-
dv -
|
|
222
|
+
# Complex CSV with comments and units row
|
|
223
|
+
dv -l 3 -a 1 -I messy_scientific_data.csv
|
|
220
224
|
|
|
221
|
-
#
|
|
222
|
-
dv
|
|
225
|
+
# Process compressed data
|
|
226
|
+
dv data.csv.gz
|
|
227
|
+
zcat compressed_data.csv.gz | dv -f csv
|
|
223
228
|
```
|
|
224
229
|
|
|
225
230
|
## Keyboard Shortcuts
|
|
@@ -230,13 +235,17 @@ dv -L 5 -U NA "" data_with_metadata.csv
|
|
|
230
235
|
|
|
231
236
|
| Key | Action |
|
|
232
237
|
|-----|--------|
|
|
233
|
-
|
|
|
234
|
-
| `Ctrl+W` | Close current tab |
|
|
235
|
-
| `Ctrl+A` | Save all open tabs to Excel file |
|
|
236
|
-
| `>` or `b` | Move to next tab |
|
|
238
|
+
| `>` | Move to next tab |
|
|
237
239
|
| `<` | Move to previous tab |
|
|
240
|
+
| `b` | Cycle through tabs |
|
|
238
241
|
| `B` | Toggle tab bar visibility |
|
|
239
|
-
| `q` |
|
|
242
|
+
| `q` | Close current tab (prompts to save unsaved changes) |
|
|
243
|
+
| `Q` | Close all tabs and app (prompts to save unsaved changes) |
|
|
244
|
+
| `Ctrl+Q` | Force to quit app (regardless off unsaved changes) |
|
|
245
|
+
| `Ctrl+S` | Save current tab or all tabs to file |
|
|
246
|
+
| `Ctrl+D` | Duplicate current tab |
|
|
247
|
+
| `Ctrl+O` | Open file in a new tab |
|
|
248
|
+
| `Double-click tab` | Rename current tab |
|
|
240
249
|
|
|
241
250
|
#### View & Settings
|
|
242
251
|
|
|
@@ -257,23 +266,30 @@ dv -L 5 -U NA "" data_with_metadata.csv
|
|
|
257
266
|
| `G` | Jump to last row (loads all remaining rows) |
|
|
258
267
|
| `↑` / `↓` | Move up/down one row |
|
|
259
268
|
| `←` / `→` | Move left/right one column |
|
|
260
|
-
| `Home` / `End` | Jump to first/last column
|
|
261
|
-
| `Ctrl + Home` / `Ctrl + End` | Jump to top/bottom
|
|
269
|
+
| `Home` / `End` | Jump to first/last column |
|
|
270
|
+
| `Ctrl + Home` / `Ctrl + End` | Jump to page top/bottom |
|
|
262
271
|
| `PageDown` / `PageUp` | Scroll down/up one page |
|
|
263
272
|
| `Ctrl+F` | Page down |
|
|
264
273
|
| `Ctrl+B` | Page up |
|
|
265
274
|
|
|
275
|
+
#### Undo/Redo/Reset
|
|
276
|
+
| `u` | Undo last action |
|
|
277
|
+
| `U` | Redo last undone action |
|
|
278
|
+
| `Ctrl+U` | Reset to initial state |
|
|
279
|
+
|
|
266
280
|
#### Viewing & Display
|
|
267
281
|
|
|
268
282
|
| Key | Action |
|
|
269
283
|
|-----|--------|
|
|
270
|
-
| `Enter` |
|
|
271
|
-
| `F` | Show frequency distribution for column |
|
|
284
|
+
| `Enter` | Record view of current row |
|
|
285
|
+
| `F` | Show frequency distribution for current column |
|
|
272
286
|
| `s` | Show statistics for current column |
|
|
273
287
|
| `S` | Show statistics for entire dataframe |
|
|
274
|
-
| `K` | Cycle cursor
|
|
288
|
+
| `K` | Cycle cursor types: cell → row → column → cell |
|
|
275
289
|
| `~` | Toggle row labels |
|
|
276
290
|
| `_` (underscore) | Expand column to full width |
|
|
291
|
+
| `z` | Freeze rows and columns |
|
|
292
|
+
| `,` | Toggle thousand separator for numeric display |
|
|
277
293
|
|
|
278
294
|
#### Data Editing
|
|
279
295
|
|
|
@@ -285,10 +301,11 @@ dv -L 5 -U NA "" data_with_metadata.csv
|
|
|
285
301
|
| `E` | Edit entire column with expression |
|
|
286
302
|
| `a` | Add empty column after current |
|
|
287
303
|
| `A` | Add column with name and value/expression |
|
|
304
|
+
| `@` | Add a link column from template |
|
|
288
305
|
| `-` (minus) | Delete current column |
|
|
289
306
|
| `x` | Delete current row |
|
|
290
|
-
| `X` | Delete current row and all
|
|
291
|
-
| `Ctrl+X` | Delete current row and all
|
|
307
|
+
| `X` | Delete current row and all those below |
|
|
308
|
+
| `Ctrl+X` | Delete current row and all those above |
|
|
292
309
|
| `d` | Duplicate current column (appends '_copy' suffix) |
|
|
293
310
|
| `D` | Duplicate current row |
|
|
294
311
|
| `h` | Hide current column |
|
|
@@ -300,25 +317,25 @@ dv -L 5 -U NA "" data_with_metadata.csv
|
|
|
300
317
|
|-----|--------|
|
|
301
318
|
| `\` | Search in current column using cursor value and select rows |
|
|
302
319
|
| `\|` (pipe) | Search in current column with expression and select rows |
|
|
320
|
+
| `{` | Go to previous selected row |
|
|
321
|
+
| `}` | Go to next selected row |
|
|
303
322
|
| `/` | Find in current column with cursor value and highlight matches |
|
|
304
323
|
| `?` | Find in current column with expression and highlight matches |
|
|
305
324
|
| `n` | Go to next match |
|
|
306
325
|
| `N` | Go to previous match |
|
|
307
|
-
| `{` | Go to previous selected row |
|
|
308
|
-
| `}` | Go to next selected row |
|
|
309
326
|
| `'` | Select/deselect current row |
|
|
310
|
-
| `t` | Toggle selected rows (
|
|
327
|
+
| `t` | Toggle selected rows (invßert) |
|
|
311
328
|
| `T` | Clear all selected rows and/or matches |
|
|
312
|
-
| `"` (quote) | Filter to selected rows
|
|
313
|
-
| `v` | View only rows by selected rows and/or matches or cursor value |
|
|
314
|
-
| `V` | View only rows by expression |
|
|
329
|
+
| `"` (quote) | Filter to selected rows and remove others |
|
|
330
|
+
| `v` | View only rows (and hide others) by selected rows and/or matches or cursor value |
|
|
331
|
+
| `V` | View only rows (and hide others) by expression |
|
|
315
332
|
|
|
316
333
|
#### SQL Interface
|
|
317
334
|
|
|
318
335
|
| Key | Action |
|
|
319
336
|
|-----|--------|
|
|
320
|
-
| `l` | Simple SQL interface (select columns &
|
|
321
|
-
| `L` | Advanced SQL interface (full SQL
|
|
337
|
+
| `l` | Simple SQL interface (select columns & where clause) |
|
|
338
|
+
| `L` | Advanced SQL interface (full SQL query with syntax highlight) |
|
|
322
339
|
|
|
323
340
|
#### Find & Replace
|
|
324
341
|
|
|
@@ -345,7 +362,7 @@ dv -L 5 -U NA "" data_with_metadata.csv
|
|
|
345
362
|
| `Shift+←` | Move current column left |
|
|
346
363
|
| `Shift+→` | Move current column right |
|
|
347
364
|
|
|
348
|
-
#### Type
|
|
365
|
+
#### Type Casting
|
|
349
366
|
|
|
350
367
|
| Key | Action |
|
|
351
368
|
|-----|--------|
|
|
@@ -353,21 +370,15 @@ dv -L 5 -U NA "" data_with_metadata.csv
|
|
|
353
370
|
| `%` | Cast current column to float (Float64) |
|
|
354
371
|
| `!` | Cast current column to boolean |
|
|
355
372
|
| `$` | Cast current column to string |
|
|
356
|
-
| `@` | Make URLs in current column clickable with Ctrl/Cmd + click|
|
|
357
373
|
|
|
358
|
-
####
|
|
374
|
+
#### Copy & Save
|
|
359
375
|
|
|
360
376
|
| Key | Action |
|
|
361
377
|
|-----|--------|
|
|
362
|
-
| `z` | Freeze rows and columns |
|
|
363
|
-
| `,` | Toggle thousand separator for numeric display |
|
|
364
378
|
| `c` | Copy current cell to clipboard |
|
|
365
379
|
| `Ctrl+C` | Copy column to clipboard |
|
|
366
380
|
| `Ctrl+R` | Copy row to clipboard (tab-separated) |
|
|
367
381
|
| `Ctrl+S` | Save current tab to file |
|
|
368
|
-
| `u` | Undo last action |
|
|
369
|
-
| `U` | Redo last undone action |
|
|
370
|
-
| `Ctrl+U` | Reset to initial state |
|
|
371
382
|
|
|
372
383
|
## Features in Detail
|
|
373
384
|
|
|
@@ -383,34 +394,34 @@ Columns are automatically styled based on their data type:
|
|
|
383
394
|
### 2. Row Detail View
|
|
384
395
|
|
|
385
396
|
Press `Enter` on any row to open a modal showing all column values for that row.
|
|
386
|
-
Useful for examining wide datasets where columns don't fit on screen.
|
|
397
|
+
Useful for examining wide datasets where columns don't fit well on screen.
|
|
387
398
|
|
|
388
399
|
**In the Row Detail Modal**:
|
|
389
|
-
- Press `v` to **view**
|
|
390
|
-
- Press `"` to **filter** all rows containing the selected column value
|
|
400
|
+
- Press `v` to **view** all rows containing the selected column value (and hide others)
|
|
401
|
+
- Press `"` to **filter** all rows containing the selected column value (and remove others)
|
|
391
402
|
- Press `q` or `Escape` to close the modal
|
|
392
403
|
|
|
393
404
|
### 3. Search & Filtering
|
|
394
405
|
|
|
395
406
|
The application provides multiple search modes for different use cases:
|
|
396
407
|
|
|
397
|
-
**Search Operations** -
|
|
398
|
-
-
|
|
399
|
-
-
|
|
408
|
+
**Search Operations** - Search by value/expression in current column and select rows:
|
|
409
|
+
- **`\` - Column Cursor Search**: Search cursor value
|
|
410
|
+
- **`|` - Column Expression Search**: Opens dialog to search with custom expression
|
|
400
411
|
|
|
401
|
-
**Find Operations** - Find by value/expression:
|
|
412
|
+
**Find Operations** - Find by value/expression and highlight matches:
|
|
402
413
|
- **`/` - Column Find**: Find cursor value within current column
|
|
403
414
|
- **`?` - Column Expression Find**: Open dialog to search current column with expression
|
|
404
415
|
- **`;` - Global Find**: Find cursor value across all columns
|
|
405
416
|
- **`:` - Global Expression Find**: Open dialog to search all columns with expression
|
|
406
417
|
|
|
407
418
|
**Selection & Filtering**:
|
|
408
|
-
- **`'` - Toggle Row Selection**: Select/deselect current row (marks it for filtering)
|
|
409
|
-
- **`t` - Invert Selections**: Flip
|
|
419
|
+
- **`'` - Toggle Row Selection**: Select/deselect current row (marks it for filtering or viewing)
|
|
420
|
+
- **`t` - Invert Selections**: Flip selections of all rows
|
|
410
421
|
- **`T` - Clear Selections**: Remove all row selections and matches
|
|
411
|
-
- **`"` - Filter Selected**:
|
|
412
|
-
- **`v` - View by Value**:
|
|
413
|
-
- **`V` - View by Expression**:
|
|
422
|
+
- **`"` - Filter Selected**: View only the selected rows (others removed)
|
|
423
|
+
- **`v` - View by Value**: View rows by selected rows or cursor value (others hidden but preserved)
|
|
424
|
+
- **`V` - View by Expression**: View rows using custom expression (others hidden but preserved)
|
|
414
425
|
|
|
415
426
|
**Advanced Matching Options**:
|
|
416
427
|
|
|
@@ -424,7 +435,7 @@ These options work with plain text searches. Use Polars regex patterns in expres
|
|
|
424
435
|
|
|
425
436
|
**Quick Tips:**
|
|
426
437
|
- Search results highlight matching rows/cells in **red**
|
|
427
|
-
- Multiple searches **accumulate
|
|
438
|
+
- Multiple searches **accumulate** - each new search adds to the selections or matches
|
|
428
439
|
- Type-aware matching automatically converts values. Resort to string comparison if conversion fails
|
|
429
440
|
- Use `u` to undo any search or filter
|
|
430
441
|
|
|
@@ -460,46 +471,9 @@ When you press `r` or `R`, a dialog opens where you can enter:
|
|
|
460
471
|
- `Enter` or press the `Yes` button - **Replace this occurrence** and move to next
|
|
461
472
|
- Press the `Skip` button - **Skip this occurrence** and move to next
|
|
462
473
|
- `Escape` or press the `No` button - **Cancel** remaining replacements (but keep already-made replacements)
|
|
463
|
-
- Displays progress: `Occurrence X of Y` (Y = total
|
|
464
|
-
- Shows the value that will be replaced and what it will become
|
|
474
|
+
- Displays progress: `Occurrence X of Y` (Y = total occurrences, X = current)
|
|
465
475
|
- Useful for careful replacements where you want to review each change
|
|
466
476
|
|
|
467
|
-
**Search Term Types:**
|
|
468
|
-
- **Plain text**: Exact string match (e.g., "John" finds "John")
|
|
469
|
-
- Use **Match Nocase** checkbox to match regardless of case (e.g., find "john", "John", "JOHN")
|
|
470
|
-
- Use **Match Whole** checkbox to match complete words only (e.g., find "cat" but not in "catfish")
|
|
471
|
-
- **NULL**: Replace null/missing values (type `NULL`)
|
|
472
|
-
- **Expression**: Polars expressions for complex matching (e.g., `$_ > 50` for column replace)
|
|
473
|
-
- **Regex patterns**: Use Polars regex syntax for advanced matching
|
|
474
|
-
- Case-insensitive: Use `(?i)` prefix (e.g., `(?i)john`)
|
|
475
|
-
- Whole word: Use `\b` boundary markers (e.g., `\bjohn\b`)
|
|
476
|
-
|
|
477
|
-
**Examples:**
|
|
478
|
-
|
|
479
|
-
```
|
|
480
|
-
Find: "John"
|
|
481
|
-
Replace: "Jane"
|
|
482
|
-
→ All occurrences of "John" become "Jane"
|
|
483
|
-
|
|
484
|
-
Find: "john"
|
|
485
|
-
Replace: "jane"
|
|
486
|
-
Match Nocase: ✓ (checked)
|
|
487
|
-
→ "John", "JOHN", "john" all become "jane"
|
|
488
|
-
|
|
489
|
-
Find: "cat"
|
|
490
|
-
Replace: "dog"
|
|
491
|
-
Match Whole: ✓ (checked)
|
|
492
|
-
→ "cat" becomes "dog", but "catfish" is not matched
|
|
493
|
-
|
|
494
|
-
Find: "NULL"
|
|
495
|
-
Replace: "Unknown"
|
|
496
|
-
→ All null/missing values become "Unknown"
|
|
497
|
-
|
|
498
|
-
Find: "(?i)active" # Case-insensitive
|
|
499
|
-
Replace: "inactive"
|
|
500
|
-
→ "Active", "ACTIVE", "active" all become "inactive"
|
|
501
|
-
```
|
|
502
|
-
|
|
503
477
|
**For Global Replace (`R`)**:
|
|
504
478
|
- Searches and replaces across all columns simultaneously
|
|
505
479
|
- Each column can have different matching behavior (string matching for text, numeric for numbers)
|
|
@@ -515,6 +489,7 @@ Replace: "inactive"
|
|
|
515
489
|
- **Flexible matching**: Support for case-insensitive and whole-word matching
|
|
516
490
|
|
|
517
491
|
**Tips:**
|
|
492
|
+
- **NULL**: Replace null/missing values (type `NULL`)
|
|
518
493
|
- Use interactive mode for one-time replacements to be absolutely sure
|
|
519
494
|
- Use "Replace All" for routine replacements (e.g., fixing typos, standardizing formats)
|
|
520
495
|
- Use **Match Nocase** for matching variations of names or titles
|
|
@@ -556,7 +531,7 @@ Complex values or filters can be specified via Polars expressions, with the foll
|
|
|
556
531
|
- `~($status == 'inactive')` - Status is not inactive
|
|
557
532
|
- `$revenue > $expenses` - Revenue exceeds expenses
|
|
558
533
|
|
|
559
|
-
**String Matching:**
|
|
534
|
+
**String Matching:** ([Polars string API reference](https://docs.pola.rs/api/python/stable/reference/series/string.html))
|
|
560
535
|
- `$name.str.contains("John")` - Name contains "John" (case-sensitive)
|
|
561
536
|
- `$name.str.contains("(?i)john")` - Name contains "john" (case-insensitive)
|
|
562
537
|
- `$email.str.ends_with("@company.com")` - Email ends with domain
|
|
@@ -586,17 +561,14 @@ Complex values or filters can be specified via Polars expressions, with the foll
|
|
|
586
561
|
|
|
587
562
|
### 6. Frequency Distribution
|
|
588
563
|
|
|
589
|
-
Press `F` to see
|
|
590
|
-
- Value
|
|
591
|
-
- Count
|
|
592
|
-
- Percentage
|
|
593
|
-
- Histogram
|
|
564
|
+
Press `F` to see value distributions of the current column. The modal shows:
|
|
565
|
+
- Value, Count, Percentage, Histogram
|
|
594
566
|
- **Total row** at the bottom
|
|
595
567
|
|
|
596
568
|
**In the Frequency Table**:
|
|
597
569
|
- Press `[` and `]` to sort by any column (value, count, or percentage)
|
|
598
|
-
- Press `v` to **filter**
|
|
599
|
-
- Press `"` to **exclude** all rows
|
|
570
|
+
- Press `v` to **filter** all rows with the selected value (others hidden but preserved)
|
|
571
|
+
- Press `"` to **exclude** all rows containing the selected value (others removed)
|
|
600
572
|
- Press `q` or `Escape` to close the frequency table
|
|
601
573
|
|
|
602
574
|
This is useful for:
|
|
@@ -612,12 +584,10 @@ Press `s` to see summary statistics for the current column, or press `S` for sta
|
|
|
612
584
|
**Column Statistics** (`s`):
|
|
613
585
|
- Shows calculated statistics using Polars' `describe()` method
|
|
614
586
|
- Displays: count, null count, mean, median, std, min, max, etc.
|
|
615
|
-
- Values are color-coded according to their data type
|
|
616
|
-
- Statistics label column has no styling for clarity
|
|
617
587
|
|
|
618
588
|
**Dataframe Statistics** (`S`):
|
|
619
589
|
- Shows statistics for all numeric and applicable columns simultaneously
|
|
620
|
-
-
|
|
590
|
+
- Displays: count, null count, mean, median, std, min, max, etc.
|
|
621
591
|
|
|
622
592
|
**In the Statistics Modal**:
|
|
623
593
|
- Press `q` or `Escape` to close the statistics table
|
|
@@ -653,15 +623,7 @@ This is useful for:
|
|
|
653
623
|
- Useful for removing leading rows or the beginning of a dataset
|
|
654
624
|
|
|
655
625
|
**Delete Column** (`-`):
|
|
656
|
-
- Removes the entire column from
|
|
657
|
-
|
|
658
|
-
**Delete Column and After** (`_`):
|
|
659
|
-
- Deletes the current column and all columns to the right
|
|
660
|
-
- Useful for removing trailing columns or the end of a dataset
|
|
661
|
-
|
|
662
|
-
**Delete Column and Before** (`Ctrl+-`):
|
|
663
|
-
- Deletes the current column and all columns to the left
|
|
664
|
-
- Useful for removing leading columns or the beginning of a dataset
|
|
626
|
+
- Removes the entire column from display and dataframe
|
|
665
627
|
|
|
666
628
|
### 9. Hide & Show Columns
|
|
667
629
|
|
|
@@ -673,10 +635,6 @@ This is useful for:
|
|
|
673
635
|
**Show Hidden Rows/Columns** (`H`):
|
|
674
636
|
- Restores all previously hidden rows/columns to the display
|
|
675
637
|
|
|
676
|
-
This is useful for:
|
|
677
|
-
- Focusing on specific columns without deleting data
|
|
678
|
-
- Temporarily removing cluttered or unnecessary columns
|
|
679
|
-
|
|
680
638
|
### 10. Duplicate Column
|
|
681
639
|
|
|
682
640
|
Press `d` to duplicate the current column:
|
|
@@ -775,14 +733,7 @@ Press `K` to cycle through selection modes:
|
|
|
775
733
|
2. **Row mode**: Highlight entire row
|
|
776
734
|
3. **Column mode**: Highlight entire column
|
|
777
735
|
|
|
778
|
-
### 18.
|
|
779
|
-
|
|
780
|
-
Press `@` to make URLs in the current column clickable:
|
|
781
|
-
- **Ctrl/Cmd + click** on URLs to open them in your default browser
|
|
782
|
-
- **Scans** all cells in the current column for URLs starting with `http://` or `https://`
|
|
783
|
-
- **Applies** link styling to make them clickable and dataframe remains unchanged
|
|
784
|
-
|
|
785
|
-
### 19. SQL Interface
|
|
736
|
+
### 18. SQL Interface
|
|
786
737
|
|
|
787
738
|
The SQL interface provides two modes for querying your dataframe:
|
|
788
739
|
|
|
@@ -798,6 +749,7 @@ Execute complete SQL queries for advanced data manipulation:
|
|
|
798
749
|
- Support for JOINs, GROUP BY, aggregations, and more
|
|
799
750
|
- Access to all SQL capabilities for complex transformations
|
|
800
751
|
- Always use `self` as the table name
|
|
752
|
+
- Syntax highlighted
|
|
801
753
|
|
|
802
754
|
**Examples:**
|
|
803
755
|
```sql
|
|
@@ -815,63 +767,67 @@ FROM self
|
|
|
815
767
|
WHERE (age > 25 AND salary > 50000) OR department = 'Management'
|
|
816
768
|
```
|
|
817
769
|
|
|
818
|
-
###
|
|
770
|
+
### 19. Clipboard Operations
|
|
819
771
|
|
|
820
772
|
Copies value to system clipboard with `pbcopy` on macOS and `xclip` on Linux
|
|
773
|
+
**Note** May require a X server to work
|
|
821
774
|
|
|
822
|
-
Press `Ctrl+C` to copy:
|
|
823
775
|
- Press `c` to copy cursor value
|
|
824
776
|
- Press `Ctrl+C` to copy column values
|
|
825
777
|
- Press `Ctrl+R` to copy row values (delimited by tab)
|
|
778
|
+
- Hold `Shift` to select with mouse
|
|
826
779
|
|
|
827
|
-
|
|
780
|
+
### 20. Link Column Creation
|
|
828
781
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
```bash
|
|
832
|
-
# View Pokemon dataset
|
|
833
|
-
dv pokemon.csv
|
|
782
|
+
Press `@` to create a new column containing dynamically generated URLs using template.
|
|
834
783
|
|
|
835
|
-
|
|
836
|
-
cut -d',' -f1,2,3 pokemon.csv | dv -f csv
|
|
784
|
+
**Template Placeholders:**
|
|
837
785
|
|
|
838
|
-
|
|
839
|
-
dv large_dataset.csv.gz
|
|
786
|
+
The link template supports multiple placeholder types for maximum flexibility:
|
|
840
787
|
|
|
841
|
-
|
|
842
|
-
|
|
788
|
+
- **`$_`** - Current column (the column where cursor was when `@` was pressed)
|
|
789
|
+
- Example: `https://example.com/search/$_` - Uses values from the current column
|
|
843
790
|
|
|
844
|
-
|
|
845
|
-
|
|
791
|
+
- **`$1`, `$2`, `$3`, etc.** - Column by 1-based position index
|
|
792
|
+
- Example: `https://example.com/product/$1/details/$2` - Uses 1st and 2nd columns
|
|
793
|
+
- Index corresponds to column display order (left-to-right)
|
|
846
794
|
|
|
847
|
-
|
|
848
|
-
|
|
795
|
+
- **`$name`** - Column by name (use actual column names)
|
|
796
|
+
- Example: `https://pubchem.ncbi.nlm.nih.gov/search?q=$product_id` - Uses `product_id` column
|
|
797
|
+
- Example: `https://example.com/$region/$city/data` - Uses `region` and `city` columns
|
|
849
798
|
|
|
850
|
-
|
|
851
|
-
|
|
799
|
+
**Features:**
|
|
800
|
+
- **Multiple Placeholders**: Mix and match placeholders in a single template
|
|
801
|
+
- **URL Prefix**: Automatically prepends `https://` if URL doesn't start with `http://` or `https://`
|
|
852
802
|
|
|
853
|
-
|
|
854
|
-
|
|
803
|
+
**Tips:**
|
|
804
|
+
- Use full undo (`u`) if template produces unexpected URLs
|
|
805
|
+
- For complex multi-column URLs, use column names (`$name`) for clarity over positions (`$1`)
|
|
855
806
|
|
|
856
|
-
|
|
857
|
-
dv -L 2 -K 1 -H -I complex_data.csv.gz
|
|
807
|
+
### 21. Tab Management
|
|
858
808
|
|
|
859
|
-
|
|
860
|
-
zcat compressed_data.csv.gz | dv -f csv -L 2
|
|
861
|
-
```
|
|
809
|
+
Manage multiple files and dataframes simultaneously with tabs.
|
|
862
810
|
|
|
863
|
-
|
|
811
|
+
**Tab Operations:**
|
|
812
|
+
- **`Ctrl+O`** - Open file in a new tab
|
|
813
|
+
- **`>`** - Move to next tab
|
|
814
|
+
- **`<`** - Move to previous tab
|
|
815
|
+
- **`b`** - Cycle through tabs
|
|
816
|
+
- **`B`** - Toggle tab bar visibility
|
|
817
|
+
- **`Double-click tab`** - Rename the tab
|
|
818
|
+
- **`Ctrl+D`** - Duplicate current tab (creates a copy with same data and state)
|
|
819
|
+
- **`Ctrl+S`** - Save current tab to file or all tabs in a single Excel file
|
|
820
|
+
- **`q`** - Close current tab (closes tab, prompts to save if unsaved changes)
|
|
821
|
+
- **`Q`** - Close all tabs and exit app (prompts to save tabs with unsaved changes)
|
|
822
|
+
- **`Ctrl+Q`** - Force to quit app regardless of unsaved changes
|
|
864
823
|
|
|
865
|
-
|
|
866
|
-
# Open multiple sheets as tabs in a single Excel
|
|
867
|
-
dv sales.xlsx
|
|
824
|
+
**Tab Operations:**
|
|
868
825
|
|
|
869
|
-
|
|
870
|
-
dv pokemon.csv titanic.csv large_data.csv.gz
|
|
826
|
+
**Saving & Quitting:**
|
|
871
827
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
828
|
+
**Tips:**
|
|
829
|
+
- Tabs with unsaved changes are highlighted with a bright border
|
|
830
|
+
- Closing or quitting a tab with unsaved changes triggers a save prompt
|
|
875
831
|
|
|
876
832
|
## Dependencies
|
|
877
833
|
|