CLI tool for displaying table

Related tags

Command-line tv
Overview

tv

Format json into table display

$ cat test.json
[
  {
    "name": "test",
    "age": 10,
    "lang": "ja"
  },
  {
    "name": "uzimaru",
    "age": 23,
    "lang": "ja"
  },
  {
    "name": "hogehoge",
    "age": 21,
    "lang": "en"
  },
  {
    "name": "hugehuge",
    "age": 32,
    "lang": "en"
  }
]

$ tv test.json
|age|lang|    name|
|---|----|--------|
| 10|  ja|    test|
| 23|  ja| uzimaru|
| 21|  en|hogehoge|
| 32|  en|hugehuge|

How to install

For MacOS

$ brew install uzimaru0000/tap/tv
Comments
  • Error: unsupported format

    Error: unsupported format

    Caused by:

    invalid type: map, expected a sequence at line 1 column 0

    Suspicious reason

    It seems to happen when returned JSON has no line breaks.

    Experiments

    According to Your page

    The sample API provided in your article on Zenn

    curl -s https://jsonplaceholder.typicode.com/users

    [
      {
        "id": 1,
        "name": "Leanne Graham",
        "username": "Bret",
        "email": "[email protected]",
        "address": {
          "street": "Kulas Light",
          "suite": "Apt. 556",
          "city": "Gwenborough",
          "zipcode": "92998-3874",
          "geo": {
            "lat": "-37.3159",
            "lng": "81.1496"
          }
        },
        "phone": "1-770-736-8031 x56442",
        "website": "hildegard.org",
        "company": {
          "name": "Romaguera-Crona",
          "catchPhrase": "Multi-layered client-server neural-net",
          "bs": "harness real-time e-markets"
        }
      },
      {
        "id": 2,
        "name": "Ervin Howell",
        "username": "Antonette",
        "email": "[email protected]",
        "address": {
          "street": "Victor Plains",
          "suite": "Suite 879",
          "city": "Wisokyburgh",
          "zipcode": "90566-7771",
          "geo": {
            "lat": "-43.9509",
            "lng": "-34.4618"
          }
        },
        "phone": "010-692-6593 x09125",
        "website": "anastasia.net",
        "company": {
          "name": "Deckow-Crist",
          "catchPhrase": "Proactive didactic contingency",
          "bs": "synergize scalable supply-chains"
        }
      },
      {
        "id": 3,
        "name": "Clementine Bauch",
        "username": "Samantha",
        "email": "[email protected]",
        "address": {
          "street": "Douglas Extension",
          "suite": "Suite 847",
          "city": "McKenziehaven",
          "zipcode": "59590-4157",
          "geo": {
            "lat": "-68.6102",
            "lng": "-47.0653"
          }
        },
        "phone": "1-463-123-4447",
        "website": "ramiro.info",
        "company": {
          "name": "Romaguera-Jacobson",
          "catchPhrase": "Face to face bifurcated interface",
          "bs": "e-enable strategic applications"
        }
      },
      {
        "id": 4,
        "name": "Patricia Lebsack",
        "username": "Karianne",
        "email": "[email protected]",
        "address": {
          "street": "Hoeger Mall",
          "suite": "Apt. 692",
          "city": "South Elvis",
          "zipcode": "53919-4257",
          "geo": {
            "lat": "29.4572",
            "lng": "-164.2990"
          }
        },
        "phone": "493-170-9623 x156",
        "website": "kale.biz",
        "company": {
          "name": "Robel-Corkery",
          "catchPhrase": "Multi-tiered zero tolerance productivity",
          "bs": "transition cutting-edge web services"
        }
      },
      {
        "id": 5,
        "name": "Chelsey Dietrich",
        "username": "Kamren",
        "email": "[email protected]",
        "address": {
          "street": "Skiles Walks",
          "suite": "Suite 351",
          "city": "Roscoeview",
          "zipcode": "33263",
          "geo": {
            "lat": "-31.8129",
            "lng": "62.5342"
          }
        },
        "phone": "(254)954-1289",
        "website": "demarco.info",
        "company": {
          "name": "Keebler LLC",
          "catchPhrase": "User-centric fault-tolerant solution",
          "bs": "revolutionize end-to-end systems"
        }
      },
      {
        "id": 6,
        "name": "Mrs. Dennis Schulist",
        "username": "Leopoldo_Corkery",
        "email": "[email protected]",
        "address": {
          "street": "Norberto Crossing",
          "suite": "Apt. 950",
          "city": "South Christy",
          "zipcode": "23505-1337",
          "geo": {
            "lat": "-71.4197",
            "lng": "71.7478"
          }
        },
        "phone": "1-477-935-8478 x6430",
        "website": "ola.org",
        "company": {
          "name": "Considine-Lockman",
          "catchPhrase": "Synchronised bottom-line interface",
          "bs": "e-enable innovative applications"
        }
      },
      {
        "id": 7,
        "name": "Kurtis Weissnat",
        "username": "Elwyn.Skiles",
        "email": "[email protected]",
        "address": {
          "street": "Rex Trail",
          "suite": "Suite 280",
          "city": "Howemouth",
          "zipcode": "58804-1099",
          "geo": {
            "lat": "24.8918",
            "lng": "21.8984"
          }
        },
        "phone": "210.067.6132",
        "website": "elvis.io",
        "company": {
          "name": "Johns Group",
          "catchPhrase": "Configurable multimedia task-force",
          "bs": "generate enterprise e-tailers"
        }
      },
      {
        "id": 8,
        "name": "Nicholas Runolfsdottir V",
        "username": "Maxime_Nienow",
        "email": "[email protected]",
        "address": {
          "street": "Ellsworth Summit",
          "suite": "Suite 729",
          "city": "Aliyaview",
          "zipcode": "45169",
          "geo": {
            "lat": "-14.3990",
            "lng": "-120.7677"
          }
        },
        "phone": "586.493.6943 x140",
        "website": "jacynthe.com",
        "company": {
          "name": "Abernathy Group",
          "catchPhrase": "Implemented secondary concept",
          "bs": "e-enable extensible e-tailers"
        }
      },
      {
        "id": 9,
        "name": "Glenna Reichert",
        "username": "Delphine",
        "email": "[email protected]",
        "address": {
          "street": "Dayna Park",
          "suite": "Suite 449",
          "city": "Bartholomebury",
          "zipcode": "76495-3109",
          "geo": {
            "lat": "24.6463",
            "lng": "-168.8889"
          }
        },
        "phone": "(775)976-6794 x41206",
        "website": "conrad.com",
        "company": {
          "name": "Yost and Sons",
          "catchPhrase": "Switchable contextually-based project",
          "bs": "aggregate real-time technologies"
        }
      },
      {
        "id": 10,
        "name": "Clementina DuBuque",
        "username": "Moriah.Stanton",
        "email": "[email protected]",
        "address": {
          "street": "Kattie Turnpike",
          "suite": "Suite 198",
          "city": "Lebsackbury",
          "zipcode": "31428-2261",
          "geo": {
            "lat": "-38.2386",
            "lng": "57.2232"
          }
        },
        "phone": "024-648-3804",
        "website": "ambrose.net",
        "company": {
          "name": "Hoeger LLC",
          "catchPhrase": "Centralized empowering task-force",
          "bs": "target end-to-end models"
        }
      }
    ]%
    

    curl -s https://jsonplaceholder.typicode.com/users | tv

    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+ |id|name |username |email |address|phone |website |company| +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+ |1 |Leanne Graham |Bret |[email protected] |... |1-770-736-8031 x56442|hildegard.org|... | |2 |Ervin Howell |Antonette |[email protected] |... |010-692-6593 x09125 |anastasia.net|... | |3 |Clementine Bauch |Samantha |[email protected] |... |1-463-123-4447 |ramiro.info |... | |4 |Patricia Lebsack |Karianne |[email protected]|... |493-170-9623 x156 |kale.biz |... | |5 |Chelsey Dietrich |Kamren |[email protected] |... |(254)954-1289 |demarco.info |... | |6 |Mrs. Dennis Schulist |Leopoldo_Corkery|[email protected] |... |1-477-935-8478 x6430 |ola.org |... | |7 |Kurtis Weissnat |Elwyn.Skiles |[email protected] |... |210.067.6132 |elvis.io |... | |8 |Nicholas Runolfsdottir V|Maxime_Nienow |[email protected] |... |586.493.6943 x140 |jacynthe.com |... | |9 |Glenna Reichert |Delphine |[email protected] |... |(775)976-6794 x41206 |conrad.com |... | |10|Clementina DuBuque |Moriah.Stanton |[email protected] |... |024-648-3804 |ambrose.net |... | +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+

    My target

    When getting JSON from my target, Hymnary

    curl "https://hymnary.org/api/scripture?book=Genesis&fromChapter=3&fromVerse=1&toChapter=3&toVerse=24"

    curl "curl "https://hymnary.org/api/scripture?book=Genesis&fromChapter=3&fromVerse=1&toChapter=3&toVerse=24"
    {"Break forth, O beauteous heavenly light":{"title":"Break Forth, O Beauteous Heavenly Light","meter":"8 7 8 7 8 8 7 7","text link":"https:\/\/hymnary.org\/text\/break_forth_o_beauteous_heavenly_light","number of hymnals":"53","scripture references":"Genesis 3:15;  Genesis 3:8-15","author":"Rist, Johann, 1607-1667","translator":"Troutbeck, J. (John), 1832-1899"},"Christ the Victorious, give to your servants":{"title":"Christ the Victorious, Give to Your Servants","meter":"11 10. 11 9","text link":"https:\/\/hymnary.org\/text\/christ_the_victorious_give_to_your_serva","number of hymnals":"10","scripture references":"Genesis 3:19","author":"Daw, Carl P. Jr., 1944-"},"How sweet was the garden, fertile and fair":{"title":"How Sweet Was the Garden, Fertile and Fair","meter":"10.10.11.11","text link":"https:\/\/hymnary.org\/text\/how_sweet_was_the_garden_fertile_and_fai","number of hymnals":"1","scripture references":"Genesis 3:1-19;  Genesis 2:8 - 3:1","author":"Daw, Carl P. Jr., 1944-"},"I come to the garden alone":{"title":"In the Garden","meter":"8.9.10.7 with refrain","text link":"https:\/\/hymnary.org\/text\/i_come_to_the_garden_alone","number of hymnals":"237","scripture references":"Genesis 3:8","author":"Miles, C. Austin (Charles Austin), 1868-1946"},"Joy to the world! the Lord is come!":{"title":"Joy to the world! the Lord is come!","meter":"8.6.8.6.","text link":"https:\/\/hymnary.org\/text\/joy_to_the_world_the_lord_is_come","number of hymnals":"1752","scripture references":"Genesis 3:17-19;  Genesis 3:17-18","author":"Watts, Isaac, 1674-1748"},"O Christ, the healer, we have come":{"title":"O Christ, the Healer","meter":"LM","text link":"https:\/\/hymnary.org\/text\/o_christ_the_healer_we_have_come","number of hymnals":"35","scripture references":"Genesis 3:17-19","author":"Green, Fred Pratt, 1903-2000"},"Praise the Savior Now and ever (Wallin)":{"title":"Praise the Savior","meter":"4 4 7 4 4 7 4 4 7","text link":"https:\/\/hymnary.org\/text\/praise_the_savior_now_and_ever_wallin","number of hymnals":"20","scripture references":"Genesis 3:15","author":"Fortunatus, Venantius Honorius Clementianus, ca. 540-ca. 600","translator":"Wallin, Johan Olof, 1779-1839"},"Sing, choirs of new Jerusalem":{"title":"Sing, Choirs of New Jerusalem","meter":"8.6.8.6. with repeats","original language":"Latin","text link":"https:\/\/hymnary.org\/text\/sing_choirs_of_new_jerusalem","number of hymnals":"61","scripture references":"Genesis 3:15","author":"Fulbert, Saint, Bishop of Chartres, ca 960-1028","translator":"Campbell, Robert, 1814-1868"},"Sing, my tongue, the Savior's glory, Tell his triumph far and wide":{"title":"Sing, my tongue, the Saviour's battle","meter":"8.7.8.7.8.7.","text link":"https:\/\/hymnary.org\/text\/sing_my_tongue_the_saviors_glory_tell_hi","number of hymnals":"41","scripture references":"Genesis 3:6","translator":"Caswall, Edward, 1814-1878","author":"Fortunatus, Venantius Honorius Clementianus, ca. 540-ca. 600"},"Surely, you alone can save us":{"title":"Sign Us with Ashes","date":"2013","meter":"LM with refrain","text link":"https:\/\/hymnary.org\/text\/surely_you_alone_can_save_us","number of hymnals":"5","scripture references":"Genesis 3:19","author":"Bringle, Mary Louise, 1953-"},"There in God's garden stands the Tree of Wisdom":{"title":"There in God's Garden","meter":"11 11 11 5","text link":"https:\/\/hymnary.org\/text\/there_in_gods_garden_stands_the_tree_of","number of hymnals":"14","scripture references":"Genesis 3:7","author":"von P\u00e9cselyi, Kir\u00e1ly Imre, c.1590-c.1641","translator":"Routley, Erik, 1917-1982"},"This is my Father's world And to my listening ears":{"title":"This Is My Father's World","meter":"6.6.8.6. D.","text link":"https:\/\/hymnary.org\/text\/this_is_my_fathers_world_and_to_my","number of hymnals":"294","scripture references":"Genesis 3;  Genesis 3:8-15","author":"Babcock, Maltbie D. (Maltbie Davenport), 1858-1901"},"What Adam's disobedience cost":{"title":"What Adam's Disobedience Cost","meter":"8.6.7.6.6","text link":"https:\/\/hymnary.org\/text\/what_adams_disobedience_cost","number of hymnals":"6","scripture references":"Genesis 3:1-8;  Genesis 3:14-24","author":"Green, Fred Pratt, 1903-2000"}}%
    [masarukitajima@localhost /Users/masarukitajima:] $ curl "https://hymnary.org/api/scripture?book=Genesis&fromChapter=3&fromVerse=1&toChapter=3&toVerse=24"
    
    {"Break forth, O beauteous heavenly light":{"title":"Break Forth, O Beauteous Heavenly Light","meter":"8 7 8 7 8 8 7 7","text link":"https:\/\/hymnary.org\/text\/break_forth_o_beauteous_heavenly_light","number of hymnals":"53","scripture references":"Genesis 3:15;  Genesis 3:8-15","author":"Rist, Johann, 1607-1667","translator":"Troutbeck, J. (John), 1832-1899"},"Christ the Victorious, give to your servants":{"title":"Christ the Victorious, Give to Your Servants","meter":"11 10. 11 9","text link":"https:\/\/hymnary.org\/text\/christ_the_victorious_give_to_your_serva","number of hymnals":"10","scripture references":"Genesis 3:19","author":"Daw, Carl P. Jr., 1944-"},"How sweet was the garden, fertile and fair":{"title":"How Sweet Was the Garden, Fertile and Fair","meter":"10.10.11.11","text link":"https:\/\/hymnary.org\/text\/how_sweet_was_the_garden_fertile_and_fai","number of hymnals":"1","scripture references":"Genesis 3:1-19;  Genesis 2:8 - 3:1","author":"Daw, Carl P. Jr., 1944-"},"I come to the garden alone":{"title":"In the Garden","meter":"8.9.10.7 with refrain","text link":"https:\/\/hymnary.org\/text\/i_come_to_the_garden_alone","number of hymnals":"237","scripture references":"Genesis 3:8","author":"Miles, C. Austin (Charles Austin), 1868-1946"},"Joy to the world! the Lord is come!":{"title":"Joy to the world! the Lord is come!","meter":"8.6.8.6.","text link":"https:\/\/hymnary.org\/text\/joy_to_the_world_the_lord_is_come","number of hymnals":"1752","scripture references":"Genesis 3:17-19;  Genesis 3:17-18","author":"Watts, Isaac, 1674-1748"},"O Christ, the healer, we have come":{"title":"O Christ, the Healer","meter":"LM","text link":"https:\/\/hymnary.org\/text\/o_christ_the_healer_we_have_come","number of hymnals":"35","scripture references":"Genesis 3:17-19","author":"Green, Fred Pratt, 1903-2000"},"Praise the Savior Now and ever (Wallin)":{"title":"Praise the Savior","meter":"4 4 7 4 4 7 4 4 7","text link":"https:\/\/hymnary.org\/text\/praise_the_savior_now_and_ever_wallin","number of hymnals":"20","scripture references":"Genesis 3:15","author":"Fortunatus, Venantius Honorius Clementianus, ca. 540-ca. 600","translator":"Wallin, Johan Olof, 1779-1839"},"Sing, choirs of new Jerusalem":{"title":"Sing, Choirs of New Jerusalem","meter":"8.6.8.6. with repeats","original language":"Latin","text link":"https:\/\/hymnary.org\/text\/sing_choirs_of_new_jerusalem","number of hymnals":"61","scripture references":"Genesis 3:15","author":"Fulbert, Saint, Bishop of Chartres, ca 960-1028","translator":"Campbell, Robert, 1814-1868"},"Sing, my tongue, the Savior's glory, Tell his triumph far and wide":{"title":"Sing, my tongue, the Saviour's battle","meter":"8.7.8.7.8.7.","text link":"https:\/\/hymnary.org\/text\/sing_my_tongue_the_saviors_glory_tell_hi","number of hymnals":"41","scripture references":"Genesis 3:6","translator":"Caswall, Edward, 1814-1878","author":"Fortunatus, Venantius Honorius Clementianus, ca. 540-ca. 600"},"Surely, you alone can save us":{"title":"Sign Us with Ashes","date":"2013","meter":"LM with refrain","text link":"https:\/\/hymnary.org\/text\/surely_you_alone_can_save_us","number of hymnals":"5","scripture references":"Genesis 3:19","author":"Bringle, Mary Louise, 1953-"},"There in God's garden stands the Tree of Wisdom":{"title":"There in God's Garden","meter":"11 11 11 5","text link":"https:\/\/hymnary.org\/text\/there_in_gods_garden_stands_the_tree_of","number of hymnals":"14","scripture references":"Genesis 3:7","author":"von P\u00e9cselyi, Kir\u00e1ly Imre, c.1590-c.1641","translator":"Routley, Erik, 1917-1982"},"This is my Father's world And to my listening ears":{"title":"This Is My Father's World","meter":"6.6.8.6. D.","text link":"https:\/\/hymnary.org\/text\/this_is_my_fathers_world_and_to_my","number of hymnals":"294","scripture references":"Genesis 3;  Genesis 3:8-15","author":"Babcock, Maltbie D. (Maltbie Davenport), 1858-1901"},"What Adam's disobedience cost":{"title":"What Adam's Disobedience Cost","meter":"8.6.7.6.6","text link":"https:\/\/hymnary.org\/text\/what_adams_disobedience_cost","number of hymnals":"6","scripture references":"Genesis 3:1-8;  Genesis 3:14-24","author":"Green, Fred Pratt, 1903-2000"}}%
    

    curl -s "https://hymnary.org/api/scripture?book=Genesis&fromChapter=3&fromVerse=1&toChapter=3&toVerse=24" | tv -r

    Error: unsupported format
    
    Caused by:
        invalid type: map, expected a sequence at line 1 column 0
    
    opened by MasaruKitajima 5
  • Do you mean

    Do you mean "plain" instead of "plane"?

    In the styling options, do you actually mean "plain" instead of "plane"?

    cf https://ejje.weblio.jp/content/plain "装飾のない"

    cf https://ejje.weblio.jp/content/plane "平らな"

    opened by tanquar 3
  • [Brew] No such file or directory - completions/zsh/_tv

    [Brew] No such file or directory - completions/zsh/_tv

    Seems there's either an issue with a tv.rb or the way the release zip is created

    Basically the directory in the zip is currently flat and looks like

    tv-x86_64-apple-darwin
    ├── LICENSE
    ├── README.md
    ├── _tv
    ├── tv
    ├── tv.bash
    ├── tv.d
    └── tv.fish
    
    opened by mrmikeface 2
  • Bad version in `Cargo.lock` for 0.2.0

    Bad version in `Cargo.lock` for 0.2.0

    Just a note that the Cargo.lock in the 0.2.0 branch of tv has tv's version set to 0.1.2:

    https://github.com/uzimaru0000/tv/blob/768f9afe7732d0a93e219c9bac5e08d1e9ecdd86/Cargo.lock#L392

    Something to watch out for in future releases.

    opened by herbygillot 2
  • :sparkles: Add an option to pick any field

    :sparkles: Add an option to pick any field

    Add --pick option to pick any field

    $ tv  example.json -p address 
    +-----------------+---------+--------------+----------+---+
    |street           |suite    |city          |zipcode   |geo|
    +-----------------+---------+--------------+----------+---+
    |Kulas Light      |Apt. 556 |Gwenborough   |92998-3874|...|
    |Victor Plains    |Suite 879|Wisokyburgh   |90566-7771|...|
    |Douglas Extension|Suite 847|McKenziehaven |59590-4157|...|
    |Hoeger Mall      |Apt. 692 |South Elvis   |53919-4257|...|
    |Skiles Walks     |Suite 351|Roscoeview    |33263     |...|
    |Norberto Crossing|Apt. 950 |South Christy |23505-1337|...|
    |Rex Trail        |Suite 280|Howemouth     |58804-1099|...|
    |Ellsworth Summit |Suite 729|Aliyaview     |45169     |...|
    |Dayna Park       |Suite 449|Bartholomebury|76495-3109|...|
    |Kattie Turnpike  |Suite 198|Lebsackbury   |31428-2261|...|
    +-----------------+---------+--------------+----------+---+
    

    Can use nested field

    $ tv example.json -p address.geo
    +--------+---------+
    |lat     |lng      |
    +--------+---------+
    |-37.3159|81.1496  |
    |-43.9509|-34.4618 |
    |-68.6102|-47.0653 |
    |29.4572 |-164.2990|
    |-31.8129|62.5342  |
    |-71.4197|71.7478  |
    |24.8918 |21.8984  |
    |-14.3990|-120.7677|
    |24.6463 |-168.8889|
    |-38.2386|57.2232  |
    +--------+---------+
    
    opened by uzimaru0000 0
  • :bug: fix header border in markdown style

    :bug: fix header border in markdown style

    In current

    $ tv example.json --style markdown -a center 
    |id|          name          |    username    |          email          |address|        phone        |   website   |company|
    |--|------------------------|----------------|-------------------------|-------|---------------------|-------------|-------|
    | 1|      Leanne Graham     |      Bret      |    [email protected]    |  ...  |1-770-736-8031 x56442|hildegard.org|  ...  |
    | 2|      Ervin Howell      |    Antonette   |    [email protected]    |  ...  | 010-692-6593 x09125 |anastasia.net|  ...  |
    | 3|    Clementine Bauch    |    Samantha    |    [email protected]   |  ...  |    1-463-123-4447   | ramiro.info |  ...  |
    | 4|    Patricia Lebsack    |    Karianne    |[email protected]|  ...  |  493-170-9623 x156  |   kale.biz  |  ...  |
    | 5|    Chelsey Dietrich    |     Kamren     | [email protected]|  ...  |    (254)954-1289    | demarco.info|  ...  |
    | 6|  Mrs. Dennis Schulist  |Leopoldo_Corkery| [email protected] |  ...  | 1-477-935-8478 x6430|   ola.org   |  ...  |
    | 7|     Kurtis Weissnat    |  Elwyn.Skiles  |  [email protected] |  ...  |     210.067.6132    |   elvis.io  |  ...  |
    | 8|Nicholas Runolfsdottir V|  Maxime_Nienow |   [email protected]  |  ...  |  586.493.6943 x140  | jacynthe.com|  ...  |
    | 9|     Glenna Reichert    |    Delphine    | [email protected] |  ...  | (775)976-6794 x41206|  conrad.com |  ...  |
    |10|   Clementina DuBuque   | Moriah.Stanton |  [email protected] |  ...  |     024-648-3804    | ambrose.net |  ...  |
    

    Markdown center is not applied

    opened by uzimaru0000 0
  • Not sorted when -r option

    Not sorted when -r option

    $ tv -r example.json
    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+
    |id|name                    |username        |email                    |address|phone                |website      |company|
    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+
    |1 |Leanne Graham           |Bret            |[email protected]        |...    |1-770-736-8031 x56442|hildegard.org|...    |
    |2 |Ervin Howell            |Antonette       |[email protected]        |...    |010-692-6593 x09125  |anastasia.net|...    |
    |3 |Clementine Bauch        |Samantha        |[email protected]       |...    |1-463-123-4447       |ramiro.info  |...    |
    |4 |Patricia Lebsack        |Karianne        |[email protected]|...    |493-170-9623 x156    |kale.biz     |...    |
    |5 |Chelsey Dietrich        |Kamren          |[email protected] |...    |(254)954-1289        |demarco.info |...    |
    |6 |Mrs. Dennis Schulist    |Leopoldo_Corkery|[email protected]  |...    |1-477-935-8478 x6430 |ola.org      |...    |
    |7 |Kurtis Weissnat         |Elwyn.Skiles    |[email protected]   |...    |210.067.6132         |elvis.io     |...    |
    |8 |Nicholas Runolfsdottir V|Maxime_Nienow   |[email protected]     |...    |586.493.6943 x140    |jacynthe.com |...    |
    |9 |Glenna Reichert         |Delphine        |[email protected]  |...    |(775)976-6794 x41206 |conrad.com   |...    |
    |10|Clementina DuBuque      |Moriah.Stanton  |[email protected]   |...    |024-648-3804         |ambrose.net  |...    |
    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+
    
    # address
    +-----------------+---------+--------------+----------+---+
    |street           |suite    |city          |zipcode   |geo|
    +-----------------+---------+--------------+----------+---+
    |Kulas Light      |Apt. 556 |Gwenborough   |92998-3874|...|
    |Victor Plains    |Suite 879|Wisokyburgh   |90566-7771|...|
    |Douglas Extension|Suite 847|McKenziehaven |59590-4157|...|
    |Hoeger Mall      |Apt. 692 |South Elvis   |53919-4257|...|
    |Skiles Walks     |Suite 351|Roscoeview    |33263     |...|
    |Norberto Crossing|Apt. 950 |South Christy |23505-1337|...|
    |Rex Trail        |Suite 280|Howemouth     |58804-1099|...|
    |Ellsworth Summit |Suite 729|Aliyaview     |45169     |...|
    |Dayna Park       |Suite 449|Bartholomebury|76495-3109|...|
    |Kattie Turnpike  |Suite 198|Lebsackbury   |31428-2261|...|
    +-----------------+---------+--------------+----------+---+
    
    .......
    $ tv -r --sort username example.json
    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+
    |id|name                    |username        |email                    |address|phone                |website      |company|
    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+
    |2 |Ervin Howell            |Antonette       |[email protected]        |...    |010-692-6593 x09125  |anastasia.net|...    |
    |1 |Leanne Graham           |Bret            |[email protected]        |...    |1-770-736-8031 x56442|hildegard.org|...    |
    |9 |Glenna Reichert         |Delphine        |[email protected]  |...    |(775)976-6794 x41206 |conrad.com   |...    |
    |7 |Kurtis Weissnat         |Elwyn.Skiles    |[email protected]   |...    |210.067.6132         |elvis.io     |...    |
    |5 |Chelsey Dietrich        |Kamren          |[email protected] |...    |(254)954-1289        |demarco.info |...    |
    |4 |Patricia Lebsack        |Karianne        |[email protected]|...    |493-170-9623 x156    |kale.biz     |...    |
    |6 |Mrs. Dennis Schulist    |Leopoldo_Corkery|[email protected]  |...    |1-477-935-8478 x6430 |ola.org      |...    |
    |8 |Nicholas Runolfsdottir V|Maxime_Nienow   |[email protected]     |...    |586.493.6943 x140    |jacynthe.com |...    |
    |10|Clementina DuBuque      |Moriah.Stanton  |[email protected]   |...    |024-648-3804         |ambrose.net  |...    |
    |3 |Clementine Bauch        |Samantha        |[email protected]       |...    |1-463-123-4447       |ramiro.info  |...    |
    +--+------------------------+----------------+-------------------------+-------+---------------------+-------------+-------+
    
    # address
    +-----------------+---------+--------------+----------+---+
    |street           |suite    |city          |zipcode   |geo|
    +-----------------+---------+--------------+----------+---+
    |Kulas Light      |Apt. 556 |Gwenborough   |92998-3874|...|
    |Victor Plains    |Suite 879|Wisokyburgh   |90566-7771|...|
    |Douglas Extension|Suite 847|McKenziehaven |59590-4157|...|
    |Hoeger Mall      |Apt. 692 |South Elvis   |53919-4257|...|
    |Skiles Walks     |Suite 351|Roscoeview    |33263     |...|
    |Norberto Crossing|Apt. 950 |South Christy |23505-1337|...|
    |Rex Trail        |Suite 280|Howemouth     |58804-1099|...|
    |Ellsworth Summit |Suite 729|Aliyaview     |45169     |...|
    |Dayna Park       |Suite 449|Bartholomebury|76495-3109|...|
    |Kattie Turnpike  |Suite 198|Lebsackbury   |31428-2261|...|
    +-----------------+---------+--------------+----------+---+
    
    ......
    

    address is not sorted. The correct display is when the values corresponding to the table above are sorted.

    opened by uzimaru0000 0
  • :sparkles: add recursive view

    :sparkles: add recursive view

    adding recursive view resolved #28

    However, it does not implement the join function as in # 28. This is because the display will be strange if there are similar keys in the nested fields.

    opened by uzimaru0000 0
  • Key order

    Key order

    Is it better to reproduce the order of the fields of json in the display order?

    [
      {
        "id": 1,
        "name": "Leanne Graham",
        "username": "Bret",
        "email": "[email protected]",
        "address": {
          "street": "Kulas Light",
          "suite": "Apt. 556",
          "city": "Gwenborough",
          "zipcode": "92998-3874",
          "geo": {
            "lat": "-37.3159",
            "lng": "81.1496"
          }
        },
        "phone": "1-770-736-8031 x56442",
        "website": "hildegard.org",
        "company": {
          "name": "Romaguera-Crona",
          "catchPhrase": "Multi-layered client-server neural-net",
          "bs": "harness real-time e-markets"
        }
      }
    ]
    

    In the json example above...

    1. id
    2. name
    3. username
    4. email
    5. address
    6. phone
    7. website
    8. company

    Currently sorting the keys.

    opened by uzimaru0000 0
  • Recursive display

    Recursive display

    I want to be able to recursively display when an array or object comes into a field. The image is as below.

    $ cat test.json | tv
    +-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
    |address|company|email                    |id|name                    |phone                |username        |website      |
    +-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
    |...    |...    |[email protected]        |1 |Leanne Graham           |1-770-736-8031 x56442|Bret            |hildegard.org|
    |...    |...    |[email protected]        |2 |Ervin Howell            |010-692-6593 x09125  |Antonette       |anastasia.net|
    |...    |...    |[email protected]       |3 |Clementine Bauch        |1-463-123-4447       |Samantha        |ramiro.info  |
    |...    |...    |[email protected]|4 |Patricia Lebsack        |493-170-9623 x156    |Karianne        |kale.biz     |
    |...    |...    |[email protected] |5 |Chelsey Dietrich        |(254)954-1289        |Kamren          |demarco.info |
    |...    |...    |[email protected]  |6 |Mrs. Dennis Schulist    |1-477-935-8478 x6430 |Leopoldo_Corkery|ola.org      |
    |...    |...    |[email protected]   |7 |Kurtis Weissnat         |210.067.6132         |Elwyn.Skiles    |elvis.io     |
    |...    |...    |[email protected]     |8 |Nicholas Runolfsdottir V|586.493.6943 x140    |Maxime_Nienow   |jacynthe.com |
    |...    |...    |[email protected]  |9 |Glenna Reichert         |(775)976-6794 x41206 |Delphine        |conrad.com   |
    |...    |...    |[email protected]   |10|Clementina DuBuque      |024-648-3804         |Moriah.Stanton  |ambrose.net  |
    +-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
    $ cat test.json | tv -r id
    +-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
    |address|company|email                    |id|name                    |phone                |username        |website      |
    +-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
    |...    |...    |[email protected]        |1 |Leanne Graham           |1-770-736-8031 x56442|Bret            |hildegard.org|
    |...    |...    |[email protected]        |2 |Ervin Howell            |010-692-6593 x09125  |Antonette       |anastasia.net|
    |...    |...    |[email protected]       |3 |Clementine Bauch        |1-463-123-4447       |Samantha        |ramiro.info  |
    |...    |...    |[email protected]|4 |Patricia Lebsack        |493-170-9623 x156    |Karianne        |kale.biz     |
    |...    |...    |[email protected] |5 |Chelsey Dietrich        |(254)954-1289        |Kamren          |demarco.info |
    |...    |...    |[email protected]  |6 |Mrs. Dennis Schulist    |1-477-935-8478 x6430 |Leopoldo_Corkery|ola.org      |
    |...    |...    |[email protected]   |7 |Kurtis Weissnat         |210.067.6132         |Elwyn.Skiles    |elvis.io     |
    |...    |...    |[email protected]     |8 |Nicholas Runolfsdottir V|586.493.6943 x140    |Maxime_Nienow   |jacynthe.com |
    |...    |...    |[email protected]  |9 |Glenna Reichert         |(775)976-6794 x41206 |Delphine        |conrad.com   |
    |...    |...    |[email protected]   |10|Clementina DuBuque      |024-648-3804         |Moriah.Stanton  |ambrose.net  |
    +-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
    
    # address
    +--------------+--+-----------------+---------+----------+
    |city          |id|street           |suite    |zipcode   |
    +--------------+--+-----------------+---------+----------+
    |Gwenborough   | 1|Kulas Light      |Apt. 556 |92998-3874|
    |Wisokyburgh   | 2|Victor Plains    |Suite 879|90566-7771|
    |McKenziehaven | 3|Douglas Extension|Suite 847|59590-4157|
    |South Elvis   | 4|Hoeger Mall      |Apt. 692 |53919-4257|
    |Roscoeview    | 5|Skiles Walks     |Suite 351|33263     |
    |South Christy | 6|Norberto Crossing|Apt. 950 |23505-1337|
    |Howemouth     | 7|Rex Trail        |Suite 280|58804-1099|
    |Aliyaview     | 8|Ellsworth Summit |Suite 729|45169     |
    |Bartholomebury| 9|Dayna Park       |Suite 449|76495-3109|
    |Lebsackbury   |10|Kattie Turnpike  |Suite 198|31428-2261|
    +--------------+--+-----------------+---------+----------+
    
    

    Combines fields that are optionally keyed to the value received.

    opened by uzimaru0000 0
  • allow - as stdin input

    allow - as stdin input

    By default tv should consume stdin, or at very least allow "-" to be specified to consume stdin on all platforms (/dev/stdin is available on linux but on windows IDK...)

    $ tv<enter>
    [{ "foo": 1, "bar": 2 }]<enter>
    <ctrl-d>
    +---+---+
    |foo|bar|
    +---+---+
    |1  |2  |
    +---+---+
    

    workaround:

    $ cat | tv<enter>
    [{ "foo": 1, "bar": 2 }]<enter>
    <ctrl-d>
    +---+---+
    |foo|bar|
    +---+---+
    |1  |2  |
    +---+---+
    
    opened by hholst80 0
