Skip to content

Transform Elixir Deeply Nested Maps into flat maps or 2 dimensional array. Export any map to CSV, XLSX or JSON.

License

Notifications You must be signed in to change notification settings

pedromvieira/transform_map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TransformMap

Transform Elixir Deeply Nested Maps into flat maps or 2 dimensional array. Export any map to CSV, XLSX or JSON. https://hex.pm/packages/transform_map.

Installation

  1. Add transform_map to your list of dependencies in mix.exs:
def deps do
  [
    {:transform_map, ">= 1.0.5"}
  ]
end

Usage

  iex> TransformMap.multiple_shrink(map, "|", true, true)

  iex> TransformMap.multiple_expand(shrink_map, "|", true)

  iex> TransformMap.multiple_to_array(map, "|", true, true)

  iex> TransformMap.multiple_keys(shrink_map, true)

  iex> TransformMap.multiple_to_array(map, "|", true, true) |> TransformMap.Export.to_csv("test.csv", true, "temp/report")

  iex> TransformMap.multiple_to_array(map, "|", true, true) |> TransformMap.Export.to_xlsx("test.xlsx", true, "temp/report")

  iex> map |> TransformMap.Export.to_json("test.json", true, "temp/report")

  iex> "temp/report/test.csv" |> TransformMap.Export.to_gzip()

News

  • 2018/08/20
    • Transform list to string to export to csv and xlsx (multiple_to_array).
  • 2018/08/12
    • Choose export directory.
  • 2018/04/28
    • Default delimiter "."
    • Fix first level list of maps
  • 2018/04/28
    • Decimal validation
  • 2018/04/27
    • Initial version

Documentation

Docs can be found at https://hexdocs.pm/transform_map.

License

Copyright © 2018 Pedro Vieira <[email protected]>

This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the LICENSE file for more details.

About

Transform Elixir Deeply Nested Maps into flat maps or 2 dimensional array. Export any map to CSV, XLSX or JSON.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages