ٗM      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL Safe-InferredEA string received from or being passed to the operating system, such H as a file path, command-line argument, or environment variable name or I value. With GHC versions before 7.2 on some platforms (posix) these are I typically encoded. When converting, we assume the encoding is UTF-8 (cf   Dhttp://www.dwheeler.com/essays/fixing-unix-linux-filenames.html#UTF8). FConvert a system string to an ordinary string, decoding from UTF-8 if A it appears to be UTF8-encoded and GHC version is less than 7.2. DConvert a unicode string to a system string, encoding with UTF-8 if % we are on a posix platform with GHC < 7.2. 'A SystemString-aware version of error. +A SystemString-aware version of userError. MN OPQR    MN OPQR None";A Ledger has the journal it derives from, and the accounts ? derived from that. Accounts are accessible both list-wise and @ tree-wise, since each one knows its parent and subs; the first 4 account is the root of the tree and always exists. 3An account, with name, balances and links to parent/ subaccounts 1 which let you walk up or down the account tree.  this account' s full name  this account'!s balance, excluding subaccounts  sub-accounts  derived from the above:  this account'!s balance, including subaccounts parent account 6used in the accounts report to label elidable parents 'FA set of data definitions and account-matching patterns sufficient to Tconvert a particular CSV data file into meaningful journal transactions. See above. 9FA hledger journal reader is a triple of format name, format-detecting % predicate, and a parser to Journal. >2The id of a data format understood by hledger, eg journal or csv. ?@A JournalUpdate is some transformation of a Journal. It can do I/O or  raise an error. G,any trailing comments from the journal file H0the context (parse state) at the end of parsing I+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 6 order encountered (XXX reversed, cf journalAddFile). J1when this journal was last read from its file(s) K 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. M0the default year most recently specified with Y N5the default commodity most recently specified with D O$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. P3the current list of account name aliases in effect qthis transaction'9s non-tag comment lines, as a single non-indented string sthis transaction' s postings z this posting'9s non-tag comment lines, as a single non-indented string } this posting'+s parent transaction (co-recursive types). 4 Tying this knot gets tedious, Maybe makes it easier/ optional. *the price for this amount at posting time  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.  the commodity' s symbol 3 display preferences for amounts of this commodity 2should the symbol appear on the left or the right 4should there be a space between symbol and quantity $number of decimal places to display 6 XXX these three might be better belonging to Journal "character to use as decimal point <character to use for separating digit groups (eg thousands) >positions of separators, counting leftward from decimal point  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ST !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~uvwxyz{|}jklmnopqrstfghibcde\a`_^]WXYZ[RSTUVQKLMNOP@ABCDEFGHIJ?>9:;<=8'()*+,-./01234567&%$#"! $$#"! %&'()*+,-./0123456789:;<=>?@ ABCDEFGHIJKLMNOPQRSTUVWXYZ[\a`_^]bcdefghij klmnopqrstuvwxyz{|}~STNone UVWXYZ[\ !"#$$#"!  UVWXYZ[\None&?An efficient-to-build tree suggested by Cale Gibbard, probably " better than accountNameTreeFrom. $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 DSingle-quote this string if it contains whitespace or double-quotes 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. #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 ? UConvert a possibly relative, possibly tilde-containing file path to an absolute one, @ given the current directory. ~username is not supported. Leave - unchanged. U[ [ TNone  a:b:c,d:e -> [a,a:b,a:b:c,d,d:e]  a:b:c -> [a,a:b,a:b:c]  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. UConvert an account name to a regular expression matching it but not 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 ?                     None&ELook 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.  !"#$%&'() !"#$%&'() !"#$%&'() !"#$%&'()None$*The empty simple amount. ]@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. ^0Is this amount negative ? The price is ignored. _MDoes 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. aBGet 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. 08Get the string representation of an amount, without any @ price. bSGet the string representation of an amount, without any price or commodity symbol. 1BGet the string representation of an amount, based on its commodity's A display settings. String representations equivalent to zero are  converted to just "0". cBGet the string representation of the number part of of an amount, 0 using the display settings from its commodity. dReplace a number string'.s decimal point with the specified character, / and add the specified digit group separators. 2PFor rendering: a special precision value which means show all available digits. 3RFor rendering: a special precision value which forces display of a decimal point. 4Replace an amount'0s commodity with the canonicalised version from  the provided commodity map. 5The empty mixed amount. 6IA temporary value for parsed transactions which had no amount specified. eSimplify a mixed amount'.s component amounts: combine amounts with the G same commodity and price. Also remove any zero or missing amounts and 9 replace an empty amount list with a single zero amount. 8Simplify a mixed amount'*s component amounts: combine amounts with + the same commodity, using the first amount's price for subsequent D amounts in each commodity (ie, this function alters the amount and D is best used as a rendering helper.). Also remove any zero amounts = and replace an empty amount list with a single zero amount. 9Get 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 ? fIs 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 "". A'Set the display precision in the amount's commodities. BEGet the string representation of a mixed amount, showing each of its @ component amounts with the specified precision, ignoring their  commoditys' display precision settings. CJGet an unambiguous string representation of a mixed amount for debugging. D=Get the string representation of a mixed amount, but without  any @ prices. EReplace a mixed amount'0s commodity with the canonicalised version from  the provided commodity map. 0*]+,-^_`a./0bgh1cdi234567ej8k9:;<=f>?@ABCDEFlmno*+,-./0123456789:;<=>?@ABCDEF*6+4.,-1/0235798E?A:;<=>@CDBF0*]+,-^_`a./0bgh1cdi234567ej8k9:;<=f>?@ABCDEFlmnoNoneHGet the current local date. I$Get the current local month number. JGet the current local year. LOSplit a DateSpan into one or more consecutive spans at the specified interval. MECount the days in a DateSpan, or if it is open-ended return Nothing. N'Does the span include the given date ? OBCombine two datespans, filling any unspecified dates in the first  with dates from the second. P5Calculate the intersection of a number of datespans. Q-Calculate the intersection of two datespans. R.Calculate the union of a number of datespans. S&Calculate the union of two datespans. TDParse a period expression to an Interval and overall DateSpan using 7 the provided reference date, or return a parse error. pEShow a DateSpan as a human-readable pseudo-period-expression string. & dateSpanAsText :: DateSpan -> String / dateSpanAsText (DateSpan Nothing Nothing) = all 6 dateSpanAsText (DateSpan Nothing (Just e)) = printf to %s (show e) 6 dateSpanAsText (DateSpan (Just b) Nothing) = printf from %s (show b) 6 dateSpanAsText (DateSpan (Just b) (Just e)) = printf %s to %s (show b) (show e) EConvert a single smart date string to a date span using the provided $ reference date, or raise an error. 6 spanFromSmartDateString :: Day -> String -> DateSpan E spanFromSmartDateString refdate s = spanFromSmartDate refdate sdate  where 5 sdate = fromparse $ parsewith smartdateonly s V/Convert a smart date string to an explicit yyyy/mm/dd string using 1 the provided reference date, or raise an error. W#A safe version of fixSmartDateStr. YKConvert a SmartDate to an absolute date using the provided reference date. q6Parse a couple of date string formats to a time type. [7Parse a date string to a time type, or raise an error. rBParse 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. sPLike smartdate, but there must be nothing other than whitespace after the date. `CMake a datespan from two valid date strings parseable by parsedate % (or raise an error). Eg: mkdatespan "201111" "20111231". WGHIJKLtMNOPQRSuvTUpVWXYZwxyz{|}~q[r\s]^_`abcGHIJKLMNOPQRSTUVWXYZ[\]^_`abcHIJbN[GKZTac_^]QPSRO\LYVWXMU`WGHIJKLtMNOPQRSuvTUpVWXYZwxyz{|}~q[r\s]^_`abc NoneqAIs 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. rKTags for this posting including any inherited from its parent transaction. sXTags for this transaction including any inherited from above, when that is implemented. t4Does this posting fall within the given date span ? vBGet the minimal date span which contains all the postings, or the # null date span if there are none. z<Prefix one account name to another, preserving posting type % indicators like concatAccountNames. {7Join 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. |VRewrite an account name using the first applicable alias from the given list, if any. defghijklmnopqrstuvwxyz{|}defghijklmnopqrstuvwxyz{|}dqjklumrsptvnwxyz{|oeifgh}defghijklmnopqrstuvwxyz{|} None =Derive an account tree with balances from a set of postings.  (*ledger':s core feature.) The accounts are returned in a list, but E retain their tree structure; the first one is the root of the tree. /Convert an AccountName tree to an Account tree Tie the knot so all subaccounts' parents are set correctly. Get this account'4s parent accounts, from the nearest up to the root. 5List the accounts at each level of the account tree. JMap a (non-tree-structure-modifying) function over this and sub accounts. BIs the predicate true on any of this account or its subaccounts ? 6Add subaccount-inclusive balances to an account tree.  -- , also noting F -- whether it has an interesting balance or interesting subs to help  -- with eliding later. .Remove all subaccounts below a certain depth. <Remove all leaf accounts and subtrees matching a predicate. 8Flatten an account tree into a list, which is sometimes 6 convenient. Note since accounts link to their parents/ subs, the 6 account tree remains intact and can still be used. It's a tree/list! $Filter an account tree (to a list).  Search an account list by name. ~~~~ NoneGShow 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 =Show an account name, clipped to the given width if any, and  appropriately bracketed/*parenthesised for the given posting type. 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 9 amount or conversion price, or return an error message. DBalancing is affected by commodity display precisions, so those may  be provided. @We can infer a missing real amount when there are multiple real > postings and exactly one of them is amountless (likewise for D balanced virtual postings). Inferred amounts are converted to cost  basis when possible. DWe can infer a conversion price when all real amounts are specified  and the sum of real postings' amounts is exactly two B non-explicitly-priced amounts in different commodities (likewise ! for balanced virtual postings). EOnce we no longer need both, set the main transaction date to either , the actual or effective date. A bit hacky. Ensure a transaction's postings refer back to it.  Set a posting's parent transaction.  NoneCConvert 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.  None'A query option changes a query 's/report'$s behaviour and output in some way. :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 2show an account register focussed on this account BA query is a composition of search criteria, which can be used to 2 match postings, transactions, accounts and more. 4match if a tag with this exact name, and with value ) matching the regexp if provided, exists ;match if account depth is less than or equal to this value "if true, show zero-amount postings/%accounts which are usually not shown 2 more of a query option than a query criteria ?  match if realness8 (involves a real non-virtual account ?) has this value 'match if cleared status has this value *match if effective date in this date span 'match if actual date in this date span 1match postings whose account matches this regexp )match if description matches this regexp match if all of these match match if any of these match negate this match  never match  always match CConvert a query expression containing zero or more space-separated J terms to a query and zero or more query options. A query term is either:  < a search pattern, which matches on one or more fields, eg: Cacct:REGEXP - match the account name with a regular expression : desc:REGEXP - match the transaction description @ date:PERIODEXP - match the date with a period expression BThe prefix indicates the field to match, or if there is no prefix  account name is assumed.  @ a query option, which modifies the reporting behaviour in some F way. There is currently one of these, which may appear only once: inacct:FULLACCTNAME CThe usual shell quoting rules are assumed. When a pattern contains H whitespace, it (or the whole term including prefix) should be enclosed  in single or double quotes. FPeriod expressions may contain relative dates, so a reference date is  required to fully parse these. (Multiple terms are combined as follows: $ 1. multiple account patterns are OR' d together ( 2. multiple description patterns are OR' d together  3. then all terms are AND' d together -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. ?Parse a single query term as either a query or a query option. "Parse the boolean value part of a status: query, allowing * as @ another way to spell True, similar to the journal file format. "Parse the boolean value part of a status: query. A true value can  be spelled as 1, t or true. ERemove query terms (or whole sub-expressions) not matching the given : predicate from this query. XXX Semantics not yet clear. #Does this query match everything ? BDoes this query 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. FWhat start date (or effective date) does this query specify, if any ? D For OR expressions, use the earliest of the dates. NOT is ignored. BWhat date span (or effective date span) does this query specify ? C For OR expressions, use the widest possible span. NOT is ignored. DExtract all date (or effective date) spans specified in this query.  NOT is ignored. 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. AThe depth limit this query specifies, or a large number if none. MThe empty (zero amount) status specified by this query, defaulting to false. XThe account we are currently focussed on, if any, and whether subaccounts are included. ' Just looks at the first query option. AA query for the account(s) we are currently focussed on, if any. ' Just looks at the first query option. /Does the match expression match this account ? 3 A matching in: clause is also considered a match. /Does the match expression match this posting ? 3Does the match expression match this transaction ? A##1None(All account names used in this journal. A query for Profit & Loss accounts in this journal.  Cf  Ghttp://en.wikipedia.org/wiki/Chart_of_accounts#Profit_.26_Loss_accounts. 7A query for Income (Revenue) accounts in this journal. < This is currently hard-coded to the case-insensitive regex ^(income|revenue)s?(:|$). .A query for Expense accounts in this journal. < This is currently hard-coded to the case-insensitive regex ^expenses?(:|$). A query for Asset, Liability &" Equity accounts in this journal.  Cf  Ehttp://en.wikipedia.org/wiki/Chart_of_accounts#Balance_Sheet_Accounts. ,A query for Asset accounts in this journal. < This is currently hard-coded to the case-insensitive regex  ^assets?(:|$). 0A query for Liability accounts in this journal. < This is currently hard-coded to the case-insensitive regex ^liabilit(y|ies)(:|$). -A query for Equity accounts in this journal. < This is currently hard-coded to the case-insensitive regex  ^equity(:|$). =A query for Cash (-equivalent) accounts in this journal (ie, F accounts which appear on the cashflow statement.) This is currently I hard-coded to be all the Asset accounts except for those containing the  case-insensitive regex  (receivable|A/R). 2Keep only postings matching the query expression. ) This can leave unbalanced transactions. 6Keep only transactions matching the query expression. 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. FDo post-parse processing on a journal to make it ready for use: check G all transactions balance, canonicalise amount formats, close any open  timelog entries and so on. 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 posting amounts (not price amounts) to > their canonical display settings. Ie, all amounts in a given C commodity will use (a) the display settings of the first, and (b) C the greatest precision, of the posting amounts in that commodity. 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. ,##,None Filter a journal'3s transactions with the given query, then derive a D ledger containing the chart of accounts and balances. If the query 4 includes a depth limit, that will affect the ledger's journal but not  the account tree.  List a ledger's account names. %Get the named account from a ledger. Get this ledger'!s root account, which is a dummy root account D above all others. This should always be first in the account list, - if somehow not this returns a null account.  List a ledger'?s top-level accounts (the ones below the root), in tree order.  List a ledger':s bottom-level (subaccount-less) accounts, in tree order. BAccounts in ledger whose name matches the pattern, in tree order.  List a ledger'!s postings, in the order parsed. 9The (fully specified) date span containing all the ledger's (filtered) transactions, 0 or DateSpan Nothing Nothing if there are none. ?All commodities used in this ledger, as a map keyed by symbol.   Nonen !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None1Does 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. Flatten a list of JournalUpdate' s into a single equivalent one. 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. 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. +Parse a (possibly unbalanced) 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. ?Parse an account name, then apply any parent account prefix and/(or account aliases currently in effect. 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. @Parse whitespace then an amount, with an optional left or right ; currency symbol and optional price, or return the special  missing marker amount. DParse an amount, with an optional left or right currency symbol and  optional price. ARun the amount parser on a string to get the result or an error. 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). H       H     None6Does 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. " #!" #!None$2Does the given file path and data look like CSV ? %Parse and post-process a Journal" from CSV data, or give an error. ? XXX currently ignores the string and reads from the file path &ERead a Journal from the given CSV data (and filename, used for error 4 messages), or return an error. Proceed as follows:    1. parse the CSV data H 2. identify the name of a file specifying conversion rules: either use G the name provided, derive it from the CSV filename, or raise an error  if the CSV filename is -. = 3. auto-create the rules file with default rules if it doesn't exist  4. parse the rules file 9 5. convert the CSV records to a journal using the rules   'FEnsure there is a conversion rules file at the given path, creating a 8 default one if needed and returning True in this case. (:The highest (0-based) field index referenced in the field . definitions, or -1 if no fields are defined. )4Convert some date string with unknown format to YYYYMMDD. *DApply account matching rules to a transaction description to obtain 5 the most appropriate account and a new description. / +$% &',( - ./0123456789:;<=>?@ABCDEFGH )LUser-supplied date format: this should be tried in preference to all others *IJK          / +$% &',( - ./0123456789:;<=>?@ABCDEFGH )*IJKNone "All the data formats we can read.  formats = map rFormat readers @Get the default journal file path specified by the environment. < Like ledger, we look first for the LEDGER_FILE environment = variable, and if that does not exist, for the legacy LEDGER A environment variable. If neither is set, or the value is blank, ) return the hard-coded default, which is .hledger.journal in the  users'<s home directory (or in the current directory, if we cannot  determine a home directory). ORead the default journal file specified by the environment, or raise an error. ZRead a journal from the given string, trying all known formats, or simply throw an error. KRead a journal from this string, trying whatever readers seem appropriate: 0 if a format is specified, try that reader only H or if one or more readers recognises the file path and data, try those  otherwise, try them all. MA CSV conversion rules file may also be specified for use by the CSV reader. L\Which readers are worth trying for this (possibly unspecified) format, filepath, and data ? MCFind the (first) reader which can handle the given format, if any. NSFind the readers which think they can handle the given file path and data, if any. FRead a Journal from this file (or stdin if the filename is -) or give G an error message, using the specified data format or trying all known B formats. A CSV conversion rules file may be specified for better  conversion of that format. 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. O6Give the content for a new auto-created journal file. PQRSTLMNO  PQRSTLMNONone>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. ">Standard options for customising report filtering and output,  corresponding to hledger'*s command-line options and query language + arguments. Used in hledger-lib and above. ;;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. U9Select 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. A1Convert report options and arguments to a query. B7Convert report options and arguments to query options. C+Select transactions for an entries report. DCSelect postings from the journal and add running balance and other : information to make a postings report. Used by eg hledger's register command. V%Generate postings report line items. E@Generate one postings report line item, given a flag indicating C whether to include transaction info, the posting, and the current  running balance. WKDate-sort and split a list of postings into three spans - postings matched L by the given display expression, and the preceding and following postings. XBDoes this display expression allow this posting to be displayed ? . Raises an error if the display expression can' t be parsed. YEParse a hledger display expression, which is a simple date test like  d>[DATE] or  d<=[DATE], and return a Posting-matching predicate. ZCConvert 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. HFSelect transactions from the whole journal for a transactions report,  with no "current"' account. The end result is similar to  postingsReport5 except it uses queries and transaction-based report B items and the items are most recent first. Used by eg hledger-web's  journal view. I'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, I using the provided query and current account queries, 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. JCSelect accounts, and get their balances at the end of the selected @ period, and misc. display information, for an accounts report. _>In an account tree with zero-balance leaves removed, mark the D elidable parent accounts (those with one subaccount and no balance  of their own). K !"#$%&'()*+,-./0123456789:;<=>U?@A`BaCbDcdVEWXYZe[FGHI\]^fJ_ghijKk4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK4"#$%&'()*+,-./0123456789! :;<=>?@ABCDEFGHIJK4 !"#$%&'()*+,-./0123456789:;<=>U?@A`BaCbDcdVEWXYZe[FGHI\]^fJ_ghijKkNoneL,  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLLLl !"#$%&'(()*++,-./0123456789:;<=>>?@ABCDEFGHIJKLMNOOPQRSTUUVWXYZ[\]^_`abcdeffghijjklmnopqrsttuvwwxyzz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn o p q r s t u v w x y z { | } ~                                                                                          !"#$%&'())*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkhledger-lib-0.19 Hledger.UtilsHledger.Utils.UTF8IOCompatHledger.Data.TypesHledger.Data.FormatStringsHledger.Data.AccountNameHledger.Data.CommodityHledger.Data.AmountHledger.Data.DatesHledger.Data.PostingHledger.Data.AccountHledger.Data.TransactionHledger.Data.TimeLog Hledger.QueryHledger.Data.JournalHledger.Data.Ledger Hledger.DataHledger.Read.JournalReaderHledger.Read.TimelogReaderHledger.Read.CsvReader Hledger.ReadHledger.ReportsHledgerbase Debug.Tracetrace SystemStringreadFile writeFile appendFile getContents hGetContentsputStrputStrLnhPutStr hPutStrLnfromSystemStringtoSystemStringerror' userError'Ledgerljournal laccountsAccountaname aebalanceasubs aibalanceaparentaboring FormatString FormatField FormatLiteralHledgerFormatFieldFieldNoDepthSpacerField TotalFieldDescriptionFieldDefaultDateField AccountField AccountRule FieldPositionCsvRules dateField dateFormat statusField codeFielddescriptionField amountField amountInFieldamountOutField currencyField baseCurrency accountField account2FieldeffectiveDateField baseAccount accountRules ParseRulesReaderrFormat rDetectorrParserFormat JournalUpdateJournal jmodifiertxns jperiodictxnsjtxnsopen_timelog_entrieshistorical_pricesfinal_comment_linesjContextfiles filereadtimeJournalContextCtxctxYear ctxCommodity ctxAccount ctxAliasesYearHistoricalPricehdatehsymbolhamount TimeLogEntrytlcode tldatetime tlcomment TimeLogCodeFinalOutOutInSetRequiredHours SetBalancePeriodicTransactionptperiodicexpr ptpostingsModifierTransaction mtvalueexpr mtpostings Transactiontdateteffectivedatetstatustcode tdescriptiontcommentttags tpostingstpreceding_comment_linesPostingpstatuspaccountpamountpcommentptypeptags ptransactionTag PostingTypeBalancedVirtualPostingVirtualPostingRegularPosting MixedAmountMixedAmount commodityquantitypricePrice TotalPrice UnitPriceQuantity Commoditysymbolsidespaced precision decimalpoint separatorseparatorpositionsSideRL AccountNameInterval DayOfWeek DayOfMonthYearsQuartersMonthsWeeksDays NoIntervalDateSpan WhichDate EffectiveDate ActualDate SmartDate formatValueparseFormatString formatStringstestsFastTreeT lowercase uppercasestriplstriprstrip elideLeft elideRight underline quoteIfSpacedescapeSingleQuotes escapeQuoteswords'unwords'singleQuoteIfNeededwhitespacechars stripquotesisSingleQuotedisDoubleQuoted unbracketconcatTopPaddedconcatBottomPaddedvConcatRightAlignedpadtop padbottompadleftpadright cliptopleftfitto difforzero regexMatch regexMatchCI regexMatchesregexMatchesCI containsRegex regexReplaceregexReplaceCIregexReplaceByregexToCaseInsensitivesplitAtElementrootsubsbranchesleaves subtreeatsubtreeinforest treeprunetreemap treefiltertreeanyshowtree showforest emptyTree mergeTrees treeFromPath treeFromPathsstraceltracemtrace tracewithchoice' parsewith parseWithCtx fromparse parseerrorshowParseErrorshowDateParseErrornonspacespacenonewline restoflinegetCurrentLocalTimetestName flattenTests filterTestsis assertParseassertParseFailureassertParseEqualprintParseErrorisLeftisRightapplyN expandPath firstJust acctsepcharaccountNameComponentsaccountNameFromComponentsaccountLeafNameaccountNameLevelaccountNameDropexpandAccountNamesexpandAccountNametopAccountNamesparentAccountNameparentAccountNamesisAccountNamePrefixOfisSubAccountNameOfsubAccountNamesFromaccountNameTreeFromnullaccountnametreeelideAccountNameclipAccountNameaccountNameToAccountRegexaccountNameToAccountOnlyRegexaccountRegexToAccountNameisAccountRegextests_Hledger_Data_AccountNamenonsimplecommoditycharsquoteCommoditySymbolIfNeededunknowndollareuropoundhourdollarseurospoundshoursdefaultcommoditiescommconversionRatecanonicaliseCommoditiestests_Hledger_Data_CommoditynullamtamountWithCommodity costOfAmount divideAmountsetAmountPrecisionshowAmountDebugshowAmountWithoutPrice showAmount maxprecisionmaxprecisionwithpointcanonicaliseAmountCommodity nullmixedamt missingamtmissingmixedamt(normaliseMixedAmountPreservingFirstPriceamountscostOfMixedAmountdivideMixedAmountisNegativeMixedAmountisZeroMixedAmountisReallyZeroMixedAmountCostmixedAmountWithCommodityshowMixedAmountsetMixedAmountPrecisionshowMixedAmountWithPrecisionshowMixedAmountDebugshowMixedAmountWithoutPrice canonicaliseMixedAmountCommoditytests_Hledger_Data_AmountshowDate getCurrentDaygetCurrentMonthgetCurrentYearelapsedSeconds splitSpan daysInSpanspanContainsDate orDatesFromspansIntersect spanIntersect spansUnion spanUnionparsePeriodExpr maybePeriodfixSmartDateStrfixSmartDateStrEitherfixSmartDateStrEither' fixSmartDateprevday parsedate smartdate datesepchars datesepcharfailIfInvalidYear mkdatespan nulldatespannulldatetests_Hledger_Data_Dates nullposting showPostingpostingTagsAsLines tagsAsLines showCommentshowPostingForRegisterisReal isVirtualisBalancedVirtual hasAmountaccountNamesFromPostings sumPostings postingDatepostingClearedpostingAllTagstransactionAllTagsisPostingInDateSpanisEmptyPostingpostingsDateSpanaccountNamePostingTypeaccountNameWithoutPostingTypeaccountNameWithPostingTypejoinAccountNamesconcatAccountNamesaccountNameApplyAliasestests_Hledger_Data_PostingnullacctaccountsFromPostingsnameTreeToAccounttieAccountParentsparentAccountsaccountsLevels mapAccounts anyAccounts sumAccounts clipAccounts pruneAccountsflattenAccountsfilterAccounts lookupAccount printAccounts showAccountsshowAccountsBoringFlagshowAccountDebugtests_Hledger_Data_AccountnulltransactionshowTransactionshowTransactionUnelidedshowAccountNamehasRealPostings realPostingsvirtualPostingsbalancedVirtualPostingstransactionsPostingstransactionPostingBalancesisTransactionBalancedbalanceTransactiontransactionActualDatetransactionEffectiveDatejournalTransactionWithDate txnTieKnottests_Hledger_Data_TransactiontimeLogEntriesToTransactionsentryFromTimeLogInOuttests_Hledger_Data_TimeLogQueryOptQueryOptInAcctQueryOptInAcctOnlyQueryDepthEmptyRealStatusEDateDateAcctDescAndOrNotNoneAny parseQuery simplifyQuery filterQuery queryIsNull queryIsDepth queryIsDatequeryIsStartDateOnlyqueryStartDate queryDateSpan queryDepth queryEmpty inAccountinAccountQuerymatchesAccountmatchesPostingmatchesTransactiontests_Hledger_Query nulljournalnullctxjournalFilePathjournalFilePathsaddTransactionaddModifierTransactionaddPeriodicTransactionaddHistoricalPriceaddTimeLogEntryjournalPostingsjournalAccountNamesUsedjournalAccountNames journalProfitAndLossAccountQueryjournalIncomeAccountQueryjournalExpenseAccountQueryjournalBalanceSheetAccountQueryjournalAssetAccountQueryjournalLiabilityAccountQueryjournalEquityAccountQueryjournalCashAccountQueryfilterJournalPostingsfilterJournalTransactionsjournalSelectingDatejournalApplyAliasesjournalFinalisejournalBalanceTransactionsjournalCanonicaliseAmountsjournalConvertAmountsToCostjournalCanonicalCommodities journalAmountAndPriceCommoditiesjournalAmountsjournalDateSpan matchpats samplejournaltests_Hledger_Data_Journal nullledgerledgerFromJournalledgerAccountNames ledgerAccountledgerRootAccountledgerTopAccountsledgerLeafAccountsledgerAccountsMatchingledgerPostingsledgerDateSpanledgerCommoditiestests_ledgerFromJournaltests_Hledger_Data_Ledgertests_Hledger_DatareaderparseJournalWithgetParentAccountjournal directivedefaultyeardirectivehistoricalpricedirectivedatetime accountnameamountamount' emptyline tests_Hledger_Read_JournalReader tests_Hledger_Read_TimelogReader CsvRecord nullrules rulesFileForparseCsvRulesFiletransactionFromCsvRecordtests_Hledger_Read_CsvReaderdefaultJournalPathdefaultJournal readJournal' readJournalreadJournalFilerequireJournalFileExistsensureJournalFileExiststests_Hledger_ReadAccountsReportItemAccountsReportTransactionsReportItemTransactionsReportPostingsReportItemPostingsReportEntriesReportItem 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_query_ defreportoptsdateSpanFromOptsintervalFromOptsclearedValueFromOptswhichDateFromOptsjournalSelectingDateFromOptsjournalSelectingAmountFromOpts queryFromOptsqueryOptsFromOpts entriesReportpostingsReportmkpostingsReportItemtriDate triBalancejournalTransactionsReportaccountTransactionsReportaccountsReporttests_Hledger_Reports tests_HledgerbomstripBOM bs_putStr bs_putStrLn bs_hPutStr bs_hPutStrLn $fShowReader $fEqPostingfield formatField formatLiteral formatString testFormat testParserformattingTests parserTestssimilarAmountsOpisNegativeAmount isZeroAmountisReallyZeroAmountshowAmountWithPrecision!showAmountWithoutPriceOrCommodityshowamountquantitypunctuatenumber$normaliseMixedAmountPreservingPricesisReallyZeroMixedAmount showPriceshowPriceDebug chopdotzero*tests_normaliseMixedAmountPreservingPricessumAmountsUsingFirstPrice$fNumMixedAmount$fShowMixedAmount $fNumAmount $fShowAmountspanFromSmartDate parsedateM parsetimewith smartdateonly splitspanlatestearliestnextday startofdaythisweekprevweeknextweek startofweek thismonth prevmonth nextmonth startofmonth thisquarter prevquarter nextquarterstartofquarterthisyearprevyearnextyear startofyearnthdayofmonthcontainingnthdayofweekcontaining validYear validMonthvalidDayfailIfInvalidMonthfailIfInvalidDayyyyymmddymdymydmdmonths monthabbrevs monthIndexmonIndexmonthmontoday yesterdaytomorrowlastthisnextthing periodexprintervalanddateperiodexprintervalperiodexprdateperiodexprreportingintervalperiodexprdatespandoubledatespan fromdatespan todatespan justdatespan $fShowPosting $fEqAccount $fShowAccountsettxntests_showTransactionUnelidedshowTransaction' commentLinespostingsAsLinespostingAsLinestests_postingAsLinesindentnonzerobalanceerror$fShowPeriodicTransaction$fShowModifierTransaction$fShowTransaction$fReadTimeLogCode$fShowTimeLogCode$fShowTimeLogEntrywords''parseQueryTerm parseStatus parseBoolqueryDateSpansearliestMaybeDatelatestMaybeDatecompareMaybeDatestests_parseQuery tests_words''prefixes defaultprefixtests_parseQueryTermparseTag truestringstests_simplifyQuerysame filterQuery'tests_filterQuery queryIsDesc queryIsAcctqueryTermDateSpantests_matchesAccounttests_matchesPostingtests_matchesTransactionlookupTagByNamelookupTagByNameAndValue matchTagName matchTagValuepostingEffectiveDatejournalCloseTimeLogEntriesjournalAmountCommoditiesamountCommoditiesmainfilejournalAccountNameTree negateprefix isnegativepatabspat $fShowJournal $fShowLedgerdetectparsecombineJournalUpdates transactiondatemodifiedaccountnamespaceandamountormissingnumberformatsetYeargetYear setCommodity getCommoditypushParentAccountpopParentAccountaddAccountAliasgetAccountAliasesclearAccountAliasesincludedirectivejournalAddFileaccountdirective enddirectivealiasdirectiveendaliasesdirective tagdirectiveendtagdirectivedefaultcommoditydirectiveignoredpricecommoditydirectivecommodityconversiondirectivemodifiertransactionperiodictransactiontests_transaction effectivedatestatuscodepostingsposting tests_postingtests_spaceandamountormissing tests_amountleftsymbolamountrightsymbolamountnosymbolamountcommoditysymbolquotedcommoditysymbolsimplecommoditysymbol priceamount tests_numbercomment commentline inlinecommenttests_inlinecomment commentlinestests_commentlinestagline tagcommenttests_tagcomment entry1_strentry1 timelogentry timelogFilereadJournalFromCsvensureRulesFileExists maxFieldIndex normaliseDateidentifyparseCsvnewRulesFileContent parseCsvRules csvrulesfile definitions datefieldeffectivedatefield dateformat codefield statusfielddescriptionFieldValuedescriptionfield amountfield amountinfieldamountoutfield currencyfield accountfield account2field basecurrency baseaccount accountrule blankline commentcharblankorcommentlinematchreplacepattern validateRulesformatDformatDescription getAmounttest_description_parsing test_parser readersForreaderForFormatreadersForPathAndDatanewJournalContent journalEnvVarjournalEnvVar2journalDefaultFilenamereaderstests_readJournal'transactionDateFnpostingsReportItemspostingsMatchingDisplayExprdisplayExprMatchesdatedisplayexprsummarisePostingsByIntervalsummarisePostingsInDateSpanaccountTransactionsReportItemssummarisePostingssummarisePostingAccountsmarkBoringParentAccountstests_queryFromOptstests_queryOptsFromOptstests_entriesReport totallabel balancelabel!tests_summarisePostingsByIntervalfilterTransactionPostingsaccountsReportItemtests_postingsReporttests_accountsReportsamplejournal2$fDefaultReportOpts