Releases(v0.7.0)
Owner
uzimaru0000
まだまだひよこ Unity3D / Elm / Rust / TypeScript / WebComponents
uzimaru0000
Multi-threaded CLI torrent scraper for displaying searched for magnet links; tailored for use with plex & ssh.

magnetfinder Multi-threaded CLI torrent aggregator; scrapes torrent results from multiple websites and delivers them into a table in your terminal! Su

Ryan 59 Dec 10, 2022
Multi-threaded CLI torrent scraper for displaying searched for magnet links; tailored for use with plex & ssh.

magnetfinder Multi-threaded CLI torrent aggregator; scrapes torrent results from multiple websites and delivers them into a table in your terminal! Su

null 59 Dec 10, 2022
Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim.

cat.nvim Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim. Failed as I realized far too late, that

James Vero 4 Aug 5, 2022
💫 Easy to use, robust Rust library for displaying spinners in the terminal

spinoff an easy to use, robust library for displaying spinners in the terminal ?? Install Add as a dependency to your Cargo.toml: [dependencies] spino

ad4m 401 Jun 24, 2023
Make data-driven table rendering easy with Dioxus

Dioxus Table Make data-driven table rendering easy with Dioxus Installation Until the next release of Dioxus this requires Dioxus nightly from git. Th

null 9 Oct 9, 2022
A more compact and intuitive ASCII table in your terminal: an alternative to "man 7 ascii" and "ascii"

