Tab is a tiny library for converting Elixir terms into tabular data.
iex> Tab.tabulate([%{a: 1, b: 2, c: 3}, %{a: 1, b: 2}])
[
["a", "b", "c"],
[1, 2, 3],
[1, 2, nil]
]
Tab also works with nested data
iex> Tab.tabulate([%{a: %{b: 1, c: 2}}])
[
["a.b", "a.c"] ,
[1, 2]
]
If available in Hex, the package can be installed
by adding tab
to your list of dependencies in mix.exs
:
def deps do
[
{:tab, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/tab.