{"id":31259995,"url":"https://github.com/sriharip316/tablo","last_synced_at":"2026-05-05T14:03:38.666Z","repository":{"id":310240764,"uuid":"1039182383","full_name":"sriharip316/tablo","owner":"sriharip316","description":"A CLI tool to render CSV/JSON/YAML as pretty tables.","archived":false,"fork":false,"pushed_at":"2026-04-26T08:59:35.000Z","size":223,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T09:22:52.395Z","etag":null,"topics":["csv","json","shell","table","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sriharip316.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-16T16:50:34.000Z","updated_at":"2026-04-26T08:59:38.000Z","dependencies_parsed_at":"2025-08-16T19:11:58.177Z","dependency_job_id":"fc70086e-78cc-48fe-aee9-f1734a258f74","html_url":"https://github.com/sriharip316/tablo","commit_stats":null,"previous_names":["sriharip316/tablo"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sriharip316/tablo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriharip316%2Ftablo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriharip316%2Ftablo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriharip316%2Ftablo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriharip316%2Ftablo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sriharip316","download_url":"https://codeload.github.com/sriharip316/tablo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriharip316%2Ftablo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32652487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csv","json","shell","table","yaml"],"created_at":"2025-09-23T08:45:41.659Z","updated_at":"2026-05-05T14:03:38.629Z","avatar_url":"https://github.com/sriharip316.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tablo\n\nA CLI tool to render CSV/JSON/JSONL/YAML as pretty tables. It supports flattening of nested objects, selecting/excluding columns, filtering rows, and multiple output styles.\n\n## Quick start\n\n```bash\n# From a JSON string\ntablo -i '{\"a\":1,\"b\":2}'\n\n# From a file\ntablo -f demo/data/list.json\n\n# From standard input\necho '{\"a\":1,\"b\":2}' | tablo\n```\n\n## Examples\n\n### Flatten a JSON object to key/value pairs\n\nCommand:\n\n```bash\ntablo -i '{\"a\":{\"b\":1},\"tags\":[\"x\",\"y\",3]}' --dive --flatten-simple-arrays\n```\n\nOutput:\n\n```\n┏━━━━━━┳━━━━━━━━━┓\n┃ KEY  ┃ VALUE   ┃\n┣━━━━━━╋━━━━━━━━━┫\n┃ a.b  ┃ 1       ┃\n┃ tags ┃ x, y, 3 ┃\n┗━━━━━━┻━━━━━━━━━┛\n```\n\nNotes:\n\n- `--dive` flattens nested objects (e.g., `a.b`).\n- `--flatten-simple-arrays` converts arrays of primitives into a comma-separated string.\n\n### YAML array of objects with selected columns and index\n\nCommand:\n\n```bash\ntablo -F yaml --index-column --select 'name,age' --style ascii \u003c\u003c'YAML'\n- name: Alice\n  age: 30\n- name: Bob\n  age: 31\nYAML\n```\n\nOutput:\n\n```\n+---+-------+-----+\n|   | name  | age |\n+---+-------+-----+\n| 1 | Alice |  30 |\n| 2 | Bob   |  31 |\n+---+-------+-----+\n```\n\nNotes:\n\n- `--select` accepts a comma-separated list of dotted paths. Use `--select-file` to load column selections from a file (one per line).\n- `--index-column` adds an auto index column for row arrays.\n- Use `--limit N` to restrict the number of printed rows.\n\n### CSV input\n\nTablo can parse CSV files or piped CSV data. The first row is treated as headers, and subsequent rows as data objects.\n\nCommand:\n\n```bash\ntablo -f demo/data/users.csv --select name,score --where 'score\u003e90'\n```\n\nOutput:\n\n```\n┏━━━━━━━━━━━━━━━┳━━━━━━━┓\n┃ name          ┃ score ┃\n┣━━━━━━━━━━━━━━━╋━━━━━━━┫\n┃ Alice Johnson ┃ 95.5  ┃\n┃ Carol Davis   ┃ 92.8  ┃\n┃ Grace Lee     ┃ 96.3  ┃\n┗━━━━━━━━━━━━━━━┻━━━━━━━┛\n```\n\n### JSON Lines (JSONL) input\n\nJSONL format allows one JSON value per line. Arrays in JSONL are automatically flattened into individual rows.\n\nCommand:\n\n```bash\ntablo -f demo/data/users.jsonl --select name,department\n```\n\nOutput:\n\n```\n┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n┃ name          ┃ department  ┃\n┣━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫\n┃ Alice Johnson ┃ Engineering ┃\n┃ Bob Smith     ┃ Marketing   ┃\n┃ Carol Davis   ┃ Engineering ┃\n┃ David Wilson  ┃ Sales       ┃\n┃ Eve Brown     ┃ Design      ┃\n┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛\n```\n\nJSONL with arrays (each line contains an array that gets flattened):\n\n```bash\ntablo -f demo/data/users-array.jsonl --select name,active\n```\n\nOutput:\n\n```\n┏━━━━━━━━━┳━━━━━━━━┓\n┃ name    ┃ active ┃\n┣━━━━━━━━━╋━━━━━━━━┫\n┃ Alice   ┃ true   ┃\n┃ Bob     ┃ false  ┃\n┃ Carol   ┃ true   ┃\n┃ David   ┃ true   ┃\n┗━━━━━━━━━┻━━━━━━━━┛\n```\n\n### Array of primitives\n\nCommand:\n\n```bash\ntablo -i '[1,2,3,4]' --limit 3 --style markdown\n```\n\nOutput:\n\n```markdown\n| VALUE |\n| ----- |\n| 1     |\n| 2     |\n| 3     |\n```\n\n### Sorting rows\n\nCommand:\n\n```bash\ntablo -i '[{\"name\":\"Charlie\",\"age\":35},{\"name\":\"Alice\",\"age\":30},{\"name\":\"Bob\",\"age\":25}]' --sort age\n```\n\nOutput:\n\n```\n┏━━━━━┳━━━━━━━━━┓\n┃ age ┃ name    ┃\n┣━━━━━╋━━━━━━━━━┫\n┃ 25  ┃ Bob     ┃\n┃ 30  ┃ Alice   ┃\n┃ 35  ┃ Charlie ┃\n┗━━━━━┻━━━━━━━━━┛\n```\n\n#### Per-column sort direction\n\nYou can specify sort direction for each column individually using `+` (ascending) or `-` (descending) prefixes:\n\n```bash\n# Sort by department (ascending), then by age (descending)\ntablo -f data.json --sort 'department,-age'\n\n# Explicit ascending prefix (same as no prefix)\ntablo -f data.json --sort '+name,-salary'\n\n# Mixed directions with multiple columns\ntablo -f data.json --sort 'active,-salary,name'\n```\n\nNotes:\n\n- `--sort 'column1,column2'` sorts by multiple columns in order\n- `--sort '+column1,-column2'` sorts column1 ascending, column2 descending\n- Works with flattened paths (e.g., `--sort 'user.name,-user.age'`)\n\n### Row sorting\n\nSort rows using the `--sort` flag with column names:\n\n- `--sort 'name'` - sort by a single column\n- `--sort 'name,age'` - sort by multiple columns (comma-separated)\n\nSorting supports different data types:\n\n- **Numbers**: sorted numerically (e.g., 1, 2, 10, 100)\n- **Strings**: sorted alphabetically\n- **Booleans**: false comes before true\n- **Mixed types**: fall back to string comparison\n- **Null values**: always sorted first\n\nThis works with flattened paths when using `--dive`.\n\nExample:\n\n```bash\ntablo -f employees.json --sort 'department,age' --select 'name,department,age'\n```\n\nOutput:\n\n```\n┏━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━┓\n┃ name    ┃ department  ┃ age ┃\n┣━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━┫\n┃ Bob     ┃ Engineering ┃ 25  ┃\n┃ Charlie ┃ Engineering ┃ 35  ┃\n┃ David   ┃ Marketing   ┃ 28  ┃\n┃ Alice   ┃ Marketing   ┃ 30  ┃\n┗━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━┛\n```\n\n### CSV and HTML output\n\nExport data as CSV for use in spreadsheet applications:\n\n```bash\ntablo -i '[{\"name\":\"John\",\"age\":30},{\"name\":\"Jane\",\"age\":25}]' --style csv\n```\n\nOutput:\n\n```\nage,name\n30,John\n25,Jane\n```\n\nGenerate HTML tables for use in web applications:\n\n```bash\necho '{\"user\":\"admin\",\"active\":true}' | tablo --dive --style html\n```\n\nOutput:\n\n```html\n\u003ctable class=\"go-pretty-table\"\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eKEY\u003c/th\u003e\n      \u003cth\u003eVALUE\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eactive\u003c/td\u003e\n      \u003ctd\u003etrue\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003euser\u003c/td\u003e\n      \u003ctd\u003eadmin\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n```\n\n### Row filtering\n\nFilter rows using the `--where` flag with condition expressions:\n\n- `--where 'name=John'` - equality comparison\n- `--where 'age\u003e25'` - numeric comparison (`\u003e`, `\u003e=`, `\u003c`, `\u003c=`)\n- `--where 'active=true'` - boolean comparison\n- `--where 'name~pattern'` - string contains (`~` for contains, `!~` for not contains)\n- `--where 'email=~.*@example\\.com'` - regex matching (`=~` for match, `!=~` for not match)\n\nMultiple `--where` flags are combined using AND logic. This works with flattened paths when using `--dive`.\n\nExample:\n\n```bash\ntablo -f employees.json --where 'department=Engineering' --where 'salary\u003e75000' --select 'name,salary'\n```\n\nOutput:\n\n```\n┏━━━━━━━━━┳━━━━━━━━┓\n┃ name    ┃ salary ┃\n┣━━━━━━━━━╋━━━━━━━━┫\n┃ Bob     ┃ 85000  ┃\n┃ Charlie ┃ 80000  ┃\n┃ Frank   ┃ 90000  ┃\n┗━━━━━━━━━┻━━━━━━━━┛\n```\n\n### Formatting options (booleans, precision, null)\n\nYou can customize formatting when rendering rows:\n\n- `--bool-str 'Y:N'` to render booleans as custom strings.\n- `--precision 2` to format floats with 2 decimal places.\n- `--null-str null` to display missing values as the literal `null`.\n\nExample:\n\n```bash\ntablo -i '[{\"a\":1.2345,\"b\":true},{\"b\":false}]' --style ascii --precision 2 --bool-str 'Y:N' --index-column\n```\n\nOutput:\n\n```\n+---+------+---+\n|   | a    | b |\n+---+------+---+\n| 1 | 1.23 | Y |\n| 2 | null | N |\n+---+------+---+\n```\n\n## Flattening controls\n\n- `--dive` enables flattening of nested objects and arrays of objects.\n  - `--dive-path k1 --dive-path k2` dives only into the listed top-level keys.\n- `--max-depth N` limits flattening depth (`-1` = unlimited).\n\n## Output styles\n\nChoose a table style with `--style`:\n\n- `heavy` (default), `light`, `double`, `ascii`, `markdown`, `compact`, `borderless`, `html`, `csv`.\n- Force ASCII borders with `--ascii` (applies only to table styles).\n\n## Selecting/excluding columns\n\nUse dotted path expressions with glob support for each segment (`*` and `?`). Examples:\n\n- Include: `--select 'user.*.name,meta.id'`\n- Exclude: `--exclude 'debug.*'`\n- Strict mode: `--strict-select` fails if any selected path is missing.\n\n## Versioning \u0026 Releases\n\n- Stable releases are tagged with semantic versions: `vMAJOR.MINOR.PATCH`.\n- Binaries built from an exact tag report that tag (e.g., `v0.4.0`).\n- Non-tag builds report a development identifier: `dev-\u003cshort-hash\u003e`.\n- A `-dirty` suffix is appended if there are uncommitted changes.\n\nTo create a new release:\n\n```\n# ensure clean working tree and tests pass\nmake ci\n# choose the next version and create a tag\nmake TAG=v0.5.0 tag\n# build multi-platform artifacts (automatically detects version from tag)\nmake release\n```\n\nThe release process:\n\n- `make tag` validates the working tree is clean and creates/pushes the git tag\n- `make release` runs `release-check` to validate git state and builds for multiple platforms\n- Release artifacts are built for: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, and windows/amd64.\n- All binaries are placed in `dist/` along with a `sha256sums.txt` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsriharip316%2Ftablo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsriharip316%2Ftablo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsriharip316%2Ftablo/lists"}