All Projects → marek-g → rust-ledger-parser

marek-g / rust-ledger-parser

Licence: Unlicense license
Rust library for parsing ledger cli (https://www.ledger-cli.org/) input files.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rust-ledger-parser

npo-ledger-cli
Give Up GitHub: https://GiveUpGitHub.org
Stars: ✭ 57 (+159.09%)
Mutual labels:  ledger, ledger-cli
ledgible
Web-based double-entry accounting (ledger-cli frontend)
Stars: ✭ 58 (+163.64%)
Mutual labels:  ledger, ledger-cli
Frame
System-wide Web3 for macOS, Windows and Linux
Stars: ✭ 225 (+922.73%)
Mutual labels:  ledger
nledger
.Net Ledger: Double-Entry Accounting System
Stars: ✭ 141 (+540.91%)
Mutual labels:  ledger
conceal-desktop
Conceal Desktop (GUI)
Stars: ✭ 65 (+195.45%)
Mutual labels:  ledger
Vim Ledger
Vim plugin for Ledger
Stars: ✭ 253 (+1050%)
Mutual labels:  ledger
bankster
Money Creation Made Easy
Stars: ✭ 30 (+36.36%)
Mutual labels:  ledger
Insolar
Enterprise-ready blockchain platform
Stars: ✭ 192 (+772.73%)
Mutual labels:  ledger
Nault
⚡ The most advanced Nano wallet with focus on security, speed and robustness
Stars: ✭ 228 (+936.36%)
Mutual labels:  ledger
ledgers
No description or website provided.
Stars: ✭ 26 (+18.18%)
Mutual labels:  ledger
ledger-app-nano
Ledger Nano X, Nano S & Blue applications for NANO and derivative coins
Stars: ✭ 34 (+54.55%)
Mutual labels:  ledger
hledger-iadd
A terminal UI as drop-in replacement for hledger add.
Stars: ✭ 61 (+177.27%)
Mutual labels:  ledger
ledg
Batch modifiable ledger-like written in nodejs
Stars: ✭ 32 (+45.45%)
Mutual labels:  ledger
Plaintextaccounting.github.io
The plaintextaccounting.org website, a portal to Ledger, hledger, beancount and co.
Stars: ✭ 230 (+945.45%)
Mutual labels:  ledger
ripple-binary-codec
Convert between json and hex representations of transactions and ledger entries on the XRP Ledger. Moved to: https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-binary-codec
Stars: ✭ 18 (-18.18%)
Mutual labels:  ledger
Wavelet
Write once, run forever. Deploy robust, scalable, decentralized WebAssembly applications on Wavelet.
Stars: ✭ 224 (+918.18%)
Mutual labels:  ledger
database-journal
Databases: Concepts, commands, codes, interview questions and more...
Stars: ✭ 50 (+127.27%)
Mutual labels:  ledger
pygnucash
Python code to read gnucash 2.6 sqlite3 files; features gnucash 2 ledger translator.
Stars: ✭ 31 (+40.91%)
Mutual labels:  ledger
ledger2beancount
Ledger to Beancount text-based converter
Stars: ✭ 63 (+186.36%)
Mutual labels:  ledger
total recall
Turn any csv into Ledger journals. Canonical repository can be found at -->
Stars: ✭ 16 (-27.27%)
Mutual labels:  ledger

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:

  • Line comments (starting with: ; # % | *)

  • Inline comments (starting with ;)

  • Transaction headers with format (minimum two spaces or one tab between DESC and NOTE):

    DATE[=EDATE] [*|!] [(CODE)] DESC  [; NOTE]
    
  • Transaction postings with format (minimum two spaces or one tab between ACCOUNT and AMOUNT):

      ACCOUNT  [AMOUNT] [= BALANCE] [; NOTE]
    
    • Virtual accounts are supported
  • AMOUNT can be combined with lot and commodity prices ({}, {{}}, @, @@)

  • Commodity prices with format:

    P DATE SYMBOL PRICE
    
  • Command directives: include

Example

Parsing:

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:

use ledger_parser::{ Serializer, SerializerSettings };

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

See also

  • ledger-utils - ledger-cli file processing Rust library, useful for calculating balances, creating reports etc.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].