Live data from Hacker News

Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

github.com

31–40 of 141 posts

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#31
post #28

Cool project (and written in my favourite language), but I really hate how there's no space at the end of your prompt.

And the use of cat on a single file..

I don't understand your comment - could you expand on it?

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#32

It's very weird for a project made to "maximize viewer enjoyment" to not put a space after the prompt. The one saved character on the line is definitely not worth the illegible resulting line: this doesn't maximize my enjoyment at all when viewing the examples.

That's just the shell prompt on the recording machine. You can use your own prompt in your shell.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#33
post #14

Why not visidata? https://www.visidata.org/ https://www.youtube.com/watch?v=N1CBDTgGtOU (It does much, much more than pretty printing, but no reason you can't use it for that.)

I love visidata! But when I want to just glance at a csv file I reach for tv (I used to use `column` which is more of a tv competitor than visidata). This is for a couple reasons.

1. tv gives a quick summary of the count of rows and columns

2. tv shows all columns at the bottom that don't fit in the terminal. With vd I have to scroll on wide data.

3. tv guides the eye to missing data better with NA highlights

4. tv has sigfig logic that is better. I work with files where the decimal dust can become long. Those unnecessary characters pushes remaining columns off the screen. This means the user would need scroll over to see additional columns. I generally think it is better to avoid additional key presses if possible.

5. tv is fast for large files. It does not have to read and format all of the data like vd. tv is focused more on looking at the file and not operating on file. It does not have to do as much as vd. That helps tv with what it is uniquely good at. "Do one thing and do it well"

It does not matter if your file is really wide (lots of columns) or really long -- tv will give the user a compact useful pretty print of the data. Why not use vd as a TUI spreadsheet and tv for glancing at csv files. They are both great tools in my eyes with different purposes.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#36

I spend a lot of time in the terminal and want to quickly glance at a csv files without making a new script, opening excel, or using a tui. I made tidy-viewer (tv) because current tools like cat and column were not pretty enough. tv modifies raw files in the following ways: 1. NA detection and highlighting 2. Printing only significant digits 3. Header and footer meta data I have been using this a lot at work. There i…

First of all - kudos on tackling this task - it is indeed very annoying to get CSVs to render nicely on a terminal. 1. How does tidy-viewer compare with csvlook? 2. Looking at the demo video, there seems to be an odd fixation with "N/A". The CSV spec, AFAIK, doesn't recognize this phrase. I don't understand why someone would expect a quoted string field whose raw characters are "n/a" should be rendered as anything ot…

The norm of treating missing data as NA exists in R (which the developer of this is clearly inspired by based on the GitHub readme.). Pandas in Python is stuck with NaN for numeric types (not quite correct) and "" or None for string types. Personally I like the choice to both explicitly render missing data in colour and to apply NA as a placeholder text to display that colour.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#37

I spend a lot of time in the terminal and want to quickly glance at a csv files without making a new script, opening excel, or using a tui. I made tidy-viewer (tv) because current tools like cat and column were not pretty enough. tv modifies raw files in the following ways: 1. NA detection and highlighting 2. Printing only significant digits 3. Header and footer meta data I have been using this a lot at work. There i…

The NA detection and higlighting is nice but I'm not sure how I feel about showing anything other than the exact textual value. I don't mind abridging quotes when they're not necessary, but showing "N/A", NA,, etc. as the same value is a bit iffy.

Re: Show HN: Tidy Viewer – a cross-platform CSV pretty printer for viewer enjoyment

#38
post #28

Earlier quoted context omitted.

And the use of cat on a single file..

I don't understand your comment - could you expand on it?

cat just regurgitates the contents of the file, but the resulting piped fd is non-seekable. Since almost every command that can operate on a file from stdin can also operate on the file by name/path, at best this is just a needless invocation of a process (i.e. `tv foo.csv` should have been used instead of `cat foo.csv | tv`) - if the app in question can't handle paths, then you can have the shell pipe the file into it instead (e.g. `tv https://github.com/neosmart/tac for how `cat foo | tac` requires buffering but both `tac foo` and even `tac < foo` don't).
Post reply on HN