xkikeg / okane

Plain text accounting software supporting ledger-cli format using Rust
MIT License
4 stars 0 forks source link

okane

CircleCI crates.io

Okane is a plain text accounting software developed with Rust, influenced by ledger-cli.

This tool supports various commands:

Note balance, register are still work-in-progress, and the UX would change drastically.

How to use

Disclaimer: This software is still in early phase, subject to any kind of change.

Follows syntax page for the supported syntax.

Install

Up until now no binary release is provided, so you need to run cargo install to install the tool.

$ cargo install okane

Query the file

Similar to Ledger, you can use similar commands.

$ okane accounts /path/to/file.ledger
$ okane balance /path/to/file.ledger
$ okane registry /path/to/file.ledger [optional account]

Format the file

$ okane format ~/ledger/account.ledger

This command currently prints the formatted output into standard output. In future in-place format would be provided, also to emit diffs to be used as Git hook.

Import CSV or ISO Camt053 XML files

First you need to write YAML file to control import behavior. We'll assume those are placed under ~/ledger/. The format of YAML is (sorry) not documented, but you can see tests/testdata directory as example configurations.

Then run the okane import command with logging and redirecting to /dev/null. This way you can dry-run and check its output.

$ RUST_LOG=info okane import --config ~/ledger/import.yml ~/ledger/input_file.csv > /dev/null

After iterating over the logs and modifying YAML file, you can redirect the standard output to the ledger file.

$ RUST_LOG=info okane import --config ~/ledger/import.yml ~/ledger/input_file.csv >> ~/ledger/output_path.ledger

Tips: You probably don't want to handle all the entries, rather should aim to cover 80-90% of entries initially.

License

This tool is licensed under MIT lisence.