Double-entry accounting ledger file format converter
Perl6
Latest commit d33715a Feb 8, 2017 @atweiden mv META.info META6.json
rename META.info to META6.json to be more compatible with S22 spec [1]

[1]: https://design.perl6.org/S22.html#DISTRIBUTION
Permalink
Failed to load latest commit information.
bin rm superfluous variable assignments Sep 17, 2016
lib adjust for XE.asset-price Sep 23, 2016
t plan 1 Sep 4, 2016
.gitignore Initial import Sep 1, 2016
.hgignore Initial import Sep 1, 2016
.peru.yml reup peru, git checkout commit ID Dec 3, 2016
.travis.yml reup peru, git checkout commit ID Dec 3, 2016
Build.pm reup peru, git checkout commit ID Dec 3, 2016
META6.json
README.md add cmdline readme, module stubs Sep 1, 2016
UNLICENSE Initial import Sep 1, 2016

README.md

TXN::Remarshal

Double-entry accounting ledger file format converter

Synopsis

cmdline

read TXN from stdin, write JSON to stdout:

cat sample.txn | txn-remarshal -if=txn -of=json

read TXN from sample.txn, write JSON to sample.json:

txn-remarshal -i=sample.txn -if=txn -of=json -o=sample.json

perl6

use TXN::Remarshal;

my Str $txn = Q:to/EOF/;
2014-01-01 "I started the year with $1000 in Bankwest"
  Assets:Personal:Bankwest:Cheque    $1000 USD
  Equity:Personal                    $1000 USD
EOF

# convenience wrappers
my TXN::Parser::AST::Entry @entry = from-txn($txn);
my Str $s = to-txn(@entry);

# txn ↔ entry
my TXN::Parser::AST::Entry @entry = remarshal($txn, :if<txn>, :of<entry>);
my Str $ledger = remarshal(@entry, :if<entry>, :of<txn>);

# entry ↔ hash
my Hash @a = remarshal(@entry, :if<entry>, :of<hash>);
my TXN::Parser::AST::Entry @e = remarshal(@a, :if<hash>, :of<entry>);

# hash ↔ json
my Str $json = remarshal(@a, :if<hash>, :of<json>);
my Hash @b = remarshal($json, :if<json>, :of<hash>);

Installation

Dependencies

Test Dependencies

To run the tests:

$ git clone https://github.com/atweiden/txn-remarshal && cd txn-remarshal
$ peru --file=.peru.yml --sync-dir="$PWD" sync
$ PERL6LIB=lib prove -r -e perl6

Licensing

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.