A parser for Ledger accounting files written in Elixir.
Caveat Emptor: It doesn't support the full range of ledger's capabilities. It's just the bare minimum I needed to parse my ~10 years worth of ledger files.
Pull requests more than welcome. Be nice.
txt = """
2019/01/02 Hello AMEX
Liabilities:AMEX $2000.00
Income $-2000.00 = $0
2019/01/02 Another AMEX
Liabilities:AMEX $4000.00
Income
"""
# Load and parse the date
res = Ledger.Parsers.Ledger.parse(txt)
# Re-create the ledger file
Enum.each(res, fn x ->
IO.puts(Ledger.Entry.to_string(x))
end)
Ledger.balance(txt)