qo1      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                              !"#$%&'()*+,-./0portablealpha"John MacFarlane <jgm@berkeley.edu> 12     VA generic, pure specification of how to filter (or search) transactions and postings. "only include if in this date span only include if cleared/ uncleared/don't care only include if real/don't care %include if empty (ie amount is zero) 0only include if matching these account patterns 4only include if matching these description patterns postings in this account 0sum of postings in this account and subaccounts FA hledger journal reader is a triple of format name, format-detecting % predicate, and a parser to Journal.  !"@A JournalUpdate is some transformation of a Journal. It can do I/O or  raise an error. #$%&'()*,any trailing comments from the journal file +0the context (parse state) at the end of parsing ,+the file path and raw text of the main and . any included journal files. The main file is - first followed by any included files in the  order encountered. -1when this journal was last read from its file(s) . A journal context0 is some data which can change in the course of I parsing a journal. An example is the default year, which changes when a G Y directive is encountered. At the end of parsing, the final context / is saved for later use by eg the add command. /00the default year most recently specified with Y 15the default commodity most recently specified with D 2$the current stack of parent accounts/account name components  specified with account# directive(s). Concatenated, these = are the account prefix prepended to parsed account names. 33the current list of account name aliases in effect 456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVthis transaction'!s postings (co-recursive types). WXYZ[\]^_` this posting'+s parent transaction (co-recursive types). 4 Tying this knot gets tedious, Maybe makes it easier/ optional. abcdefghijk*the price for this amount at posting time l An amount'/s price in another commodity may be written as @ unit  price or @@7 total price. Note although a MixedAmount is used, it F should be in a single commodity, also the amount should be positive; # these are not enforced currently. mnopq the commodity' s symbol 3 display preferences for amounts of this commodity r2should the symbol appear on the left or the right s4should there be a space between symbol and quantity t$number of decimal places to display 6 XXX these three might be better belonging to Journal u"character to use as decimal point v<character to use for separating digit groups (eg thousands) w>positions of separators, counting leftward from decimal point xyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~|~}{xzyopqrstuvwlnmghijkefadcbXYZ[\]^_`MNOPQRSTUVWIJKLEFGH?DCBA@:;<=>567894./0123#$%&'()*+,-" !     ! !"# $%&'()*+,-$%&'()*+,-./0123/01234567896789:;<=>;<=>?DCBA@@ABCDEFGHFGHIJKLJKLM NOPQRSTUVWNOPQRSTUVWXYZ[\]^_`YZ[\]^_`adcbbcdeffghijkhijklnmmnopqrstuvwpqrstuvwxzyyz{|~}}~?FA platform string is a string value from or for the operating system, F such as a file path or command-line argument (or environment variable's G name or value ?). On some platforms (such as unix) these are not real G unicode strings but have some encoding such as UTF-8. This alias does , no type enforcement but aids code clarity. $Wrap a string in single quotes, and -prefix any embedded single A quotes, if it contains whitespace and is not already single- or  double-quoted. "Quote-aware version of words - don'+t split on spaces which are inside quotes.  NB correctly handles a'b but not ''a''. OQuote-aware version of unwords - single-quote strings which contain whitespace LStrip one matching pair of single or double quotes on the ends of a string. \Join multi-line strings as side-by-side rectangular strings of the same height, top-padded. _Join multi-line strings as side-by-side rectangular strings of the same height, bottom-padded. .Compose strings vertically and right-aligned. XConvert a multi-line string to a rectangular string top-padded to the specified height. [Convert a multi-line string to a rectangular string bottom-padded to the specified height. XConvert a multi-line string to a rectangular string left-padded to the specified width. YConvert a multi-line string to a rectangular string right-padded to the specified width. NClip a multi-line string to the specified width and height from the top left. IClip and pad a multi-line string to fill the specified width and height. EConvert a possibly encoded platform string to a real unicode string. ; We decode the UTF-8 encoding recommended for unix systems  (cf http:www.dwheeler.comessays"fixing-unix-linux-filenames.html) $ and leave anything else unchanged. @Convert a unicode string to a possibly encoded platform string. . On unix we encode with the recommended UTF-8  (cf http:www.dwheeler.comessays"fixing-unix-linux-filenames.html) & and elsewhere we leave it unchanged. A version of error that' s better at displaying unicode. A version of userError that' s better at displaying unicode. #List just the leaf nodes of a tree Iget the sub-tree rooted at the first (left-most, depth-first) occurrence  of the specified node value Cget the sub-tree for the specified node value in the first tree in  forest in which it occurs. &remove all nodes past a certain depth apply f to all tree nodes 9remove all subtrees whose nodes do not fulfill predicate (is predicate true in any node of tree ? .show a compact ascii representation of a tree 0show a compact ascii representation of a forest 9trace (print on stdout at runtime) a showable expression < (for easily tracing in the middle of a complex expression) 5labelled trace - like strace, with a label prepended Gmonadic trace - like strace, but works as a standalone line in a monad 1trace an expression using a custom show function @Backtracking choice, use this when alternatives share a prefix. ( Consumes no input if all choices fail.  Get a Test's label, or the empty string. AFlatten a Test containing TestLists into a list of single tests. CFilter TestLists in a Test, recursively, preserving the structure. FSimple way to assert something is some expected value, with no label. JAssert a parse result is successful, printing the parse error on failure. JAssert a parse result is successful, printing the parse error on failure. SAssert a parse result is some expected value, printing the parse error on failure. KApply a function the specified number of times. Possibly uses O(n) stack ? Q3456789:;<=>?@ABC@? a:b:c,d:e -> [a,a:b,a:b:c,d,d:e]  a:b:c,d:e -> [a,d] <From a list of account names, select those which are direct ( subaccounts of the given account name. +Convert a list of account names to a tree. 5Elide an account name to fit in the specified width.  From the ledger 2.6 news:  H What Ledger now does is that if an account name is too long, it will F start abbreviating the first parts of the account name down to two E letters in length. If this results in a string that is still too @ long, the front will be elided -- not the end. For example:  +Expenses:Cash ; OK, not too long  Ex:Wednesday:Cash ; Expenses was abbreviated to fit  Ex:We:Afternoon:Cash ; Expenses and  Wednesday abbreviated E ; Expenses:Wednesday:Afternoon:Lunch:Snack:Candy:Chocolate:Cash 7 ..:Af:Lu:Sn:Ca:Ch:Cash ; Abbreviated and elided! QConvert an account name to a regular expression matching it and its subaccounts. QConvert an account name to a regular expression matching it and its subaccounts. NConvert an exact account-matching regular expression to a plain account name. JDoes this string look like an exact account-matching regular expression ? "DEFGHIJELook up one of the hard-coded default commodities. For use in tests. GFind the conversion rate between two commodities. Currently returns 1. AConvert a list of commodities to a map from commodity symbols to 7 unique, display-preference-canonicalised commodities. KLMNOPQRSTUVW'The empty simple amount. X@Apply a binary arithmetic operator to two amounts, ignoring and A discarding any assigned prices, and converting the first to the B commodity of the second in a simplistic way (1-1 exchange rate). D The highest precision of either amount is preserved in the result. FConvert an amount to the specified commodity, ignoring and discarding 9 any assigned prices and assuming an exchange rate of 1. JConvert an amount to the commodity of its assigned price, if any. Notes: i price amounts must be MixedAmounts with exactly one component Amount (or there will be a runtime error) I price amounts should be positive, though this is not currently enforced Divide an amount's quantity by a constant. Y0Is this amount negative ? The price is ignored. ZMDoes this amount appear to be zero when displayed with its given precision ? [Is this amount really- zero, regardless of the display precision ? N Since we are using floating point, for now just test to some high precision. \BGet the string representation of an amount, based on its commodity's 8 display settings except using the specified precision. 'Set the display precision in the amount' s commodity. GGet the unambiguous string representation of an amount, for debugging. 8Get the string representation of an amount, without any @ price. ]SGet the string representation of an amount, without any price or commodity symbol. ^_BGet the string representation of an amount, based on its commodity's A display settings. String representations equivalent to zero are  converted to just "0". `BGet the string representation of the number part of of an amount, 0 using the display settings from its commodity. aReplace a number string'.s decimal point with the specified character, / and add the specified digit group separators. PFor rendering: a special precision value which means show all available digits. RFor rendering: a special precision value which forces display of a decimal point. Replace an amount'0s commodity with the canonicalised version from  the provided commodity map. The empty mixed amount. IA temporary value for parsed transactions which had no amount specified. bSimplify a mixed amount'.s component amounts: combine amounts with the I same commodity and price, remove any zero amounts, and replace an empty ( amount list with a single zero amount. Simplify a mixed amount'.s component amounts: combine amounts with the F same commodity, remove any zero amounts, and replace an empty amount M list with a single zero amount. Unlike normaliseMixedAmountPreservingPrice, J this one discards all but the first price encountered in each commodity. K (This is used more for display than arithmetic, but seems a bit odd. XXX) Get a mixed amount's component amounts. Convert a mixed amount'.s component amounts to the commodity of their  assigned price, if any. Divide a mixed amount's quantities by a constant. OIs this mixed amount negative, if it can be normalised to a single commodity ? SDoes this mixed amount appear to be zero when displayed with its given precision ? cIs this mixed amount really zero ? See isReallyZeroAmount. Is this mixed amount really zero, after converting to cost  commodities where possible ? AGet the string representation of a mixed amount, showing each of D its component amounts. NB a mixed amount can have an empty amounts  list in which case it shows as "". 'Set the display precision in the amount's commodities. EGet the string representation of a mixed amount, showing each of its @ component amounts with the specified precision, ignoring their  commoditys' display precision settings. JGet an unambiguous string representation of a mixed amount for debugging. =Get the string representation of a mixed amount, but without  any @ prices. Replace a mixed amount'0s commodity with the canonicalised version from  the provided commodity map. de:Get the current local date. $Get the current local month number. Get the current local year.  OSplit a DateSpan into one or more consecutive spans at the specified interval.   ECount the days in a DateSpan, or if it is open-ended return Nothing.  'Does the span include the given date ?  BCombine two datespans, filling any unspecified dates in the first  with dates from the second. -Calculate the intersection of two datespans. DParse a period expression to an Interval and overall DateSpan using 7 the provided reference date, or return a parse error. EShow a DateSpan as a human-readable pseudo-period-expression string. EConvert a single smart date string to a date span using the provided $ reference date, or raise an error. /Convert a smart date string to an explicit yyyy/mm/dd string using 1 the provided reference date, or raise an error. #A safe version of fixSmartDateStr. KConvert a SmartDate to an absolute date using the provided reference date. ;Parse a couple of date-time string formats to a time type. 6Parse a couple of date string formats to a time type. <Parse a date-time string to a time type, or raise an error. 7Parse a date string to a time type, or raise an error. BParse a time string to a time type using the provided pattern, or  return the default. 4Parse a date in any of the formats allowed in ledger's period expressions, and maybe some others:   2004  2004/10  2004/10/1  10/1  21  october, oct  yesterday, today, tomorrow , this/next/last week/day/month/quarter/year NReturns a SmartDate, to be converted to a full date later (see fixSmartDate). :Assumes any text in the parse stream has been lowercased. PLike smartdate, but there must be nothing other than whitespace after the date.  !"#$%&'()*+,-./0123456789:;CMake a datespan from two valid date strings parseable by parsedate % (or raise an error). Eg: mkdatespan "201111" "20111231". <=\    fghi jklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=:     ! "$#%&'()*+,-/.0123456789:;<=:      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHAIs this posting cleared? If this posting was individually marked 8 as cleared, returns True. Otherwise, return the parent  transaction'+s cleared status or, if there is no parent  transaction, return False. I4Does this posting fall within the given date span ? JK>Get the minimal date span which contains all the postings, or - DateSpan Nothing Nothing if there are none. LMNO<Prefix one account name to another, preserving posting type % indicators like concatAccountNames. P7Join account names into one. If any of them has () or [] posting type H indicators, these (the first type encountered) will also be applied to  the resulting account name. QVRewrite an account name using the first applicable alias from the given list, if any. >?@ABCDEFGHIJKLMNOPQ>?@ABCDEFGHIJKLMNOPQ>?@ABCDEFGHIJKLMNOPQ RSGShow a journal transaction, formatted for the print command. ledger 2.x's !standard format looks like this:  yyyymmdd[ *][ CODE]: description......... [ ; comment...............] O account name 1..................... ...$amount1[ ; comment...............] O account name 2..................... ..$-amount1[ ; comment...............]  Dpcodewidth = no limit -- 10 -- mimicking ledger layout. 0pdescwidth = no limit -- 20 -- I don't remember what these mean, Lpacctwidth = 35 minimum, no maximum -- they were important at the time. pamtwidth = 11 pcommentwidth = no limit -- 22 TUV=Show an account name, clipped to the given width if any, and  appropriately bracketed/*parenthesised for the given posting type. WXYZ[\Get the sums of a transaction'0s real, virtual, and balanced virtual postings. ]5Is this transaction balanced ? A balanced transaction's real D (non-virtual) postings sum to 0, and any balanced virtual postings  also sum to 0. ^BEnsure this transaction is balanced, possibly inferring a missing A amount or a conversion price first, or return an error message. 1Balancing is affected by the provided commodities' display precisions. AWe can infer an amount when there are multiple real postings and B exactly one of them is amountless; likewise for balanced virtual G postings. Inferred amounts are converted to cost basis when possible. DWe can infer a price when all amounts were specified and the sum of  real postings'9 amounts is exactly two non-explicitly-priced amounts in @ different commodities; likewise for balanced virtual postings. _`abEOnce we no longer need both, set the main transaction date to either , the actual or effective date. A bit hacky. cEnsure a transaction's postings refer back to it. d Set a posting's parent transaction. RSTUVWXYZ[\]^_`abcdRSTUVWXYZ[\]^_`abcdRSTUVWXYZ[\]^_`abcd $eA query option changes a query 's/report'$s behaviour and output in some way. f:as above but include sub-accounts in the account register M | QueryOptCostBasis -- ^ show amounts converted to cost where possible L | QueryOptEffectiveDate -- ^ show effective dates instead of actual dates g2show an account register focussed on this account hCA matcher is a single, or boolean composition of, search criteria, G which can be used to match postings, transactions, accounts and more. N Currently used by hledger-web, will likely replace FilterSpec at some point. i;match if account depth is less than or equal to this value j match if  emptiness6 (from the --empty command-line flag) has this value. 4 Currently this means a posting with zero amount. k match if realness8 (involves a real non-virtual account ?) has this value l'match if cleared status has this value m*match if effective date in this date span n'match if actual date in this date span o1match postings whose account matches this regexp p)match if description matches this regexp qmatch if all of these match rmatch if any of these match snegate this match t never match u always match vXThe account we are currently focussed on, if any, and whether subaccounts are included. ' Just looks at the first query option. wCA matcher for the account(s) we are currently focussed on, if any. ' Just looks at the first query option. xCConvert a query expression containing zero or more space-separated L terms to a matcher and zero or more query options. A query term is either:  \ a search criteria, used to match transactions. This is usually a prefixed pattern such as:  acct:REGEXP  date:PERIODEXP  not:desc:REGEXP W a query option, which changes behaviour in some way. There is currently one of these: 2 inacct:FULLACCTNAME - should appear only once  Multiple search criteria are AND' ed together. e When a pattern contains spaces, it or the whole term should be enclosed in single or double quotes. Q A reference date is required to interpret relative dates in period expressions. y-Quote-and-prefix-aware version of words - don't split on spaces which I are inside quotes, including quotes which may have one of the specified J prefixes in front, and maybe an additional not: prefix in front of that. zAParse a single query term as either a matcher or a query option. {"Parse the boolean value part of a status: matcher, allowing * as @ another way to spell True, similar to the journal file format. |"Parse the boolean value part of a status: matcher. A true value can  be spelled as 1, t or true. }~+Convert a match expression to its inverse. /Does the match expression match this posting ? 3Does the match expression match this transaction ? /Does the match expression match this account ? 3 A matching in: clause is also considered a match. 4What start date does this matcher specify, if any ? O If the matcher is an OR expression, returns the earliest of the alternatives. D When the flag is true, look for a starting effective date instead. DDoes this matcher specify a start date and nothing else (that would & filter postings prior to the date) ? D When the flag is true, look for a starting effective date instead. %Does this matcher match everything ? AWhat is the earliest of these dates, where Nothing is earliest ? ?What is the latest of these dates, where Nothing is earliest ? .Compare two maybe dates, Nothing is earliest. 'efghijklmnopqrstuvwxyz{|}~$hutsrqponmlkjiegfvwxyz{|}~$egffgh utsrqponmlkjiijklmnopqrstuvwxyz{|}~ CConvert time log entries to journal transactions. When there is no E clockout, add one with the provided current time. Sessions crossing ? midnight are split into days to give accurate per-day totals. FConvert a timelog clockin and clockout entry to an equivalent journal S transaction, representing the time expenditure. Note this entry is not balanced,  since we omit the " assets:time"! transaction for simpler output.  12Keep only postings matching the query expression. ) This can leave unbalanced transactions. 6Keep only transactions matching the query expression. AKeep only transactions we are interested in, as described by the  filter specification. DKeep only postings we are interested in, as described by the filter 8 specification. This can leave unbalanced transactions. KKeep only transactions whose description matches the description patterns. ?Keep only transactions which fall between begin and end dates. O We include transactions on the begin date and exclude transactions on the end @ date, like ledger. An empty date string means no restriction. 7Keep only transactions which have the requested cleared/ uncleared  status, if there is one. 3Keep only postings which have the requested cleared/uncleared status,  if there is one. BStrip out any virtual postings, if the flag is true, otherwise do  no filtering. BStrip out any postings with zero amount, unless the flag is true. NKeep only transactions which affect accounts deeper than the specified depth. CStrip out any postings to accounts deeper than the specified depth < (and any transactions which have no postings as a result). NKeep only transactions which affect accounts matched by the account patterns. E More precisely: each positive account pattern excludes transactions H which do not contain a posting to a matched account, and each negative I account pattern excludes transactions containing a posting to a matched  account. JKeep only postings which affect accounts matched by the account patterns. ) This can leave transactions unbalanced. Convert this journal's transactions' primary date to either the  actual or effective date. ZApply additional account aliases (eg from the command-line) to all postings in a journal. ADo post-parse processing on a journal, to make it ready for use. DFill in any missing amounts and check that all journal transactions E balance, or return an error message. This is done after parsing all D amounts and working out the canonical commodities, since balancing I depends on display precision. Reports only the first error encountered. Convert all the journal'%s amounts to their canonical display B settings. Ie, all amounts in a given commodity will use (a) the G display settings of the first, and (b) the greatest precision, of the J amounts in that commodity. Prices are canonicalised as well, so consider 3 calling journalApplyHistoricalPrices before this. Apply this journal'?s historical price records to unpriced amounts where possible. VGet the price for a commodity on the specified day from the price database, if known. F Does only one lookup step, ie will not look up the price of a price. QClose any open timelog sessions in this journal using the provided current time. Convert all this journal'4s amounts to cost by applying their prices, if any. Get this journal'Cs unique, display-preference-canonicalised commodities, by symbol. Get all this journal' s amounts'# commodities, in the order parsed. Get all this journal'5s amount and price commodities, in the order parsed. Get this amount'9s commodity and any commodities referenced in its price. Get all this journal' s amounts, in the order parsed. 7The (fully specified) date span containing this journal's transactions, 0 or DateSpan Nothing Nothing if there are none. !Check if a set of hledger account/(description filter patterns matches the I given account name or entry description. Patterns are case-insensitive E regular expressions. Prefixed with not:, they become anti-patterns. BCalculate the account tree and all account balances from a journal's 7 postings, returning the results for efficient lookup. FGiven a list of postings, return an account name tree and three query A functions that fetch postings, subaccount-excluding-balance and / subaccount-including-balance by account name. EAdd subaccount-excluding and subaccount-including balances to a tree G of account names somewhat efficiently, given a function that looks up  transactions by account name. >Convert a list of postings to a map from account name to that  account' s postings. 811 Filter a journal'3s transactions as specified, and then process them D to derive a ledger containing all balances, the chart of accounts,  canonicalised commodities etc. Filter a journal'3s transactions as specified, and then process them D to derive a ledger containing all balances, the chart of accounts,  canonicalised commodities etc. 1 Like journalToLedger but uses the new matchers.  List a ledger's account names. %Get the named account from a ledger.  List a ledger's accounts, in tree order  List a ledger'$s top-level accounts, in tree order  List a ledger'9s bottom-level (subaccount-less) accounts, in tree order BAccounts in ledger whose name matches the pattern, in tree order. List a ledger account's immediate subaccounts  List a ledger'!s postings, in the order parsed.  Get a ledger'+s tree of accounts to the specified depth.  Get a ledger'4s tree of accounts rooted at the specified account. 9The (fully specified) date span containing all the ledger's (filtered) transactions, 0 or DateSpan Nothing Nothing if there are none. Convenience aliases. KGiven a JournalUpdate-generating parsec parser, file path and data string, , parse and post-process a Journal so that it'"s ready to use, or give an error. UConvert a possibly relative, possibly tilde-containing file path to an absolute one. X using the current directory from a parsec source position. ~username is not supported.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~DEFGHIJKLMNOPQRSTUVWde    fghi jklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~D>An accounts report is a list of account names (full and short I variants) with their balances, appropriate indentation for rendering as  a hierarchy, and grand total. 6A transactions report includes a list of transactions I (posting-filtered and unfiltered variants), a running balance, and some A other information helpful for rendering a register view (a flag D indicating multiple other accounts and a display string describing 7 them) with or without a notion of current account(s). FA postings report is a list of postings with a running total, a label R for the total field, and a little extra transaction info to help with rendering. <A journal entries report is a list of whole transactions as ? originally entered in the journal (mostly). Used by eg hledger's print  command and hledger-web's journal entries view. ;Figure out the date span we should report on, based on any  beginend>period options provided. A period option will cause begin and  end options to be ignored.  EFigure out the reporting interval, if any, specified by the options. H --period overrides --daily overrides --weekly overrides --monthly etc.  1Get a maybe boolean representing the last cleared/uncleared option if any.  :Report which date we will report on based on --effective. 9Select a Transaction date accessor based on --effective.  Convert this journal's transactions' primary date to either the + actual or effective date, as per options.  Convert this journal' s postings'& amounts to the cost basis amounts if  specified by options. *Convert application options to the library' s generic filter specification. FGather filter pattern arguments into a list of account patterns and a A list of description patterns. We interpret pattern arguments as  follows: those prefixed with desc: are description patterns, all : others are account patterns; also patterns prefixed with not: are 9 negated. not: should come after desc: if both are used. +Select transactions for an entries report. CSelect postings from the journal and add running balance and other : information to make a postings report. Used by eg hledger's register command. %Generate postings report line items. ?Generate one postings report line item, from a flag indicating I whether to include transaction info, a posting, and the current running  balance. KDate-sort and split a list of postings into three spans - postings matched L by the given display expression, and the preceding and following postings. BDoes this display expression allow this posting to be displayed ? . Raises an error if the display expression can' t be parsed. EParse a hledger display expression, which is a simple date test like  d>[DATE] or  d<=[DATE], and return a Posting-matching predicate. EClip the account names to the specified depth in a list of postings. Clip a posting''s account name to the specified depth. CConvert a list of postings into summary postings. Summary postings H are one per account per interval and aggregated to the specified depth  if any. DGiven a date span (representing a reporting interval) and a list of E postings within it: aggregate the postings so there is only one per  account, and adjust their date/%description so that they will render ! as a summary for this interval. DAs usual with date spans the end date is exclusive, but for display = purposes we show the previous day as end date, like ledger. BWhen a depth argument is present, postings to accounts of greater & depth are aggregated where possible. EThe showempty flag includes spans with no postings and also postings  with 0 amount. FSelect transactions from the whole journal for a transactions report,  with no "current"' account. The end result is similar to  postingsReport6 except it uses matchers and transaction-based report B items and the items are most recent first. Used by eg hledger-web's  journal view. 'Select transactions within one or more "current" accounts, and make a ? transactions report relative to those account(s). This means:  I it shows transactions from the point of view of the current account(s). K The transaction amount is the amount posted to the current account(s).  The other accounts' names are provided. E With no transaction filtering in effect other than a start date, it N shows the accurate historical running balance for the current account(s). 6 Otherwise it shows a running total starting at 0. GCurrently, reporting intervals are not supported, and report items are * most recent first. Used by eg hledger-web's account register view. @Generate transactions report items from a list of transactions, J using the provided query and current account matchers, starting balance, 5 sign-setting function and balance-summing function. 9Generate a short readable summary of some postings, like  from (negatives) to (positives). .Generate a simplified summary of some postings' accounts. CSelect accounts, and get their balances at the end of the selected H period, and misc. display information, for an accounts report. Used by  eg hledger's balance command. CSelect accounts, and get their balances at the end of the selected E period, and misc. display information, for an accounts report. Like  accountsReport2 but uses the new matchers. Used by eg hledger-web's  accounts sidebar. ;Is the named account considered interesting for this ledger's accounts report, & following the eliding style of ledger's balance command ? SDetermine whether an account should get its own line in the --flat balance report. EDetermine whether an account should get its own line in the indented ) balance report. Cf Balance module doc. 5     5     2     01Does the given file path and data provide hledger's journal file format ? Parse and post-process a Journal from hledger's journal file  format, or give an error. 7Top-level journal parser. Returns a single composite, I/O performing,  error-raising  JournalUpdate (and final JournalContext) which can be 6 applied to an empty journal to get the final result.  2Parse a (possibly unbalanced) ledger transaction. Parse a date in YYYYMM.DD format. Fewer digits are allowed. The year 8 may be omitted if a default year has already been set. !Parse a date and time in YYYYMM DD HH:MM[:SS][+-ZZZZ] format. Any E timezone will be ignored; the time is treated as local time. Fewer H digits are allowed, except in the timezone. The year may be omitted if & a default year has already been set. "CParse an account name. Account names may have single spaces inside I them, and are terminated by two or more spaces. They should have one or E more components of at least one character, separated by the account  separator char. DParse an amount, with an optional left or right currency symbol and  optional price. #EParse a numeric quantity for its value and display attributes. Some " international number formats (cf  http:en.wikipedia.orgwiki(Decimal_separator) are accepted: either E period or comma may be used for the decimal point, and the other of I these may be used for separating digit groups in the integer part (eg a F thousands separator). This returns the numeric value, the precision I (number of digits to the right of the decimal point), the decimal point H and separator characters (defaulting to . and ,), and the positions of C separators (counting leftward from the decimal point, the last is  assumed to repeat).  !"#$ "! #$  !"#%6Does the given file path and data provide timeclock.el's timelog format ? Parse and post-process a Journal from timeclock.el' s timelog H format, saving the provided file path and the current time, or give an  error. Parse a timelog entry. %&%&% )DRead a Journal from this string (and file path), auto-detecting the G data format, or give a useful error string. Tries to parse each known H data format in turn. If none succeed, gives the error message specific I to the intended data format, which if not specified is guessed from the $ file suffix and possibly the data. *BRead a journal from this file, using the specified data format or I trying all known formats, or give an error string; also create the file  if it doesn' t exist. +MIf the specified journal file does not exist, give a helpful error and quit. ,SEnsure there is a journal file at the given path, creating an empty one if needed. 6Give the content for a new auto-created journal file. -DRead a Journal from this string, using the specified data format or 4 trying all known formats, or give an error string. . Get the user'8s journal file path. Like ledger, we look first for the G LEDGER_FILE environment variable, and if that does not exist, for the H legacy LEDGER environment variable. If neither is set, or the value is 7 blank, return the default journal file path, which is  .hledger.journal in the users'"s home directory, or if we cannot + determine that, in the current directory. / Read the user'*s default journal file, or give an error. "#'()*+,-./0 0*-)"./#'(+,)*+,-./f  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWde    fghi jklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     "#'()*+,-./0 !""#$%&'()**+,-../012234567789:;<=>?@ABCDEFGHHIJKLLMNOPQRSTUVVWXYYZ[\\]^_`abcdeffghijklmnopqrsttuvwxyz{{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                       !"#$%&'()*+,-#./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~             hledger-lib-0.16 Hledger.UtilsHledger.Utils.UTF8Hledger.Data.TypesHledger.Data.AccountNameHledger.Data.CommodityHledger.Data.AmountHledger.Data.DatesHledger.Data.PostingHledger.Data.TransactionHledger.Data.MatchingHledger.Data.TimeLogHledger.Data.JournalHledger.Data.LedgerHledger.Read.Utils Hledger.DataHledger.ReportsHledger.Read.JournalReaderHledger.Read.TimelogReader Hledger.ReadHledger.Data.AccountHledgerbase Debug.TracetracereadFile writeFile appendFile getContents hGetContentsputStrputStrLnhPutStr hPutStrLn FilterSpecdatespanclearedrealemptyacctpatsdescpatsdepthAccountaname apostingsabalanceLedgerjournalaccountnametree accountmapReaderrFormat rDetectorrParser JournalUpdateJournal jmodifiertxns jperiodictxnsjtxnsopen_timelog_entrieshistorical_pricesfinal_comment_linesjContextfiles filereadtimeJournalContextCtxctxYear ctxCommodity ctxAccount ctxAliasesYearHistoricalPricehdatehsymbolhamount TimeLogEntrytlcode tldatetime tlcomment TimeLogCodeFinalOutOutInSetRequiredHours SetBalancePeriodicTransactionptperiodicexpr ptpostingsModifierTransaction mtvalueexpr mtpostings Transactiontdateteffectivedatetstatustcode tdescriptiontcomment tmetadata tpostingstpreceding_comment_linesPostingpstatuspaccountpamountpcommentptype pmetadata ptransaction PostingTypeBalancedVirtualPostingVirtualPostingRegularPosting MixedAmountMixedAmount commodityquantitypricePrice TotalPrice UnitPrice Commoditysymbolsidespaced precision decimalpoint separatorseparatorpositionsSideRL AccountNameInterval DayOfWeek DayOfMonthYearsQuartersMonthsWeeksDays NoIntervalDateSpan WhichDate EffectiveDate ActualDate SmartDatePlatformString underline quoteIfSpacedwords'unwords' stripquotes unbracketconcatTopPaddedconcatBottomPaddedvConcatRightAlignedpadtop padbottompadleftpadright cliptopleftfittofromPlatformStringtoPlatformStringerror' userError' difforzero regexMatchesregexMatchesCI regexReplaceregexReplaceCIregexReplaceByregexToCaseInsensitivesplitAtElementleaves subtreeatsubtreeinforest treeprunetreemap treefiltertreeanyshowtree showforeststraceltracemtrace tracewithchoice' parsewith parseWithCtx fromparse parseerrorshowParseErrorshowDateParseErrornonspacespacenonewline restoflinegetCurrentLocalTimetnametflattentfilteris assertParseassertParseFailureassertParseEqualprintParseErrorisLeftisRightapplyNTree'TaccountNameComponentsaccountNameFromComponentsaccountLeafNameaccountNameLevelaccountNameDropexpandAccountNamestopAccountNamesparentAccountNameparentAccountNamesisAccountNamePrefixOfisSubAccountNameOfsubAccountNamesFromaccountNameTreeFrom mergeTreespathtree fromPaths converttreeexpandTreeNamesaccountNameTreeFrom4elideAccountNameclipAccountNameaccountNameToAccountRegexaccountNameToAccountOnlyRegexaccountRegexToAccountNameisAccountRegexcommconversionRatecanonicaliseCommoditiesnullamtamountWithCommodity costOfAmount divideAmountsetAmountPrecisionshowAmountDebugshowAmountWithoutPrice showAmount maxprecisionmaxprecisionwithpointcanonicaliseAmountCommodity nullmixedamt missingamtnormaliseMixedAmountamountscostOfMixedAmountdivideMixedAmountisNegativeMixedAmountisZeroMixedAmountisReallyZeroMixedAmountCostmixedAmountWithCommodityshowMixedAmountsetMixedAmountPrecisionshowMixedAmountWithPrecisionshowMixedAmountDebugshowMixedAmountWithoutPrice canonicaliseMixedAmountCommoditytests_Hledger_Data_AmountshowDate getCurrentDaygetCurrentMonthgetCurrentYearelapsedSeconds splitSpan splitspan daysInSpanspanContainsDateparsePeriodExpr maybePerioddateSpanAsTextspanFromSmartDateStringspanFromSmartDateshowDayfixSmartDateStrfixSmartDateStrEitherfixSmartDateStrEither' fixSmartDateprevdayparsedatetimeM parsedateM parsedatetime parsedate parsetimewith smartdate smartdateonly validYear validMonthvalidDayfailIfInvalidYearfailIfInvalidMonthfailIfInvalidDayyyyymmddymdymydmdmonthmontoday yesterdaytomorrowlastthisnextthing periodexprintervalanddateperiodexprintervalperiodexprdateperiodexprreportingintervalperiodexprdatespandoubledatespan fromdatespan todatespan justdatespan mkdatespan nulldatespannulldate nullposting showPostingshowPostingForRegisterisReal isVirtualisBalancedVirtual hasAmountaccountNamesFromPostings sumPostings postingDatepostingClearedisPostingInDateSpanisEmptyPostingpostingsDateSpanaccountNamePostingTypeaccountNameWithoutPostingTypeaccountNameWithPostingTypejoinAccountNamesconcatAccountNamesaccountNameApplyAliasesnulltransactionshowTransactionshowTransactionUnelidedshowTransaction'showAccountNamehasRealPostings realPostingsvirtualPostingsbalancedVirtualPostingstransactionsPostingstransactionPostingBalancesisTransactionBalancedbalanceTransactionnonzerobalanceerrortransactionActualDatetransactionEffectiveDatejournalTransactionWithDate txnTieKnotsettxnQueryOptQueryOptInAcctQueryOptInAcctOnlyMatcher MatchDepth MatchEmpty MatchReal MatchStatus MatchEDate MatchDate MatchAcct MatchDescMatchAndMatchOrMatchNot MatchNoneMatchAny inAccountinAccountMatcher parseQuerywords'' parseMatcher parseStatus parseBool truestrings negateMatchermatchesPostingmatchesTransactionpostingEffectiveDatematchesAccountmatcherStartDatematcherIsStartDateOnlyearliestMaybeDatelatestMaybeDatecompareMaybeDatestests_Hledger_Data_MatchingtimeLogEntriesToTransactionsentryFromTimeLogInOut nulljournalnullctxnullfilterspecjournalFilePathjournalFilePathsmainfileaddTransactionaddModifierTransactionaddPeriodicTransactionaddHistoricalPriceaddTimeLogEntryjournalPostingsjournalAccountNamesUsedjournalAccountNamesjournalAccountNameTreefilterJournalPostings2filterJournalTransactions2filterJournalTransactionsfilterJournalPostings&filterJournalTransactionsByDescriptionfilterJournalTransactionsByDate(filterJournalTransactionsByClearedStatus$filterJournalPostingsByClearedStatusfilterJournalPostingsByRealnessfilterJournalPostingsByEmpty filterJournalTransactionsByDepthfilterJournalPostingsByDepth"filterJournalTransactionsByAccountfilterJournalPostingsByAccountjournalSelectingDatejournalApplyAliasesjournalFinalisejournalBalanceTransactionsjournalCanonicaliseAmountsjournalApplyHistoricalPricesjournalHistoricalPriceForjournalCloseTimeLogEntriesjournalConvertAmountsToCostjournalCanonicalCommoditiesjournalAmountCommodities journalAmountAndPriceCommoditiesamountCommoditiesjournalAmountsjournalDateSpan matchpatsjournalAccountInfo groupPostingscalculateBalancespostingsByAccount nullledgerjournalToLedgerjournalToLedger2ledgerAccountNames ledgerAccountledgerAccountsledgerTopAccountsledgerLeafAccountsledgerAccountsMatchingledgerSubAccountsledgerPostingsledgerAccountTreeledgerAccountTreeAtledgerDateSpan accountnamesaccountaccounts topaccountsaccountsmatching subaccountspostings commodities accounttree accounttreeat rawdatespan ledgeramounts juSequenceparseJournalWithsetYeargetYear setCommodity getCommoditypushParentAccountpopParentAccountgetParentAccountaddAccountAliasgetAccountAliasesclearAccountAliases expandPath fileSuffixtests_Hledger_DataAccountsReportItemAccountsReportTransactionsReportItemTransactionsReportPostingsReportItemPostingsReportEntriesReportItem EntriesReport FormatStr DisplayExp ReportOptsbegin_end_period_cleared_ uncleared_cost_depth_display_ effective_empty_ no_elide_real_flat_drop_ no_total_daily_weekly_monthly_ quarterly_yearly_format_ patterns_ defreportoptsdateSpanFromOptsintervalFromOptsclearedValueFromOptswhichDateFromOptsjournalSelectingDateFromOptsjournalSelectingAmountFromOptsoptsToFilterSpec entriesReportpostingsReportmkpostingsReportItemtriDate triBalancejournalTransactionsReportaccountTransactionsReportaccountsReportaccountsReport2 isInterestingtests_Hledger_Reportsreader journalFile emptyLineledgerDirectivejournalAddFileledgerDefaultYearledgerHistoricalPriceledgerdatetimeledgeraccountname someamount tests_Hledger_Read_JournalReader tests_Hledger_Read_TimelogReader journalenvvarjournaldefaultfilenamejournalFromPathAndStringreadJournalFilerequireJournalFileensureJournalFile readJournal myJournalPath myJournaltests_Hledger_ReadbomstripBOM lowercase uppercasestriplstriprstrip elideLeft elideRightsingleQuoteIfNeededwhitespacecharsisSingleQuotedisDoubleQuoted regexMatch regexMatchCI containsRegexrootsubsbranches acctsepcharaccountNameTreeFrom1nullaccountnametreeaccountNameTreeFrom2accountNameTreeFrom3 emptyTreetests_Hledger_Data_AccountNamenonsimplecommoditycharsquoteCommoditySymbolIfNeededunknowndollareuropoundhourdollarseurospoundshoursdefaultcommoditiestests_Hledger_Data_CommoditysimilarAmountsOpisNegativeAmount isZeroAmountisReallyZeroAmountshowAmountWithPrecision!showAmountWithoutPriceOrCommodity showPriceshowPriceDebugshowamountquantitypunctuatenumber#normaliseMixedAmountPreservingPriceisReallyZeroMixedAmountnullaccttests_Hledger_Data_Account orDatesFrom spanIntersectlatestearliestnextday startofdaythisweekprevweeknextweek startofweek thismonth prevmonth nextmonth startofmonth thisquarter prevquarter nextquarterstartofquarterthisyearprevyearnextyear startofyearnthdayofmonthcontainingnthdayofweekcontaining firstJust datesepchars datesepcharmonths monthabbrevsweekdaysweekdayabbrevs monthIndexmonIndextests_Hledger_Data_Datestests_Hledger_Data_Postingtests_Hledger_Data_Transactionprefixes defaultprefix matcherIsNulltests_Hledger_Data_TimeLogshowJournalDebug negateprefix isnegativepatabspattraceAmountPrecisiontracePostingsCommoditiestests_Hledger_Data_Journaltests_Hledger_Data_LedgertransactionDateFnparsePatternArgspostingsReportItemspostingsMatchingDisplayExprdisplayExprMatchesdatedisplayexprdepthClipPostingsdepthClipPostingsummarisePostingsByIntervalsummarisePostingsInDateSpanaccountTransactionsReportItemssummarisePostingssummarisePostingAccountsfilterTransactionPostingsaccountsReport'exclusiveBalanceisInterestingFlatisInterestingIndentedQuantityformatdetectparse ledgercommentledgercommentline ledgerIncludeledgerAccountBeginledgerAccountEnd ledgerAliasledgerEndAliasesledgerTagDirectiveledgerEndTagDirectiveledgerDefaultCommodityledgerIgnoredPriceCommodityledgerCommodityConversionledgerModifierTransactionledgerPeriodicTransactionledgerTransaction ledgerdateledgereffectivedate ledgerstatus ledgercodeledgermetadataledgermetadatalineledgerpostingslinebeginningwithspaces ledgerpostingmodifiedaccountname postingamountleftsymbolamountrightsymbolamountnosymbolamountcommoditysymbolquotedcommoditysymbolsimplecommoditysymbol priceamountnumber timelogFile timelogentryreadersreaderForFormatnewJournalContent