FlowCsv (flow_csv v0.1.0)
FlowCsv is a concurrent and functional CSV parser built with Elixir.
It utilizes streams and the BEAM concurrency model to process large CSV files line by line, achieving memory efficiency and parallel execution. The core parsing logic is a Finite State Machine (FSM) implemented via Pattern Matching, ensuring purity and side-effect free operation.
Example
{:ok, pid} = File.write("data.csv", "name,age,priceAlice,30,19.99 Bob,45,12.50 "Charlie",22,8.0")
data =
"data.csv"
|> FlowCSV.parse_file()
|> Enum.to_list()
# data is: [["name", "age", "price"], ["Alice", 30, 19.99], ["Bob", 45, 12.5], ["Charlie", 22, 8.0]]
File.rm("data.csv")
Summary
Functions
Pure function to convert strings into Elixir types (Integer, Float, etc.).
Initiates the parsing pipeline for a file, applying concurrency and type coercion.
Functions
Pure function to convert strings into Elixir types (Integer, Float, etc.).
@spec parse_file(String.t(), String.t()) :: Enumerable.t()
Initiates the parsing pipeline for a file, applying concurrency and type coercion.