asciit A more compact and intuitive ASCII table in your terminal: an alternative to man 7 ascii and ascii. Colored numbers and letters are much more e

Qichen Liu 刘启辰 5 Nov 16, 2023
Lightweight & Fast LWW CRDT Table

Lightweight & Fast LWW CRDT Table Supports millions of operations per second Suitable for real-time collaboration Supports delta updates It is a CRDT,

Zixuan Chen 26 Feb 24, 2024
A CLI tool to get help with CLI tools 🐙

A CLI tool to get help with CLI tools ?? halp aims to help find the correct arguments for command-line tools by checking the predefined list of common

Orhun Parmaksız 566 Apr 16, 2023
CLI Tool for tagging and organizing files by tags.

wutag ?? ??️ CLI tool for tagging and organizing files by tags. Install If you use arch Linux and have AUR repositories set up you can use your favour

Wojciech Kępka 32 Dec 6, 2022
CLI tool to bake your fresh and hot MD files

At least once in your Rust dev lifetime you wanted to make sure all code examples in your markdown files are up-to-date, correct and code is formated, but you couldn't make that done with already existing tools - fear not!

Patryk Budzyński 39 May 8, 2021
A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies

cargo-temp A CLI tool that allow you to create a new rust project in a temporary directory with already installed dependencies. Install Requires Rust

Yohan Boogaert 61 Oct 31, 2022
qsv - Performant CLI tool to query CSVs through SQL

qsv Performant CLI tool to query CSVs through SQL Installation After cloning the repository, you can install a binary locally using cargo install --pa

Dermot Haughey 3 Oct 28, 2021
kwctl is the go-to CLI tool for Kubewarden users.

kwctl kwctl is the go-to CLI tool for Kubewarden users. Think of it as the docker CLI tool if you were working with containers. How does kwctl help me

Kubewarden 45 Dec 21, 2022
A Rust CLI tool that helps you enforce Git policies through Git hooks both server and client side

GitPolicyEnforcer This is a command line utility written in Rust, that helps you utilize Git hooks, to enforce various policies. It currently supports

Vagelis Prokopiou 4 Aug 14, 2022
miniserve - a CLI tool to serve files and dirs over HTTP

?? For when you really just want to serve some files over HTTP right now!

Sven-Hendrik Haase 4.1k Jan 6, 2023
A cli tool to download specific GitHub directories or files

cloneit A cli tool to download specific GitHub directories or files. Installation From git git clone https://github.com/alok8bb/cloneit cd cloneit car

Alok 54 Dec 20, 2022
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022
A CLI tool for rustypaste

A CLI tool for rustypaste. Installation From crates.io cargo install rustypaste-cli Binary releases See the available binaries on releases page. Build

Orhun Parmaksız 18 Dec 15, 2022
CLI tool to convert numbers from one base to another

changebase A CLI tool for changing the base of numbers. > changebase -h numeric base converter USAGE: changebase [FLAGS] [OPTIONS] <value> FLAG

null 2 Oct 14, 2022