{"id":13576260,"url":"https://github.com/RaymondLoranger/io_ansi_table","last_synced_at":"2025-04-05T05:31:17.520Z","repository":{"id":57507206,"uuid":"85530552","full_name":"RaymondLoranger/io_ansi_table","owner":"RaymondLoranger","description":"Writes data to \"stdio\" in a table with borders and colors. Can choose a table style to change the look of the table.","archived":false,"fork":false,"pushed_at":"2024-02-26T18:33:11.000Z","size":262,"stargazers_count":25,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T11:03:04.690Z","etag":null,"topics":["borders","colors","elixir","stdout","table"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/RaymondLoranger.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-03-20T03:13:43.000Z","updated_at":"2024-03-20T13:40:57.000Z","dependencies_parsed_at":"2024-03-18T15:13:13.095Z","dependency_job_id":"ae12253c-010e-4601-9add-09beae9d2683","html_url":"https://github.com/RaymondLoranger/io_ansi_table","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondLoranger%2Fio_ansi_table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondLoranger%2Fio_ansi_table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondLoranger%2Fio_ansi_table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondLoranger%2Fio_ansi_table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaymondLoranger","download_url":"https://codeload.github.com/RaymondLoranger/io_ansi_table/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294219,"owners_count":20915332,"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":["borders","colors","elixir","stdout","table"],"created_at":"2024-08-01T15:01:08.544Z","updated_at":"2025-04-05T05:31:12.507Z","avatar_url":"https://github.com/RaymondLoranger.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"# IO ANSI Table\n\nWrites data to `:stdio` in a table with borders and colors.\nCan choose a table style to change the look of the table.\n\n##### Inspired by the book [Programming Elixir](https://pragprog.com/book/elixir16/programming-elixir-1-6) by Dave Thomas.\n\n## Installation\n\nAdd `io_ansi_table` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:io_ansi_table, \"~\u003e 1.0\"}\n  ]\nend\n```\n\nYou may _also_ define `io_ansi_table` as an included application, if only using\nthe [IO.ANSI.Table.write/3][write/3] function:\n\n```elixir\ndef application do\n  [\n    included_applications: [:io_ansi_table],\n    extra_applications: [:logger]\n  ]\nend\n```\n\n## Examples\n\n```elixir\nalias IO.ANSI.Table\n\npeople = [\n  %{name: \"Mike\", likes: \"ski, arts\", dob: \"1992-04-15\", bmi: 23.9},\n  %{name: \"Mary\", likes: \"travels\"  , dob: \"1992-04-15\", bmi: 26.8},\n  %{name: \"Ann\" , likes: \"reading\"  , dob: \"1992-04-15\", bmi: 24.7},\n  %{name: \"Ray\" , likes: \"cycling\"  , dob: \"1977-08-28\", bmi: 19.1},\n  %{name: \"Bill\", likes: \"karate\"   , dob: \"1977-08-28\", bmi: 18.1},\n  %{name: \"Joe\" , likes: \"boxing\"   , dob: \"1977-08-28\", bmi: 20.8},\n  %{name: \"Jill\", likes: \"cooking\"  , dob: \"1976-09-28\", bmi: 25.8}\n]\n\nTable.start([:name, :dob, :likes],\n  header_fixes: %{~r[dob]i =\u003e \"Date of Birth\"},\n  sort_specs: [asc: :dob],\n  align_specs: [center: :dob],\n  margins: [top: 2, bottom: 2, left: 2]\n)\n\nTable.format(people, style: :light)\nTable.format(people, style: :light_alt)\nTable.format(people, style: :light_mult)\nTable.format(people, style: :cyan_alt)\nTable.format(people, style: :cyan_mult)\n```\n## ![light](images/light.png)\n## ![light_alt](images/light_alt.png)\n## ![light_mult](images/light_mult.png)\n## ![cyan_alt](images/cyan_alt.png)\n## ![cyan_mult](images/cyan_mult.png)\n\n## Notes\n\nFor side-by-side tables, you can specify a negative top margin.\n\nIn addition to the 16 standard ANSI colors\u003csup\u003e[1](#footnote1)\u003c/sup\u003e and their\nbackground counterparts, this package also supports the 256 Xterm colors (foreground and background).\n\nMost of these 256 colors were given names like:\n- \u003cimg src=\"images/00ffff.png\"\u003e `:aqua`\n- \u003cimg src=\"images/87ff00.png\"\u003e `:chartreuse`\n- \u003cimg src=\"images/d700ff.png\"\u003e `:psychedelic_purple`\n\nFor details, see file `config/persist_colors.exs` of dependency\n[io_ansi_plus][io_ansi_plus].\n\nThe following 2 packages use `io_ansi_table` as a dependency to tabulate\ndata fetched from the web:\n\n  - [Github Issues][github_issues]\n  - [NOAA Observations][noaa_observations]\n\nInvocation from a remote shell is now supported (courtesy of [milkwine][mw]).\n\nSorting on [Date][Date] columns or other struct types like [Version][Version]\nis now supported.\n\n\u003csup\u003e\u003ca name=\"footnote1\"\u003e1\u003c/a\u003e\u003c/sup\u003e Actually 8 colors and their \"bright\" variants.\n\n## Latest version\n\nThe latest version supports:\n\n  - sorting on multiple columns\n  - alternating row attributes\n  - alignment of column elements\n  - sort direction indicators\n  - negative top margin\n  - ANSI and Xterm colors\n  - invocation from remote shell\n  - sorting on [Date][Date] columns\n\n  [io_ansi_plus]: https://github.com/RaymondLoranger/io_ansi_plus\n  [Date]: https://hexdocs.pm/elixir/Date.html\n  [Version]: https://hexdocs.pm/elixir/Version.html\n  [mw]: https://github.com/milkwine\n  [github_issues]: https://hex.pm/packages/github_issues\n  [noaa_observations]: https://hex.pm/packages/noaa_observations\n  [write/3]: https://hexdocs.pm/io_ansi_table/IO.ANSI.Table.html#write/3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRaymondLoranger%2Fio_ansi_table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRaymondLoranger%2Fio_ansi_table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRaymondLoranger%2Fio_ansi_table/lists"}