ledger-parser

Crates.io Version Docs.rs Version License Unlicense

Rust library for parsing Ledger-cli input files.

File format

Only a subset of the ledger-cli's file format is implemented.

Supported elements:

Example

Parsing:

rust let ledger = ledger_parser::parse(r#"; Example 1 2018-10-01=2018-10-14 ! (123) Description ; Transaction comment TEST:Account 123 $1.20 ; Posting comment TEST:Account 345 -$1.20"#)?;

Serializing:

```rust use ledger_parser::{ Serializer, SerializerSettings };

println!("{}", ledger); println!("{}", ledger.tostringpretty(&SerializerSettings::default().with_indent("\t"))); ```

See also