data_morph alternatives and similar packages
Based on the "Algorithms and Data structures" category.
Alternatively, view data_morph alternatives based on common mentions on social networks and blogs.
-
matrex
A blazing fast matrix library for Elixir/Erlang with C implementation using CBLAS. -
simple_bayes
A Naive Bayes machine learning implementation in Elixir. -
exconstructor
An Elixir library for generating struct constructors that handle external data with ease. -
erlang-algorithms
Implementations of popular data structures and algorithms -
remodel
:necktie: An Elixir presenter package used to transform map structures. "ActiveModel::Serializer for Elixir" -
MapDiff
Calculates the difference between two (nested) maps, and returns a map representing the patch of changes. -
aja
Extension of the Elixir standard library focused on data stuctures, data manipulation and performance -
parallel_stream
A parallelized stream implementation for Elixir -
merkle_tree
:evergreen_tree: Merkle Tree implementation in pure Elixir -
bloomex
:hibiscus: A pure Elixir implementation of Scalable Bloom Filters -
DeepMerge
Deep (recursive) merge for maps, keywords and others in Elixir -
the_fuzz
String metrics and phonetic algorithms for Elixir (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein) -
exmatrix
Elixir library implementing a parallel matrix multiplication algorithm and other utilities for working with matrices. Used for benchmarking computationally intensive concurrent code. -
ecto_materialized_path
Tree structure & hierarchy for ecto models -
dataframe
Package providing functionality similar to Python's Pandas or R's data.frame() -
Conrex
An Elixir implementation of the CONREC algorithm for topographic or isochrone maps. -
murmur
:speech_balloon: An implementation of the non-cryptographic hash Murmur3 -
bitmap
Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups -
Closure Table
Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies.
Updating dependencies is time-consuming.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of data_morph or a related project?
Popular Comparisons
README
DataMorph
Create Elixir structs, maps with atom keys, and keyword lists from CSV/TSV data.
Documentation
You can view full DataMorph API documentation on hexdocs.
Note, we should never convert user input to atoms. This is because atoms are not garbage collected. Once an atom is created, it is never reclaimed.
Generating atoms from user input would mean the user can inject enough different names to exhaust our system memory, or we reach the Erlang VM limit for the maximum number of atoms which will bring our system down regardless.
Installation
Add
{:data_morph, "~> 0.1.0"}
to your deps in mix.exs
like so:
defp deps do
[
{:data_morph, "~> 0.1.0"}
]
end
Usage examples
Given a CSV file of data like this:
(echo "name,iso-code" && echo New Zealand,nz && echo United Kingdom,gb) > tmp.csv
Define a struct and return stream of structs created from a csv
stream,
a namespace
string or atom, and a name
string or atom.
File.stream!('./tmp.csv') \
|> DataMorph.structs_from_csv("my-module", :iso_country) \
|> Enum.to_list
# [
# %MyModule.IsoCountry{iso_code: "nz", name: "New Zealand"},
# %MyModule.IsoCountry{iso_code: "gb", name: "United Kingdom"}
# ]
Return stream of maps created from a csv
stream.
File.stream!('./tmp.csv') \
|> DataMorph.maps_from_csv() \
|> Enum.to_list
# [
# %{iso_code: "nz", name: "New Zealand"},
# %{iso_code: "gb", name: "United Kingdom"}
# ]
Return a stream of keyword lists created from a stream of csv
.
(echo name,iso && echo New Zealand,NZ) | \
mix run -e 'IO.stream(:stdio, :line) \
|> DataMorph.keyword_lists_from_csv() \
|> IO.inspect'
# [[name: "New Zealand", iso: "NZ"]]
Add new fields to struct when called twice with different fields in tsv
.
"name\tiso\n" <>
"New Zealand\tnz\n" <>
"United Kingdom\tgb" \
|> DataMorph.structs_from_tsv(MyModule, "country") \
|> Enum.to_list
# [
# %MyModule.Country{iso: "nz", name: "New Zealand"},
# %MyModule.Country{iso: "gb", name: "United Kingdom"}
# ]
"name\tacronym\n" <>
"New Zealand\tNZ\n" <>
"United Kingdom\tUK" \
|> DataMorph.structs_from_tsv("MyModule", :country) \
|> Enum.to_list
# warning: redefining module MyModule.Country
# (current version defined in memory)
# [
# %MyModule.Country{acronym: "NZ", iso: nil, name: "New Zealand"},
# %MyModule.Country{acronym: "UK", iso: nil, name: "United Kingdom"}
# ]
You can view full DataMorph API documentation on hexdocs.