{"id":14235640,"url":"https://github.com/wlezzar/jtab","last_synced_at":"2025-08-11T00:32:07.689Z","repository":{"id":63057428,"uuid":"272199822","full_name":"wlezzar/jtab","owner":"wlezzar","description":"Print json data as a table from the command line","archived":false,"fork":false,"pushed_at":"2022-11-13T22:04:52.000Z","size":105,"stargazers_count":49,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-21T21:27:23.946Z","etag":null,"topics":["bash","cli","json","rust","table"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wlezzar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-14T12:40:46.000Z","updated_at":"2024-05-06T05:39:58.000Z","dependencies_parsed_at":"2023-01-22T10:30:08.984Z","dependency_job_id":null,"html_url":"https://github.com/wlezzar/jtab","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlezzar%2Fjtab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlezzar%2Fjtab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlezzar%2Fjtab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlezzar%2Fjtab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wlezzar","download_url":"https://codeload.github.com/wlezzar/jtab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229478683,"owners_count":18079372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","json","rust","table"],"created_at":"2024-08-20T21:02:11.431Z","updated_at":"2024-12-13T01:30:28.160Z","avatar_url":"https://github.com/wlezzar.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Jtab\n\nA tiny command line tool written in rust to print json data as a formatted table.\n\n```bash\n➜ echo '[{\"id\": \"1\", \"name\": \"Rust\"}, {\"id\": \"2\", \"name\": \"Jtab\"}]' | jtab\n\n┌────┬──────┐\n│ id │ name │\n├────┼──────┤\n│ 1  │ Rust │\n├────┼──────┤\n│ 2  │ Jtab │\n└────┴──────┘\n```\n\nNested data is handled correctly.\n\n```\n➜ echo '[{\"id\": 1, \"nested\": {\"value1\": 1, \"value2\": 2}}, {\"id\": 2, \"nested\": {\"array\": [1, 2], \"deeply_nested\": {\"value\": 1}}}]' | jtab\n\n┌────┬────────────────┐\n│ id │ nested         │\n├────┼────────────────┤\n│ 1  │ value1: 1      │\n│    │ value2: 2      │\n├────┼────────────────┤\n│ 2  │ array:         │\n│    │   - 1          │\n│    │   - 2          │\n│    │ deeply_nested: │\n│    │   value: 1     │\n└────┴────────────────┘\n```\n\n## Install\n\n### Using Homebrew (MacOs \u0026 Linux)\n\n```bash\nbrew tap wlezzar/jtab https://github.com/wlezzar/jtab\nbrew install wlezzar/jtab/jtab\n\n# use jtab\njtab --help\n```\n\n### Using prebuilt binaries\n\nLinux and Macos binaries are available as tarballs in\nthe [release section](https://github.com/wlezzar/jtab/releases/latest).\n\n### Using cargo (all platforms)\n\nFor other platforms, you can use `cargo`:\n\n```bash\ncargo install --git https://github.com/wlezzar/jtab\n\njtab --help\n```\n\n## Sample commands\n\n#### Example usage\n\nPipe some weather data into jtab:\n\n```bash\n➜ curl -s 'https://www.metaweather.com/api/location/search/?query=san' \\\n    | jtab\n\n┌───────────────────────┬───────────────┬───────────────┬─────────┐\n│ latt_long             │ location_type │ title         │ woeid   │\n├───────────────────────┼───────────────┼───────────────┼─────────┤\n│ 37.777119, -122.41964 │ City          │ San Francisco │ 2487956 │\n├───────────────────────┼───────────────┼───────────────┼─────────┤\n│ 32.715691,-117.161720 │ City          │ San Diego     │ 2487889 │\n├───────────────────────┼───────────────┼───────────────┼─────────┤\n│ 37.338581,-121.885567 │ City          │ San Jose      │ 2488042 │\n├───────────────────────┼───────────────┼───────────────┼─────────┤\n│ 29.424580,-98.494614  │ City          │ San Antonio   │ 2487796 │\n├───────────────────────┼───────────────┼───────────────┼─────────┤\n│ 36.974018,-122.030952 │ City          │ Santa Cruz    │ 2488853 │\n└───────────────────────┴───────────────┴───────────────┴─────────┘\n```\n\nTake only 2 rows and a subset of the columns:\n\n```bash\n➜ curl -s 'https://www.metaweather.com/api/location/search/?query=san' \\\n    | jtab --take 2 -f title -f woeid\n\n┌───────────────┬─────────┐\n│ title         │ woeid   │\n├───────────────┼─────────┤\n│ San Francisco │ 2487956 │\n├───────────────┼─────────┤\n│ San Diego     │ 2487889 │\n└───────────────┴─────────┘\n```\n\n#### Ingesting a stream of json (one json per row)\n\nBy default, `jtab` parses the full payload before printing it and expects it to be a valid JSON. To support use cases\nwhere data is piped in streaming mode (one valid json per line), `jtab` has a `--streaming` flag for that purpose.\n\nThe example below shows how you can use the `--streaming` flag to ingest the wikipedia change stream in `jtab`:\n\n```\n➜ curl -s  https://stream.wikimedia.org/v2/stream/recentchange \\\n    | grep data \\\n    | sed 's/^data: //g' \\\n    | jtab --streaming --take 5 -f id -f title -f user -f type\n\n┌────────────┬───────────────────────────────────────────────────────┬───────────────────┬────────────┐\n│ id         │ title                                                 │ user              │ type       │\n├────────────┼───────────────────────────────────────────────────────┼───────────────────┼────────────┤\n│ 1248099852 │ Q695926                                               │ Ecchbz            │ edit       │\n├────────────┼───────────────────────────────────────────────────────┼───────────────────┼────────────┤\n│ 98274450   │ Bản mẫu:Số ca nhiễm COVID-19 theo tinh thành Việt Nam │ Thái Nhi          │ edit       │\n├────────────┼───────────────────────────────────────────────────────┼───────────────────┼────────────┤\n│ 1272589900 │ Category:Noindexed pages                              │ Materialscientist │ categorize │\n├────────────┼───────────────────────────────────────────────────────┼───────────────────┼────────────┤\n│ 1272589899 │ Tong Tau Po                                           │ Underwaterbuffalo │ new        │\n├────────────┼───────────────────────────────────────────────────────┼───────────────────┼────────────┤\n│ 1272589901 │ Category:Wikipedia sockpuppets                        │ Materialscientist │ categorize │\n└────────────┴───────────────────────────────────────────────────────┴───────────────────┴────────────┘\n```\n\n#### Table formats\n\n`jtab` support multiple table formats using the `--format` command line option:\n\n- `default`: prints the table in a pretty formatted (to be used in the command line).\n- `markdown`: outputs the table in markdown\n- `html`: outputs the table in Html format styled with bootstrap\n- `html-raw`: outputs the table in Html format without any styling.\n\nFor example, to print the table in HTML format:\n\n```\n➜ echo '[{\"id\": 1, \"nested\": {\"value1\": 1, \"value2\": 2}}, {\"id\": 2, \"nested\": {\"array\": [1, 2], \"deeply_nested\": {\"value\": 1}}}]' \\\n    | jtab --format html \u003e /tmp/table.html\n  \n# Open the file with your favorite browser  \n➜ xdg-open /tmp/table.html\n```\n\n#### Conditionally colorize fields (only supported with `--format default`)\n\nYou can conditionally colorize some fields based on their value:\n\n```\n➜  ~ curl -s  https://stream.wikimedia.org/v2/stream/recentchange \\\n         | grep data \\\n         | sed 's/^data: //g' \\\n         | jtab --streaming --take 5 -f id -f title -f user -f type \\\n                --colorize 'type:categorize:bFg' \\\n                --colorize 'type:edit:bFr'\n```\n\n![res](docs/img/colorize-result.png)\n\nThe `colorize` option takes a string in the format `column_name:value:style_spec`. The `style_spec` corresponds\nto [the style specifiers of the prettytable-rs](https://github.com/phsym/prettytable-rs#list-of-style-specifiers)\nlibrary that jtab is based on.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlezzar%2Fjtab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwlezzar%2Fjtab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlezzar%2Fjtab/lists"}