diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..645078c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,18 @@ +{ + "cSpell.words": [ + "abcdefghijkl", + "abcdefghijklmnop", + "atsalolikhin", + "briandconnelly", + "colname", + "crossterm", + "floatlike", + "FOLDERID", + "gruv", + "gruvbox", + "spokeo", + "stdoutln", + "structopt", + "truecolor" + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index edecbcc..3d8321e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +1.4.6 (2022-7-23) +================== + +This update was mainly focused on feature enhancements. I also did some `clippy` formatting. + +* **Bug** [#141](https://github.com/alexhallam/tv/issues/141) Right alignment of row numbers might make it easier for users to quickly scan the output. + +I did not realize that I had the alignment wrong. I was doing left alignment, but it was brought to my attention that `tibble` uses right alignment. +This is now corrected. Thanks for the sharp eye @briandconnelly. + +* **Bug** [#140](https://github.com/alexhallam/tv/issues/140) `-n` option doesn't work when combined with `--extend-rows` + +This was a bug I was not aware of that I wanted to knock out. Thanks @atsalolikhin-spokeo for using this package and reporting the issue. Your +report made the cli a little better. + +* **Enhancement, Good first issue** [#139](https://github.com/alexhallam/tv/issues/139) Is it possible to turn off row numbering? + +As requested I implemented `-R`, `--no-row-numbering` for this functionality + +* **Enhancement, Good first issue** [#138](https://github.com/alexhallam/tv/issues/138) Is it possible to turn off dimensions printing? + +As requested I implemented `-D`, `--no-dimensions` for this functionality + 1.4.5 (2021-5-1) ================== @@ -20,7 +43,7 @@ I also did some clean up work. I removed a binary I was not using. * **Feature 1** Added forced color flag for color pager support [Issue #112](https://github.com/alexhallam/tv/issues/112) -I was not aware of this until @ismaelgv opened the issue. `less -R` and `bat -p` can do color comprehension. In previous versions of `tv` we just stripped the color if the output was piped to programs like less. Now the user can override this behaviour with a `-a` flag. +I was not aware of this until @ismaelgv opened the issue. `less -R` and `bat -p` can do color comprehension. In previous versions of `tv` we just stripped the color if the output was piped to programs like less. Now the user can override this behavior with a `-a` flag. 1.4.2 (2021-10-28) @@ -78,7 +101,7 @@ We also saw some code quality improvements in this release. [PR #82](https://git The version number jump was due to testing out github actions on automated releases using git tags as the release name. It took a few tries to get right. -* **Feature 1** Add package to snapcraft to increase accessibility. +* **Feature 1** Add package to `snapcraft` to increase accessibility. * [bug #55](https://github.com/alexhallam/tv/issues/55): fix panic on unicode string truncation * [BUG #40](https://github.com/alexhallam/tv/issues/30): @@ -96,18 +119,18 @@ This version was made possible by the contributions of @Lireer! Thank You! * [PR #40](https://github.com/alexhallam/tv/pull/40) Allow users to specify the deliminator with the `delimiter` option. * [PR #42](https://github.com/alexhallam/tv/pull/42) `clippy` warnings and code refactoring. -* [PR #41](https://github.com/alexhallam/tv/pull/41) change `.len()` to `.chars().count()` to avoid potential column widths if the calue contains code points consisting of multiple bytes. +* [PR #41](https://github.com/alexhallam/tv/pull/41) change `.len()` to `.chars().count()` to avoid potential column widths if the value contains code points consisting of multiple bytes. 0.0.12 (2021-09-09) ================== -* [BUG #33](https://github.com/alexhallam/tv/issues/33) Elipses used when NA should replace on unquoted string missingness #33 +* [BUG #33](https://github.com/alexhallam/tv/issues/33) Ellipses used when NA should replace on unquoted string missingness #33 This problem was caused by all of the columns being width 1. When width is 1 the length of the string "NA" is 2. Since 2 was greater -than 1 NA was converted to elipses. To fix this problem I added a min width of 2 and while I was at it I includeed a new option `lower-column-width` +than 1 NA was converted to ellipses. To fix this problem I added a min width of 2 and while I was at it I included a new option `lower-column-width` * [BUG #32](https://github.com/alexhallam/tv/issues/32) Column with integer 1 and 0 returns NaN for 0. This bug was caused by logging 0s. I added a condition on the sigfig decision tree to fix. * **Feature 1** `lower-column-width`: `The lower (minimum) width of columns. Must be 2 or larger. Default 2. ` -* **Feature 2** `upper-column-width`: `The upper (maxiumum) width of columns. Default 20.` -* **Feature 2** `debug-mode`: `Print object details to make it easier for the maintainer to find and resolve bugs.` This is to save me time in the futre :smile: +* **Feature 2** `upper-column-width`: `The upper (maximum) width of columns. Default 20.` +* **Feature 2** `debug-mode`: `Print object details to make it easier for the maintainer to find and resolve bugs.` This is to save me time in the future :smile: 0.0.10 (2021-08-05) ================== diff --git a/Cargo.lock b/Cargo.lock index e2ee7ca..14e1fdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "tidy-viewer" -version = "1.4.5" +version = "1.4.6" dependencies = [ "atty", "calm_io", diff --git a/Cargo.toml b/Cargo.toml index 05795da..073b252 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,17 +3,35 @@ authors = ["alexhallam "] categories = ["command-line-utilities"] description = "Head, but for CSV files and with color" edition = "2021" -keywords = ["csv", "pretty-print", "data-viewer", "tv", "tabular-data-viewer", "csv-viewer", "csv-pretty-print", "csv-cat", "csv-column"] +keywords = [ + "csv", + "pretty-print", + "data-viewer", + "tv", + "tabular-data-viewer", + "csv-viewer", + "csv-pretty-print", + "csv-cat", + "csv-column", +] license = "Unlicense/MIT" name = "tidy-viewer" readme = "README.md" repository = "https://github.com/alexhallam/tv" -version = "1.4.5" +version = "1.4.6" [package.metadata.deb] assets = [ - ["target/release/tidy-viewer", "usr/bin/", "755"], - ["README.md", "usr/share/doc/cargo-deb/README", "644"], + [ + "target/release/tidy-viewer", + "usr/bin/", + "755", + ], + [ + "README.md", + "usr/share/doc/cargo-deb/README", + "644", + ], ] depends = "$auto" extended-description = """\ @@ -36,7 +54,7 @@ itertools = "0.10.0" lazy_static = "1.4.0" owo-colors = "3.0.1" regex = "1.5.4" -serde = {version = "1.0", features = ["derive"]} +serde = { version = "1.0", features = ["derive"] } structopt = "0.3.21" toml = "0.5" unicode-truncate = "0.2.0" diff --git a/README.md b/README.md index 649b298..db40235 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ cat diamonds.csv | tv ```sh wget https://raw.githubusercontent.com/tidyverse/dplyr/master/data-raw/starwars.csv -# Pass as agrument +# Pass as argument tv starwars.csv ``` @@ -148,10 +148,10 @@ tv titanic.csv -a -n 1000 | bat -p Choosing the sigfigs amounts to how much of the value of a number is desired. The table below shows an example calculation with variable sigfigs. | sigfigs | value | sigfiged_value | %value_of_the_number_explained_by_sigfiged_vale | -|---------|--------|----------------|:-----------------------------------------------:| -| 1 | 0.1119 | 0.1 | >89% | -| 2 | 0.1119 | 0.11 | >98% | -| 3 | 0.1119 | 0.111 | >99% | +| ------- | ------ | -------------- | :---------------------------------------------: | +| 1 | 0.1119 | 0.1 | >89% | +| 2 | 0.1119 | 0.11 | >98% | +| 3 | 0.1119 | 0.111 | >99% | `tv` uses the same significant figure (sigfig) rules that the R package `pillar` uses. @@ -226,7 +226,7 @@ There are only 4 outputs possible. The significant figures to display are set by ```text -# Psuedo Code: Sigfig logic assuming sigfig = 3 +# Pseudo Code: Sigfig logic assuming sigfig = 3 if lhs == 0: n = ((floor(log10(abs(x))) + 1 - sigfig) r =(10^n) * round(x / (10^n)) @@ -308,12 +308,13 @@ For information on dotfile configuration see `tv --help`. This allows users to s `tv --help` ```txt -tv 1.4.5 +tv 1.4.6 Tidy Viewer (tv) is a csv pretty printer that uses column styling to maximize viewer enjoyment.✨✨📺✨✨ Example Usage: wget https://raw.githubusercontent.com/tidyverse/ggplot2/master/data-raw/diamonds.csv cat diamonds.csv | head -n 35 | tv + tv diamonds.csv Configuration File Support: An example config is printed to make it easy to copy/paste to `tv.toml`. @@ -337,9 +338,10 @@ Tidy Viewer (tv) is a csv pretty printer that uses column styling to maximize vi #lower_column_width = 2 ## head number of rows to output [default: 25] #number = 35 - ## extend rows beyond term width (do not trucate) [default: false] - # extend_rows = true - ## meta_color = [R,G,B] color for row index and "tv dim: rowsxcols" + ## extend width and length in terms of the number of rows and columns displayed beyond term width [default: +false] + # extend_width_and_length = true + ## meta_color = [R,G,B] color for row index and "tv dim: rows x cols" #meta_color = [64, 179, 162] ## header_color = [R,G,B] color for column headers #header_color = [232, 168, 124] @@ -354,12 +356,14 @@ USAGE: tidy-viewer [FLAGS] [OPTIONS] [FILE] FLAGS: - -d, --debug-mode Print object details to make it easier for the maintainer to find and resolve bugs. - -e, --extend-rows Extended row beyond term width (do not truncate). Useful with `less -S`. - -a, --color-always Always force color output. Example `tv -a starwars.csv | less -R` or `tv -a starwars.csv | bat - -p`. The `less` cli has the `-R` flag to parse colored output. - -h, --help Prints help information - -V, --version Prints version information + -d, --debug-mode Print object details to make it easier for the maintainer to find and resolve bugs. + -e, --extend-width-and-length Extended width beyond term width (do not truncate). Useful with `less -S`. + -a, --color-always Always force color output. Example `tv -a starwars.csv | less -R` or `tv -a + starwars.csv | bat -p`. The `less` cli has the `-R` flag to parse colored output. + -h, --help Prints help information + -D, --no-dimensions Turns off dimensions of the data + -R, --no-row-numbering Turns off row numbering + -V, --version Prints version information OPTIONS: -c, --color @@ -368,7 +372,7 @@ OPTIONS: (2)one_dark (3)gruvbox (4)dracula - (5)solarized light + (5)solarized light [default: 0] -s, --delimiter The delimiter separating the columns. -f, --footer