Skip to content

MigaduMail/ledgerex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ledgerex

Apache License Hex.pm Documentation Build Status Coverage Status

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.

Example

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)

About

Elixir parser for ledger files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%