{"id":13507638,"url":"https://github.com/aerosol/tabula","last_synced_at":"2025-09-05T12:34:38.595Z","repository":{"id":47341288,"uuid":"44131202","full_name":"aerosol/Tabula","owner":"aerosol","description":" :u7533: Pretty printer for maps/structs collections (Elixir)","archived":false,"fork":false,"pushed_at":"2022-03-14T08:55:16.000Z","size":41,"stargazers_count":93,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T05:36:40.430Z","etag":null,"topics":["elixir","pretty-printer","tabular-data"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/aerosol.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}},"created_at":"2015-10-12T20:04:11.000Z","updated_at":"2024-10-13T22:02:44.000Z","dependencies_parsed_at":"2022-09-10T17:00:15.850Z","dependency_job_id":null,"html_url":"https://github.com/aerosol/Tabula","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerosol%2FTabula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerosol%2FTabula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerosol%2FTabula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerosol%2FTabula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aerosol","download_url":"https://codeload.github.com/aerosol/Tabula/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"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":["elixir","pretty-printer","tabular-data"],"created_at":"2024-08-01T02:00:37.272Z","updated_at":"2025-04-07T17:09:49.809Z","avatar_url":"https://github.com/aerosol.png","language":"Elixir","readme":"[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)\n\n\n\n# Tabula\n\n[![Build Status](https://travis-ci.org/aerosol/Tabula.svg?branch=master)](https://travis-ci.org/aerosol/Tabula)\n[![Hex.pm](https://img.shields.io/hexpm/v/tabula.svg)](https://hex.pm/packages/tabula)\n\nTabula can transform a list of maps (structs too, e.g.\n[Ecto](https://github.com/elixir-lang/ecto) models) or Keywords\ninto an ASCII/GitHub Markdown table.\n\nIt's a weekend-over-beer-project of mine, loosely based on\n[clojure.pprint.print-table](http://git.io/vWz7T).\n\n## Installation\n\n  1. Add Tabula to your list of dependencies in mix.exs:\n\n   ```elixir\n   def deps do\n     [{:tabula, \"~\u003e 2.1.1\"}]\n   end\n   ```\n\n  2. Ensure Tabula is started before your application:\n\n   ```elixir\n   def application do\n     [applications: [:tabula]]\n   end\n   ```\n\nLet's get down to business :beers:\n\n## Examples\n\n```elixir\ndefmodule Demo do\n\n  use Tabula, style: :github_md\n\n  def run do\n    [ %{\"name\" =\u003e \"Joe\", \"age\" =\u003e 31, \"city\" =\u003e \"New York\"},\n      %{\"name\" =\u003e \"Adam\", \"age\" =\u003e 33, \"city\" =\u003e \"Warsaw\"},\n      %{\"name\" =\u003e \"Yolanda\", \"age\" =\u003e 28, \"city\" =\u003e \"Berlin\"}\n    ] |\u003e print_table\n  end\n\nend\n```\n\n`Demo.run` yields:\n\n```\nage | city     | name\n--- | -------- | -------\n 31 | New York | Joe\n 33 | Warsaw   | Adam\n 28 | Berlin   | Yolanda\n```\n\nWhich renders in GitHub markdown as:\n\nage | city     | name\n--- | -------- | -------\n 31 | New York | Joe\n 33 | Warsaw   | Adam\n 28 | Berlin   | Yolanda\n\nAlternatively, you can use the default `:org_mode` style:\n\n```elixir\ndefmodule Demo do\n\n  def run do\n    Code.get_docs(Atom, :docs) \n    |\u003e Enum.sort\n    |\u003e Enum.map(fn {{function, arity}, _line, _kind, _signature, text} -\u003e\n      %{\"function\" =\u003e function,\n        \"arity\"    =\u003e arity,\n        \"text\"     =\u003e text |\u003e String.split(\"\\n\") |\u003e Enum.at(0) }\n    end) |\u003e Tabula.print_table\n  end\n\nend\n```\n\nSo that `Demo.run` yields:\n\n```\narity | function      | text\n------+---------------+---------------------------------\n    1 | :to_char_list | Converts an atom to a char list.\n    1 | :to_string    | Converts an atom to a string.\n```\n\nYou can specify the columns you want to render.\nIf you wish Tabula to automatically index your rows, you need to provide it with a special `#` key:\n\n```\niex(1)\u003e Repo.all(Account) |\u003e Tabula.print_table(only: [\"#\", :name, :key])\n\n  # | :name    | :key\n----+----------+-----------------------------\n  1 | Adam     | e1210f10a721485be4ad50604cda\n  2 | Thomas   | c0ae1f149298ffded9f41a828cf5\n```\n\nYou can use `render_table` to return an `iolist` of the rendered data,\nif you wish not to write to stdout.\n\nStruct values will be printed using their string representation, provided\n`String.Chars` is implemented.  If in doubt, please consult the tests.\n\n## MaybeFutureFeatures\n\nIf time permits I would like to implement the following extensions (contributions very much welcome!):\n\n  - ANSI styles, because we all love colored output, don't we?\n  - Custom formatters\n  - Cell contents wrapping\n  - Option to define max table width\n\n## Contributors\n\nAdam Rutkowski - https://twitter.com/hq1aerosol\n\nAdrian Gruntkowski - https://twitter.com/adrgrunt\n\nGian D - https://twitter.com/fusillicode\n\nWojtek Mach - https://twitter.com/wojtekmach\n","funding_links":[],"categories":["Command Line Applications"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerosol%2Ftabula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerosol%2Ftabula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerosol%2Ftabula/lists"}