ExLedger.Parser.Declarations (ex_ledger v0.6.0)
Extract and validate transaction element declarations (payees, commodities, tags).
Summary
Functions
Checks that all accounts in transactions are declared.
Checks that all commodities in transactions are declared.
Checks that all payees in transactions are declared.
Checks that all tags in transactions and comments are declared.
Extracts commodity declarations from input (symbols only).
Extracts full commodity definitions from input.
Extracts payee declarations from input.
Extracts tag declarations from input.
Returns the first transaction by date.
Returns the last transaction by date.
Lists all unique accounts from transactions.
Lists all unique commodities (currencies) from transactions.
Lists all unique payees from transactions.
Lists all unique tags from transaction postings.
Functions
@spec check_accounts([map()], %{required(String.t()) => atom() | String.t()}) :: :ok | {:error, String.t()}
Checks that all accounts in transactions are declared.
Checks that all commodities in transactions are declared.
Checks that all payees in transactions are declared.
Checks that all tags in transactions and comments are declared.
Extracts commodity declarations from input (symbols only).
Extracts full commodity definitions from input.
Parses commodity declarations with their subdirectives:
- format: Display format string
- note: Description
- alias: Alternative symbol
- default: Whether this is the default commodity
- nomarket: Whether to exclude from market value calculations
Example
commodity CHF
format CHF 1'000.00
note Swiss FrancReturns a map of symbol => commodity_definition.
Extracts payee declarations from input.
Extracts tag declarations from input.
Returns the first transaction by date.
Returns the last transaction by date.
Lists all unique accounts from transactions.
Lists all unique commodities (currencies) from transactions.
Lists all unique payees from transactions.
Lists all unique tags from transaction postings.