Eq package:hledger-lib

Add equity postings inferred from costs, where needed and possible. See hledger manual > Cost reporting.
Identify and tag (1) equity conversion postings and (2) postings which have (or could have ?) redundant costs. And if the addcosts flag is true, also add any costs which can be inferred from equity conversion postings. This is always called before transaction balancing to tag the redundant-cost postings so they can be ignored. With --infer-costs, it is called again after transaction balancing (when it has more information to work with) to infer costs from equity postings. See transactionTagCostsAndEquityAndMaybeInferCosts for more details, and hledger manual > Cost reporting for more background.
Generate equity conversion postings corresponding to a Posting's cost(s) (one pair of conversion postings per cost), wherever they don't already exist.
For any costs in this Transaction which don't have associated equity conversion postings, generate and add those.
Find, associate, and tag the corresponding equity conversion postings and costful or potentially costful postings in this transaction. With a true addcosts argument, also generate and add any equivalent costs that are missing. The (previously detected) names of all equity conversion accounts should be provided. For every pair of adjacent conversion postings, this first searches for a posting with equivalent cost (1). If no such posting is found, it then searches the costless postings, for one matching one of the conversion amounts (2). If either of these found a candidate posting, it is tagged with costPostingTagName. Then if in addcosts mode, if a costless posting was found, a cost equivalent to the conversion amounts is added to it. The name reflects the complexity of this and its helpers; clarification is ongoing.
A version of parseQueryList which acts on a single Text of space-separated terms. The usual shell quoting rules are assumed. When a pattern contains whitespace, it (or the whole term including prefix) should be enclosed in single or double quotes. A query term is either:
  1. a search pattern, which matches on one or more fields, eg:acct:REGEXP - match the account name with a regular expression desc:REGEXP - match the transaction description date:PERIODEXP - match the date with a period expression
The prefix indicates the field to match, or if there is no prefix account name is assumed.
  1. a query option, which modifies the reporting behaviour in some way. There is currently one of these, which may appear only once:inacct:FULLACCTNAME
Period expressions may contain relative dates, so a reference date is required to fully parse these.
>>> parseQuery nulldate "expenses:dining out"
Right (Or [Acct (RegexpCI "expenses:dining"),Acct (RegexpCI "out")],[])
>>> parseQuery nulldate "\"expenses:dining out\""
Right (Acct (RegexpCI "expenses:dining out"),[])
Convert a list of space-separated queries to a single query Multiple terms are combined as follows: 1. multiple account patterns are OR'd together 2. multiple description patterns are OR'd together 3. multiple status patterns are OR'd together 4. then all terms are AND'd together
Parse a single query term as either a query or a query option, or return an error message if parsing fails.
If the specified journal file does not exist (and is not "-"), call error with an informative message. (Using "journal file" generically here; it could be in any of hledger's supported formats.)
Parse a single line of possibly empty text enclosed in double quotes.
infer equity conversion postings from costs ?
This is a version of sequence based on difference lists. It is slightly faster but we mostly use it because it uses the heap instead of the stack. This has the advantage that Neil Mitchell’s trick of limiting the stack size to discover space leaks doesn’t show this as a false positive.
Single-quote this string if it contains whitespace or double-quotes. Does not work for strings containing single quotes.
Assert a parser produces an expected value.