All Projects → aerosol → Tabula

aerosol / Tabula

Licence: MIT license
🈸 Pretty printer for maps/structs collections (Elixir)

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Tabula

tv
📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.
Stars: ✭ 1,763 (+1974.12%)
Mutual labels:  tabular-data, pretty-printer
AI4Water
framework for developing machine (and deep) learning models for structured data
Stars: ✭ 35 (-58.82%)
Mutual labels:  tabular-data
cgpm
Library of composable generative population models which serve as the modeling and inference backend of BayesDB.
Stars: ✭ 24 (-71.76%)
Mutual labels:  tabular-data
kotlin-metadata-printer
Prints the Kotlin metadata attached to Java class files
Stars: ✭ 41 (-51.76%)
Mutual labels:  pretty-printer
Machine-Learning-Roadmap
A roadmap for getting started with Machine Learning
Stars: ✭ 79 (-7.06%)
Mutual labels:  tabular-data
SDGym
Benchmarking synthetic data generation methods.
Stars: ✭ 177 (+108.24%)
Mutual labels:  tabular-data
AutoTabular
Automatic machine learning for tabular data. ⚡🔥⚡
Stars: ✭ 51 (-40%)
Mutual labels:  tabular-data
msda
Library for multi-dimensional, multi-sensor, uni/multivariate time series data analysis, unsupervised feature selection, unsupervised deep anomaly detection, and prototype of explainable AI for anomaly detector
Stars: ✭ 80 (-5.88%)
Mutual labels:  tabular-data
DataTables.jl
(DEPRECATED) A rewrite of DataFrames.jl based on Nullable
Stars: ✭ 28 (-67.06%)
Mutual labels:  tabular-data
fastapi-csv
🏗️ Create APIs from CSV files within seconds, using fastapi
Stars: ✭ 46 (-45.88%)
Mutual labels:  tabular-data
winter
WInte.r is a Java framework for end-to-end data integration. The WInte.r framework implements well-known methods for data pre-processing, schema matching, identity resolution, data fusion, and result evaluation.
Stars: ✭ 101 (+18.82%)
Mutual labels:  tabular-data
TabFormer
Code & Data for "Tabular Transformers for Modeling Multivariate Time Series" (ICASSP, 2021)
Stars: ✭ 209 (+145.88%)
Mutual labels:  tabular-data
ex format
ExFormat formats Elixir source code according to a standard set of rules
Stars: ✭ 39 (-54.12%)
Mutual labels:  pretty-printer
language-rust
Parser and pretty-printer for the Rust language
Stars: ✭ 78 (-8.24%)
Mutual labels:  pretty-printer
pytorch multi input example
Multi-Input Deep Neural Networks with PyTorch-Lightning - Combine Image and Tabular Data
Stars: ✭ 40 (-52.94%)
Mutual labels:  tabular-data
datapackage-m
Power Query M functions for working with Tabular Data Packages (Frictionless Data) in Power BI and Excel
Stars: ✭ 26 (-69.41%)
Mutual labels:  tabular-data
DataProfiler
What's in your data? Extract schema, statistics and entities from datasets
Stars: ✭ 843 (+891.76%)
Mutual labels:  tabular-data
aws-machine-learning-university-dte
Machine Learning University: Decision Trees and Ensemble Methods
Stars: ✭ 119 (+40%)
Mutual labels:  tabular-data
tabular-stream
Detects tabular data (spreadsheets, dsv or json, 20+ different formats) and emits normalized objects.
Stars: ✭ 34 (-60%)
Mutual labels:  tabular-data
SchemaMapper
A .NET class library that allows you to import data from different sources into a unified destination
Stars: ✭ 41 (-51.76%)
Mutual labels:  tabular-data

SWUbanner

Tabula

Build Status Hex.pm

Tabula can transform a list of maps (structs too, e.g. Ecto models) or Keywords into an ASCII/GitHub Markdown table.

It's a weekend-over-beer-project of mine, loosely based on clojure.pprint.print-table.

Installation

  1. Add Tabula to your list of dependencies in mix.exs:
def deps do
  [{:tabula, "~> 2.1.1"}]
end
  1. Ensure Tabula is started before your application:
def application do
  [applications: [:tabula]]
end

Let's get down to business 🍻

Examples

defmodule Demo do

  use Tabula, style: :github_md

  def run do
    [ %{"name" => "Joe", "age" => 31, "city" => "New York"},
      %{"name" => "Adam", "age" => 33, "city" => "Warsaw"},
      %{"name" => "Yolanda", "age" => 28, "city" => "Berlin"}
    ] |> print_table
  end

end

Demo.run yields:

age | city     | name
--- | -------- | -------
 31 | New York | Joe
 33 | Warsaw   | Adam
 28 | Berlin   | Yolanda

Which renders in GitHub markdown as:

age city name
31 New York Joe
33 Warsaw Adam
28 Berlin Yolanda

Alternatively, you can use the default :org_mode style:

defmodule Demo do

  def run do
    Code.get_docs(Atom, :docs) 
    |> Enum.sort
    |> Enum.map(fn {{function, arity}, _line, _kind, _signature, text} ->
      %{"function" => function,
        "arity"    => arity,
        "text"     => text |> String.split("\n") |> Enum.at(0) }
    end) |> Tabula.print_table
  end

end

So that Demo.run yields:

arity | function      | text
------+---------------+---------------------------------
    1 | :to_char_list | Converts an atom to a char list.
    1 | :to_string    | Converts an atom to a string.

You can specify the columns you want to render. If you wish Tabula to automatically index your rows, you need to provide it with a special # key:

iex(1)> Repo.all(Account) |> Tabula.print_table(only: ["#", :name, :key])

  # | :name    | :key
----+----------+-----------------------------
  1 | Adam     | e1210f10a721485be4ad50604cda
  2 | Thomas   | c0ae1f149298ffded9f41a828cf5

You can use render_table to return an iolist of the rendered data, if you wish not to write to stdout.

Struct values will be printed using their string representation, provided String.Chars is implemented. If in doubt, please consult the tests.

MaybeFutureFeatures

If time permits I would like to implement the following extensions (contributions very much welcome!):

  • ANSI styles, because we all love colored output, don't we?
  • Custom formatters
  • Cell contents wrapping
  • Option to define max table width

Contributors

Adam Rutkowski - https://twitter.com/hq1aerosol

Adrian Gruntkowski - https://twitter.com/adrgrunt

Gian D - https://twitter.com/fusillicode

Wojtek Mach - https://twitter.com/wojtekmach

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].