Crate ledger_parser

Source
Expand description

Rust library for parsing Ledger-cli input files.

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

Structs§

Amount
Commodity
CommodityPrice
Commodity price.
Ledger
Main document. Contains transactions and/or commodity prices.
Posting
PostingAmount
PostingMetadata
Posting metadata. Also appears on Transaction
SerializerSettings
Tag
Transaction
Transaction.

Enums§

Balance
CommodityPosition
LedgerItem
ParseError
Price
Reality
TagValue
TransactionStatus

Traits§

Serializer

Functions§

parse
Parses ledger-cli source to AST tree.