davydog187 / tab

Convert nested elixir data into tabular data

Home Page:https://hexdocs.pm/tab/Tab.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tab

Build Status Hex pm Hexdocs.pm

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]
  ]

Installation

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.

About

Convert nested elixir data into tabular data

https://hexdocs.pm/tab/Tab.html

License:Apache License 2.0


Languages

Language:Elixir 100.0%