{"id":26430386,"url":"https://github.com/rukomoynikov/tabled","last_synced_at":"2025-03-18T05:19:56.384Z","repository":{"id":37478001,"uuid":"489925505","full_name":"Rukomoynikov/tabled","owner":"Rukomoynikov","description":"Easily display your data in neat, organized tables right in your terminal! The library is straightforward, with no extra fuss or dependencies. Just plug in your data and enjoy clear, concise output.","archived":false,"fork":false,"pushed_at":"2024-12-01T17:08:58.000Z","size":67,"stargazers_count":7,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T05:04:35.107Z","etag":null,"topics":["cli","ruby","ruby-gem","table"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/Rukomoynikov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-05-08T11:34:53.000Z","updated_at":"2024-12-01T17:09:02.000Z","dependencies_parsed_at":"2024-10-20T15:49:43.004Z","dependency_job_id":null,"html_url":"https://github.com/Rukomoynikov/tabled","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.15000000000000002","last_synced_commit":"1808c7c8ce8ed5e2f3aace6b61220f1f5f6a3d82"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rukomoynikov%2Ftabled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rukomoynikov%2Ftabled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rukomoynikov%2Ftabled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rukomoynikov%2Ftabled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rukomoynikov","download_url":"https://codeload.github.com/Rukomoynikov/tabled/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244160193,"owners_count":20408049,"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":["cli","ruby","ruby-gem","table"],"created_at":"2025-03-18T05:19:55.658Z","updated_at":"2025-03-18T05:19:56.378Z","avatar_url":"https://github.com/Rukomoynikov.png","language":"Ruby","readme":"# Tabled\n\n[![Gem Version](https://badge.fury.io/rb/tabled.svg)](https://badge.fury.io/rb/tabled) ![CI is pasing for ruby 2.6 - 3.0](https://github.com/rukomoynikov/tabled/actions/workflows/linters.yml/badge.svg) ![Downloads](https://badgen.net/rubygems/dt/tabled)\n\nTabled is a versatile gem designed for rendering tabular data in a console. It offers various features to make data presentation simple and customizable.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Options](#options)\n- [Examples](#examples)\n- [Exporting Data](#exporting-data)\n- [Printing CSV or JSON Files](#printing-csv-or-json-files)\n- [Contributing](#contributing)\n\n## Installation\n```shell\nbundle add tabled\n# or\ngem install tabled\n```\n\n## Usage\nTo use Tabled in your application, follow these steps:\n1. Require the gem in your code:\n   ```ruby\n   require 'tabled'\n   ```\n2. Pass an array of rows to the application. Each row can contain any number of columns and optional footer text.\n\n## Options\nTabled accepts the following options:\n\n- `framed` (optional, default: true): Specify if the output should have frames.\n- `row_separator` (optional, default: \"-\"): Set the character for row separators or set it to nil if you don't want to separate rows.\n- `titles` (optional): Provide a list of column titles.\n\n## Examples\nHere are some examples to help you get started:\n\n### Simple Data Structure\n\n```ruby\ndata = [\n  [\"Helena\", \"20 years\", \"Female\"],\n  [\"John\", \"18 years\", \"Male\"],\n  [\"Alan\", \"23 years\", \"Male\"],\n]\n\nTabled.new(data, framed: false, row_separator: nil).print_to_console\n\nHelena 20 years Female\nJohn   18 years Male\nAlan   23 years Male\n```\n\n### Using Footer Inside a Row\n\n```ruby\ndata = [\n  [\"Helena\", \"20 years\", \"Female\"],\n  [\"John\", \"18 years\", \"Male\", { footer: \"Legendary assassin John Wick (Keanu Reeves).\" }],\n  [\"Alan\", \"23 years\", \"Male\"],\n]\n\nTabled.new(data, row_separator: nil).print_to_console\n\n| Helena 20 years Female                       |\n| John   18 years Male                         |\n| Legendary assassin John Wick (Keanu Reeves). |\n| Alan   23 years Male                         |\n```\n\n### Print Ruby CSV records\n\n```ruby\ncsv = CSV.parse(\u003c\u003c~ROWS, headers: true)\n  Bob,Engineering,1000\n  Jane,Sales,2000\n  John,Management,5000\nROWS\n\nTabled.from_csv(csv: csv, framed: true).print_to_console\n\n| Bob  Engineering 1000 |\n-------------------------\n| Jane Sales       2000 |\n-------------------------\n| John Management  5000 |\n-------------------------\n```\n\n## Exporting Data\n\nYou can export the data in CSV or JSON formats. By default, the file is saved in the current directory with the file name \"tabled.csv\" (CSV format).\n\n```ruby\n# Export to CSV\nTabled.new(data).export_to_file\n\n# Export to JSON\nTabled.new(data, titles: ['Name', 'Age', 'Gender']).export_to_file(format: :json)\n\n# Customize file name\nTabled.new(data, titles: ['Name', 'Age', 'Gender']).export_to_file(file_name: 'my_file.json')\n```\n\n## Printing CSV or JSON Files\n\nAs part of the gem, the *tabled* binary is included. You can run it like this:\n\n```shell\ntabled print path_to_[csv|json]_file\n```\n\n# Contributing\n1. Fork it ( http://github.com/rukomoynikov/tabled/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n# Development process in Docker\n\nRun `docker compose run --build --rm app bash` to get full packed dev environment for the gem developing.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frukomoynikov%2Ftabled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frukomoynikov%2Ftabled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frukomoynikov%2Ftabled/lists"}