#csv #accounting #statement #consume #set #transaction #list

app csv_ledger

Consume a CSV containing a list of transactions and produce a set of bank account statements

3 releases

0.1.2 Sep 3, 2022
0.1.1 Sep 3, 2022
0.1.0 Aug 31, 2022

#2042 in Database interfaces

37 downloads per month

MIT license

68KB
944 lines

csv_ledger

A project to learn zero-copy parsing and improve my Rust performance profiling and coverage tooling knowledge.


🛠 Installation

cargo install csv_ledger

🔋 Usage

Print output to console:

csv_ledger foo.csv

Save output to file:

csv_ledger --output output.csv foo.csv

To see helpful information:

csv_ledger --help

📚 Documentation

Further documentation can be found here.

🔬 Testing

To run tests for the CLI:

cargo test --features test_args

To run tests for the library:

cd lib && cargo test

📝 Code Coverage

This project aimed to have a near 100% code-coverage. Whilst Rust provides first-class error checking, it cannot easily protect against logic errors. With strong test coverage in combination with Rust's error checking, you can have a high degree of confidence. However, I have found that getting to 100% coverage can be very difficult whilst using llvm-cov. LLVM's coverage tooling is far more precise than other coverage tools that I have worked with in the past (such as Jest), requiring all lines, branches, derived traits and implementations to be covered.

A pre-generated coverage report can be found in: /coverage/html.

Run Coverage Locally

Setup

rustup component add llvm-tools-preview &&
cargo install cargo-llvm-cov

Usage

To create a coverage report:

cargo llvm-cov --features test_args

To debug a coverage report:

cargo llvm-cov --features test_args --html --output-dir coverage

Dependencies

~4MB
~76K SLoC