TableKitty (TableKitty v0.1.0)
View SourceDocumentation for TableKitty
.
Summary
Functions
@spec build(Table.Reader.t(), Keyword.t()) :: {:ok, IO.chardata()} | {:error, Exception.t()}
Builds IO data with the generated table.
This function receives a valid tabular data, like a list of maps, or a keyword list with keys as column names and values as list of values for each column.
Examples
iex> {:ok, iodata} = TableKitty.build([a: [1, 2], b: [4, 6]])
iex> IO.iodata_to_binary(iodata)
"""
+---+---+
| a | b |
+===+===+
| 1 | 4 |
+---+---+
| 2 | 6 |
+---+---+
"""
iex> {:ok, iodata} = TableKitty.build([%{a: 1, b: 4}, %{a: 2, b: 6}])
iex> IO.iodata_to_binary(iodata)
"""
+---+---+
| a | b |
+===+===+
| 1 | 4 |
+---+---+
| 2 | 6 |
+---+---+
"""
@spec print(Table.Reader.t(), Keyword.t()) :: :ok | {:error, Exception.t()}
Print the table if the same is valid.
To see options go to build/2
.