I usually do something like this:
Enum.reduce(input_list, %{}, fn item, acc ->
[key, value] =
item
|> String.replace("\"", "")
|> String.split(":")
Map.put(acc, key, value)
end)
For each item in the list, get rid of the quotation marks, split at the colon, and then put them into a map (or struct if the keys are always the same). Note how Elixir’s pattern matching allows us to easily assign key and value variables from the result of the pipeline.






















