#ledger #accounting #ledger-cli #text #cli-tool #plain #cli #format #import #software

bin+lib okane

CLI tool to support Ledger (https://www.ledger-cli.org/) usecases. Curently it provides import feature.

9 unstable releases (3 breaking)

0.5.4 Mar 3, 2023
0.5.3 Dec 14, 2022
0.5.2 Nov 11, 2022
0.5.1 Sep 7, 2022
0.1.0 Nov 26, 2021

#28 in Finance

22 downloads per month

MIT license



CircleCI crates.io

Rust based plain text accounting software, influenced by ledger.

Currently this software is developed just to meet author personal needs, and implementing two features.

  • format is to format given Ledger file into organized format.
  • import is to convert various source including CSV, ISO Camt053 XML into Ledger format.

How to use

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

Format the file

cargo build
RUST_LOG=info ./target/debug/okane format ~/ledger/account.ledger

This command currently prints the formatted output into standard output. I'll work to replace the files in-place, 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 for example configuration.

Then run the okane import command with logging and redirecting to /dev/null. This way you can check unhandled entries.

$ cargo build
$ RUST_LOG=info ./target/debug/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.

$ cargo build
$ RUST_LOG=info ./target/debug/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.


~730K SLoC