dataframe-textual 0.1.0__py3-none-any.whl → 1.1.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.

Potentially problematic release.


This version of dataframe-textual might be problematic. Click here for more details.

@@ -0,0 +1,13 @@
1
+ dataframe_textual/__init__.py,sha256=uzB3bjlbm8JbsjxEgwqvPcYERktm3F9d9Op_6cWJ1sk,853
2
+ dataframe_textual/__main__.py,sha256=ANe7s2SKO53ksFg-0VrCT2GRCG48wDSAZsLrWvoQwmQ,2082
3
+ dataframe_textual/common.py,sha256=JVGl5ImbC8h9-nodcGZCyNmRcO2VlCF1-yo8Zg8uD90,11583
4
+ dataframe_textual/data_frame_help_panel.py,sha256=XgKGEPJr2hnDWpZ5mavLRcBSPa9cvrXdzVUGFQavXm4,3353
5
+ dataframe_textual/data_frame_table.py,sha256=mOm0pzuN61N01KXi_II6Ld4-NqVYYdiKfzukDMlJpxw,102644
6
+ dataframe_textual/data_frame_viewer.py,sha256=9vUBdIgSoOf4fdDtI4sAPY6cF1tFdsXwpWatyDsuXh0,17196
7
+ dataframe_textual/table_screen.py,sha256=vSevLh944xBTIYVcokABCfSUi84s9gclizx6eDmxyFY,17585
8
+ dataframe_textual/yes_no_screen.py,sha256=vyUKMBbbwgt5At1U430eLg3WbJvqUNoz2GpvdnMd7q0,22921
9
+ dataframe_textual-1.1.0.dist-info/METADATA,sha256=FvSPyXMtELpoIrqfXhzlUkPRb91-6GM16NDwIr-q24g,25378
10
+ dataframe_textual-1.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
+ dataframe_textual-1.1.0.dist-info/entry_points.txt,sha256=Z0XKp1ACvmbJymekkxt-C81I0OoInksr5Ib0w2OT_a4,55
12
+ dataframe_textual-1.1.0.dist-info/licenses/LICENSE,sha256=AVTg0gk1X-LHI-nnHlAMDQetrwuDZK4eypgSMDO46Yc,1069
13
+ dataframe_textual-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dv = dataframe_textual.__main__:main
@@ -1,522 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: dataframe-textual
3
- Version: 0.1.0
4
- Summary: Interactive CSV/Excel viewer for the terminal (Textual TUI)
5
- Project-URL: Homepage, https://github.com/need47/dataframe-viewer
6
- Project-URL: Repository, https://github.com/need47/dataframe-viewer.git
7
- Project-URL: Documentation, https://github.com/need47/dataframe-viewer#readme
8
- Project-URL: Bug Tracker, https://github.com/need47/dataframe-viewer/issues
9
- Author-email: Tiejun Cheng <need47@gmail.com>
10
- License: MIT
11
- License-File: LICENSE
12
- Keywords: csv,data-analysis,interactive,polars,terminal,textual,tui,viewer
13
- Classifier: Development Status :: 3 - Alpha
14
- Classifier: Environment :: Console
15
- Classifier: Intended Audience :: Developers
16
- Classifier: Intended Audience :: End Users/Desktop
17
- Classifier: License :: OSI Approved :: MIT License
18
- Classifier: Natural Language :: English
19
- Classifier: Operating System :: MacOS
20
- Classifier: Operating System :: POSIX
21
- Classifier: Operating System :: Unix
22
- Classifier: Programming Language :: Python :: 3
23
- Classifier: Programming Language :: Python :: 3.11
24
- Classifier: Programming Language :: Python :: 3.12
25
- Classifier: Programming Language :: Python :: 3.13
26
- Classifier: Programming Language :: Python :: 3.14
27
- Classifier: Topic :: Office/Business
28
- Classifier: Topic :: Utilities
29
- Classifier: Typing :: Typed
30
- Requires-Python: >=3.11
31
- Requires-Dist: polars>=1.34.0
32
- Requires-Dist: rich>=14.2.0
33
- Requires-Dist: textual>=1.0.0
34
- Provides-Extra: dev
35
- Requires-Dist: textual-dev>=1.8.0; extra == 'dev'
36
- Provides-Extra: excel
37
- Requires-Dist: fastexcel>=0.16.0; extra == 'excel'
38
- Requires-Dist: xlsxwriter>=3.2.9; extra == 'excel'
39
- Description-Content-Type: text/markdown
40
-
41
- # DataFrame Viewer
42
-
43
- A powerful, interactive terminal-based CSV viewer built with Python, Polars, and Textual. Inspired by VisiData, this tool provides smooth keyboard navigation, data manipulation, and a clean interface for exploring CSV data directly in your terminal. Now with **multi-file support for simultaneous data comparison**!
44
-
45
- ![Screenshot](https://raw.githubusercontent.com/need47/dataframe-viewer/refs/heads/main/screenshot.png)
46
-
47
- ## Features
48
-
49
- ### Core Data Viewing
50
- - 🚀 **Fast CSV Loading** - Powered by Polars for efficient data handling with lazy pagination
51
- - 🎨 **Rich Terminal UI** - Beautiful, color-coded columns with automatic type detection
52
- - ⌨️ **Comprehensive Keyboard Navigation** - Intuitive controls for browsing, editing, and manipulating data
53
- - 📊 **Flexible Input** - Read from files or stdin (pipes/redirects)
54
- - 🔄 **Smart Pagination** - Lazy load rows on demand for handling large datasets
55
-
56
- ### Data Manipulation
57
- - 📝 **Data Editing** - Edit cells, delete rows, and remove columns
58
- - 🔍 **Search & Filter** - Find values, highlight matches, and filter selected rows
59
- - ↔️ **Column/Row Reordering** - Move columns and rows with simple keyboard shortcuts
60
- - 📈 **Sorting & Statistics** - Multi-column sorting and frequency distribution analysis
61
- - 💾 **Save & Undo** - Save filtered data back to CSV with full undo/redo support
62
-
63
- ### Advanced Features
64
- - 📌 **Pin Rows/Columns** - Keep important rows and columns visible while scrolling
65
- - 🎯 **Cursor Type Cycling** - Switch between cell, row, and column selection modes
66
- - 📂 **Multi-File Support** - Open multiple CSV files in tabs for side-by-side comparison
67
- - 🔄 **Tab Management** - Seamlessly switch between open files with keyboard shortcuts
68
-
69
- ## Installation
70
-
71
- ### Using uv (recommended)
72
-
73
- ```bash
74
- # Clone or download the project
75
- cd dataframe-viewer
76
-
77
- # Run directly with uv
78
- uv run python main.py <csv_file>
79
- ```
80
-
81
- ### Using pip
82
-
83
- ```bash
84
- pip install polars textual
85
- python main.py <csv_file>
86
- ```
87
-
88
- ## Usage
89
-
90
- ### Basic Usage - Single File
91
-
92
- ```bash
93
- # View a CSV file
94
- python main.py pokemon.csv
95
-
96
- # Or with uv
97
- uv run python main.py pokemon.csv
98
-
99
- # Read from stdin
100
- cat data.csv | python main.py
101
- python main.py < data.csv
102
- ```
103
-
104
- ### Multi-File Usage - Multiple Tabs
105
-
106
- ```bash
107
- # Open multiple files in tabs
108
- python main.py file1.csv file2.csv file3.csv
109
-
110
- # Open multiple sheets in tabs in an Excel file
111
- python main.py file.xlsx
112
-
113
- # Or with uv
114
- uv run python main.py file1.csv file2.csv file3.csv
115
-
116
- # Mix files and stdin (file opens first, then read from stdin)
117
- python main.py data1.csv < data2.csv
118
- ```
119
-
120
- When multiple files are opened:
121
- - Each file appears as a separate tab at the top
122
- - Switch between tabs using `>` (next) or `<` (previous)
123
- - Open additional files with `Ctrl+O`
124
- - Close the current tab with `Ctrl+W`
125
- - Each file maintains its own state (sort order, selections, history, etc.)
126
- - Edits and filters are independent per file
127
-
128
- ## Keyboard Shortcuts
129
-
130
- ### App-Level Controls
131
-
132
- #### File & Tab Management
133
-
134
- | Key | Action |
135
- |-----|--------|
136
- | `Ctrl+O` | Open new CSV file in a new tab |
137
- | `Ctrl+W` | Close current tab |
138
- | `Ctrl+Shift+S` | Save all open tabs to Excel file |
139
- | `>` or `b` | Move to next tab |
140
- | `<` | Move to previous tab |
141
- | `B` | Toggle tab bar visibility |
142
- | `q` | Quit the application |
143
-
144
- #### View & Settings
145
-
146
- | Key | Action |
147
- |-----|--------|
148
- | `?` or `h` | Toggle help panel (context-sensitive) |
149
- | `k` | Cycle through themes |
150
-
151
- ---
152
-
153
- ### Table-Level Controls
154
-
155
- #### Navigation
156
-
157
- | Key | Action |
158
- |-----|--------|
159
- | `g` | Jump to first row |
160
- | `G` | Jump to last row (loads all remaining rows) |
161
- | `↑` / `↓` | Move up/down one row |
162
- | `←` / `→` | Move left/right one column |
163
- | `PageDown` / `PageUp` | Scroll down/up |
164
- | Arrow keys | Navigate the table |
165
-
166
- #### Viewing & Display
167
-
168
- | Key | Action |
169
- |-----|--------|
170
- | `Enter` | View full details of current row in modal |
171
- | `F` | Show frequency distribution for column |
172
- | `C` | Cycle cursor type: cell → row → column → cell |
173
- | `#` | Toggle row labels visibility |
174
-
175
- #### Data Editing
176
-
177
- | Key | Action |
178
- |-----|--------|
179
- | `e` | Edit current cell (respects data type) |
180
- | `d` | Delete current row |
181
- | `-` | Delete current column |
182
-
183
- #### Searching & Filtering
184
-
185
- | Key | Action |
186
- |-----|--------|
187
- | `\|` (pipe) | Search in current column (case-insensitive) |
188
- | `/` (slash) | Global search across all columns |
189
- | `\` | Search current column using cell value |
190
- | `s` | Select/deselect current row |
191
- | `t` | Toggle highlighting of all selected rows (invert) |
192
- | `T` | Clear all selected rows |
193
- | `"` (quote) | Filter to show only selected rows |
194
- | `v` | Filter by selected rows (if any) or current cell value |
195
- | `V` | Filter by expression (Polars expression syntax) |
196
-
197
- #### Sorting
198
-
199
- | Key | Action |
200
- |-----|--------|
201
- | `[` | Sort current column ascending |
202
- | `]` | Sort current column descending |
203
-
204
- #### Reordering
205
-
206
- | Key | Action |
207
- |-----|--------|
208
- | `Shift+↑` | Move current row up |
209
- | `Shift+↓` | Move current row down |
210
- | `Shift+←` | Move current column left |
211
- | `Shift+→` | Move current column right |
212
-
213
- #### Data Management
214
-
215
- | Key | Action |
216
- |-----|--------|
217
- | `f` | Freeze rows and columns |
218
- | `c` | Copy current cell to clipboard |
219
- | `Ctrl+S` | Save current tab to CSV/TSV file |
220
- | `u` | Undo last action |
221
- | `U` | Reset to original data |
222
-
223
- #### Modal Interactions
224
-
225
- **In Frequency Distribution Modal** (opened with `F`):
226
- - `[` / `]` - Sort frequency table
227
- - `v` - Filter main table to selected value
228
- - `"` - Highlight rows with selected value
229
- - `q` / `Escape` - Close modal
230
-
231
- **In Row Detail Modal** (opened with `Enter`):
232
- - `v` - Filter main table to selected column value
233
- - `"` - Highlight rows with selected column value
234
- - `q` / `Escape` - Close modal
235
-
236
- **Tip**: Press `?` or `h` to open the context-sensitive help panel which displays all available shortcuts based on your current focus.
237
-
238
- ## Features in Detail
239
-
240
- ### 1. Color-Coded Data Types
241
-
242
- Columns are automatically styled based on their data type:
243
- - **Int64** (Integers): Cyan text, right-aligned
244
- - **Float64** (Decimals): Magenta text, right-aligned
245
- - **String**: Green text, left-aligned
246
- - **Boolean**: Blue text, centered
247
- - **Date/Datetime**: Blue text, centered
248
-
249
- ### 2. Row Detail View
250
-
251
- Press `Enter` on any row to open a modal showing all column values for that row. Useful for examining wide datasets where columns don't fit on screen.
252
-
253
- **In the Row Detail Modal**:
254
- - Press `v` to **filter** the main table to show only rows with the selected column value
255
- - Press `"` to **highlight** all rows containing the selected column value
256
- - Press `q` or `Escape` to close the modal
257
-
258
- ### 3. Search & Filtering
259
-
260
- **Column Search** (`|`):
261
- - Search for values in the current column
262
- - Case-insensitive substring matching
263
- - All matching rows are highlighted in red
264
- - Multiple searches accumulate selections
265
-
266
- **Global Search** (`/`):
267
- - Search for a term across all columns simultaneously
268
- - Cell-level highlighting in red for each matching cell
269
- - Useful for finding a value anywhere in the dataset
270
- - Automatically loads rows if matches extend beyond visible area
271
- - Type-aware matching: converts values to strings before comparing
272
-
273
- **Cell-Value Search** (`\`):
274
- - Automatically search using the current cell's value
275
- - Quick way to find all occurrences of a value
276
-
277
- **Row Filtering** (`"`):
278
- - Display only the selected (highlighted) rows
279
- - Other rows are hidden but preserved
280
- - Use undo (`u`) to restore
281
-
282
- ### 4. Filter by Expression
283
-
284
- Press `f` to open a powerful filter expression dialog. This allows you to write complex filter conditions using a special syntax:
285
-
286
- **Column References:**
287
- - `$_` - Current column (based on cursor position)
288
- - `$1`, `$2`, etc. - Column by 1-based index
289
- - `$age`, `$salary` - Column by name
290
-
291
- **Operators:**
292
- - Comparison: `==`, `!=`, `<`, `>`, `<=`, `>=`
293
- - Logical: `&&` (AND), `||` (OR)
294
- - Arithmetic: `+`, `-`, `*`, `/`, `%`
295
-
296
- **Examples:**
297
- - `$_ > 50` - Current column greater than 50
298
- - `$salary >= 100000` - Salary at least 100,000
299
- - `$age < 30 && $status == 'active'` - Age less than 30 AND status is active
300
- - `$name == 'Alice' || $name == 'Bob'` - Name is Alice or Bob
301
- - `$salary / 1000 >= 50` - Salary divided by 1,000 is at least 50
302
-
303
- See [FILTER_EXPRESSION_GUIDE.md](FILTER_EXPRESSION_GUIDE.md) for comprehensive syntax documentation.
304
-
305
- ### 5. Sorting
306
-
307
- - Press `[` to sort current column ascending
308
- - Press `]` to sort current column descending
309
- - Multi-column sorting supported (press multiple times on different columns)
310
- - Press same key twice to toggle direction
311
- - Frequency view (`F`) shows value distribution with optional sorting
312
-
313
- ### 6. Frequency Distribution
314
-
315
- Press `F` to see how many times each value appears in the current column. The modal shows:
316
- - Value
317
- - Count
318
- - Percentage of total
319
- - **Total row** at the bottom
320
-
321
- **In the Frequency Table**:
322
- - Press `[` and `]` to sort by any column (value, count, or percentage)
323
- - Press `v` to **filter** the main table to show only rows with the selected value
324
- - Press `"` to **highlight** all rows containing the selected value
325
- - Press `q` or `Escape` to close the frequency table
326
-
327
- This is useful for:
328
- - Understanding value distributions
329
- - Quickly filtering to specific values
330
- - Identifying rare or common values
331
- - Finding the most/least frequent entries
332
-
333
- ### 7. Data Editing
334
-
335
- **Edit Cell** (`e`):
336
- - Opens modal for editing current cell
337
- - Validates input based on column data type
338
- - Shows column name and type
339
- - Integer, number, and text inputs available
340
-
341
- **Delete Row** (`d`):
342
- - Delete single row at cursor
343
- - Or delete all selected rows at once
344
- - Deleted rows are marked internally but kept for undo
345
-
346
- **Delete Column** (`-`):
347
- - Removes the entire column from view and dataframe
348
- - Cannot be undone directly (use undo feature)
349
-
350
- ### 8. Column & Row Reordering
351
-
352
- **Move Columns**: `Shift+←` and `Shift+→`
353
- - Swaps adjacent columns
354
- - Reorder is preserved when saving
355
-
356
- **Move Rows**: `Shift+↑` and `Shift+↓`
357
- - Swaps adjacent rows
358
- - Visual reordering without affecting data
359
-
360
- ### 9. Pin Rows and Columns
361
-
362
- Press `f` to open the pin dialog:
363
- - Enter number of fixed rows: keeps top rows visible while scrolling
364
- - Enter two numbers: `<rows> <columns>` (space-separated)
365
- - Example: `2 3` pins top 2 rows and left 3 columns
366
-
367
- ### 10. Save to CSV
368
-
369
- Press `Ctrl+S` to save:
370
- - Save filtered, edited, or sorted data back to CSV
371
- - Choose filename in modal dialog
372
- - Confirm if file already exists
373
- - Automatic .tsv or .csv detection
374
-
375
- ### 11. Undo/Redo
376
-
377
- Press `u` to undo:
378
- - Reverts last action with full state restoration
379
- - Works for edits, deletions, sorts, searches, etc.
380
- - Shows description of reverted action
381
-
382
- ### 12. Cursor Type Cycling
383
-
384
- Press `C` to cycle through selection modes:
385
- 1. **Cell mode**: Highlight individual cell (and its row/column headers)
386
- 2. **Row mode**: Highlight entire row
387
- 3. **Column mode**: Highlight entire column
388
-
389
- Visual feedback shows which mode is active.
390
-
391
- ### 13. Clipboard Operations
392
-
393
- Press `c` to copy:
394
- - Copies current cell value to system clipboard
395
- - Works on macOS (`pbcopy`) and Linux (`xclip`)
396
- - Shows confirmation notification
397
-
398
- ## Data Type Support
399
-
400
- - **Int64, Int32, UInt32**: Integer values
401
- - **Float64, Float32**: Decimal numbers (shown with 4 significant figures)
402
- - **String**: Text data
403
- - **Boolean**: True/False values
404
- - **Date**: ISO date format (YYYY-MM-DD)
405
- - **Datetime**: ISO datetime format
406
- - **Null values**: Displayed as `-`
407
-
408
- ## Examples
409
-
410
- ### Single File Examples
411
-
412
- ```bash
413
- # View Pokemon dataset
414
- python main.py pokemon.csv
415
-
416
- # View Titanic dataset with analysis
417
- python main.py titanic.csv
418
-
419
- # Filter and view specific columns
420
- cut -d',' -f1,2,3 pokemon.csv | python main.py
421
-
422
- # View with grep filter (then use | search in viewer)
423
- grep "Fire" pokemon.csv | python main.py
424
-
425
- # Chain with other commands
426
- cat data.csv | sort -t',' -k2 | python main.py
427
- ```
428
-
429
- ### Multi-File Examples
430
-
431
- ```bash
432
- # Compare two versions of a dataset
433
- python main.py pokemon_v1.csv pokemon_v2.csv
434
-
435
- # Side-by-side analysis of related files
436
- python main.py sales_2022.csv sales_2023.csv forecast_2024.csv
437
-
438
- # Cross-reference datasets
439
- python main.py customers.csv orders.csv products.csv
440
-
441
- # Start with one file, open others using Ctrl+O
442
- python main.py initial_data.csv
443
- # Then press Ctrl+O to open more files interactively
444
- ```
445
-
446
- ### Advanced Workflows
447
-
448
- ```bash
449
- # Start with a filtered file, compare with original
450
- grep "status=active" data.csv > filtered.csv
451
- python main.py data.csv filtered.csv
452
- # Now compare the full dataset with the filtered version in separate tabs
453
-
454
- # Multi-step analysis
455
- # 1. Open multiple related CSVs
456
- # 2. Use Ctrl+O to open additional files as you discover relationships
457
- # 3. Each tab maintains independent sort/filter/search state
458
- # 4. Use Ctrl+W to close tabs when done analyzing
459
- ```
460
-
461
- ## Performance
462
-
463
- - **Lazy loading**: Only loads visible rows + 10 rows ahead
464
- - **Efficient sorting**: Uses Polars' optimized sort algorithms
465
- - **Smooth scrolling**: No lag when paging through large files
466
- - **Memory efficient**: Handles datasets larger than RAM
467
-
468
- Tested with:
469
- - 10,000+ row CSV files
470
- - Wide datasets (100+ columns)
471
- - Various data types and sizes
472
-
473
- ## Dependencies
474
-
475
- - **polars**: Fast DataFrame library for CSV processing
476
- - **textual**: Terminal UI framework
477
- - **rich**: Rich text and formatting in the terminal
478
-
479
- ## Architecture Overview
480
-
481
- ### Single-Table Design
482
-
483
- The core of the application is built around the `DataFrameTable` widget:
484
-
485
- - **Self-contained**: Each table instance maintains its own complete state (13 independent variables)
486
- - **Fully autonomous**: All operations (editing, sorting, filtering, searching) are handled within the table
487
- - **Event-driven**: Each table owns and handles its keyboard events
488
- - **Backward compatible**: Works identically in single-file mode
489
-
490
- ### Multi-Table Design
491
-
492
- The `DataFrameApp` coordinates multiple independent `DataFrameTable` instances:
493
-
494
- - **Tab-based interface**: Uses Textual's `TabbedContent` for tab management
495
- - **Independent state**: Each tab has completely separate state (sort order, selections, history)
496
- - **Seamless switching**: Switch between files without losing context or state
497
- - **File management**: Open/close files dynamically without restarting the application
498
-
499
- ### State Isolation
500
-
501
- Each `DataFrameTable` instance owns:
502
- - DataFrame (`self.df`)
503
- - Sorted columns (`self.sorted_columns`)
504
- - Selected rows (`self.selected_rows`)
505
- - Edit history (`self.histories`)
506
- - Cursor state (position, type)
507
- - Search/filter state
508
- - And 8 more internal state variables
509
-
510
- This ensures perfect isolation between tabs with zero cross-contamination.
511
-
512
- ## Requirements
513
-
514
- - Python 3.11+
515
- - POSIX-compatible terminal (macOS, Linux, WSL)
516
- - Terminal supporting ANSI escape sequences and mouse events
517
-
518
- ## Acknowledgments
519
-
520
- - Inspired by [VisiData](https://visidata.org/)
521
- - Built with [Textual](https://textual.textualize.io/), [Polars](https://www.pola.rs/), and [Rich](https://rich.readthedocs.io/)
522
- - All code created through iterative development
@@ -1,13 +0,0 @@
1
- dataframe_viewer/__init__.py,sha256=uzB3bjlbm8JbsjxEgwqvPcYERktm3F9d9Op_6cWJ1sk,853
2
- dataframe_viewer/__main__.py,sha256=LPLyZcv4hAFfF3hUt1S2dtZOqaAZnlguicgwiDrtXgk,1349
3
- dataframe_viewer/common.py,sha256=3zzhI__F_hoOFDRe-wt-oTfMDFik1ohraIa6rXcVit8,6357
4
- dataframe_viewer/data_frame_help_panel.py,sha256=SQ2lulb1SPxItR9tMvIgOzzeCcW9SB1rRojAcwZ7Vis,2730
5
- dataframe_viewer/data_frame_table.py,sha256=u_gMc-U57efgIRoCfOR65clieK7M7FUg45jjUb06V_w,50079
6
- dataframe_viewer/data_frame_viewer.py,sha256=BP-pCYIG5bEDFkUmUyA3sxWc3z1zI_viClDZlT-s_uE,11715
7
- dataframe_viewer/table_screen.py,sha256=Pq6aM-vntDxLj1r5Uzke6_pzbuhO-VrX_V12ezwm3uM,10588
8
- dataframe_viewer/yes_no_screen.py,sha256=z7MEVTMepFuGWFIthhQlAT3m69D6lgIl4tb2_oJAWWQ,13207
9
- dataframe_textual-0.1.0.dist-info/METADATA,sha256=83coV75y1bb8xOM0FhcHWqLGEltMlMRfFuwLKJ4MFNY,16559
10
- dataframe_textual-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
- dataframe_textual-0.1.0.dist-info/entry_points.txt,sha256=KSovZ8BMRj1HTXuXh9aNF9Uw0TZiNSJgdg6EoPEdsmA,69
12
- dataframe_textual-0.1.0.dist-info/licenses/LICENSE,sha256=AVTg0gk1X-LHI-nnHlAMDQetrwuDZK4eypgSMDO46Yc,1069
13
- dataframe_textual-0.1.0.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- dataframe-textual = dataframe_viewer.__main__:main
@@ -1,48 +0,0 @@
1
- """Entry point for running DataFrameViewer as a module."""
2
-
3
- import argparse
4
- import sys
5
- from pathlib import Path
6
-
7
- from .data_frame_viewer import DataFrameViewer
8
-
9
-
10
- def main():
11
- """Run the DataFrame Viewer application."""
12
- parser = argparse.ArgumentParser(
13
- description="Interactive CSV/Excel viewer for the terminal (Textual version)",
14
- formatter_class=argparse.RawDescriptionHelpFormatter,
15
- epilog="Examples:\n"
16
- " dataframe-viewer data.csv\n"
17
- " dataframe-viewer file1.csv file2.csv file3.csv\n"
18
- " dataframe-viewer data.xlsx (opens all sheets in tabs)\n"
19
- " cat data.csv | dataframe-viewer\n",
20
- )
21
- parser.add_argument(
22
- "files", nargs="*", help="CSV or Excel files to view (or read from stdin)"
23
- )
24
-
25
- args = parser.parse_args()
26
- filenames = []
27
-
28
- # Check if reading from stdin (pipe or redirect)
29
- if not sys.stdin.isatty():
30
- filenames = ["-"]
31
- elif args.files:
32
- # Validate all files exist
33
- for filename in args.files:
34
- if not Path(filename).exists():
35
- print(f"File not found: {filename}")
36
- sys.exit(1)
37
- filenames = args.files
38
-
39
- if not filenames:
40
- parser.print_help()
41
- sys.exit(1)
42
-
43
- app = DataFrameViewer(*filenames)
44
- app.run()
45
-
46
-
47
- if __name__ == "__main__":
48
- main()