Read hledger data from various data formats, and related utilities.
- tests_Hledger_Read :: Test
- readJournalFile :: Maybe String -> FilePath -> IO (Either String Journal)
- readJournal :: Maybe String -> String -> IO (Either String Journal)
- journalFromPathAndString :: Maybe String -> FilePath -> String -> IO (Either String Journal)
- ledgeraccountname :: GenParser Char st AccountName
- myJournalPath :: IO String
- myJournal :: IO Journal
- someamount :: GenParser Char JournalContext MixedAmount
- journalenvvar :: [Char]
- journaldefaultfilename :: [Char]
- requireJournalFile :: FilePath -> IO ()
- ensureJournalFile :: FilePath -> IO ()
Read a journal from this file, using the specified data format or trying all known formats, or give an error string; also create the file if it doesn't exist.
Read a Journal from this string, using the specified data format or trying all known formats, or give an error string.
Read a Journal from this string (and file path), auto-detecting the data format, or give a useful error string. Tries to parse each known data format in turn. If none succeed, gives the error message specific to the intended data format, which if not specified is guessed from the file suffix and possibly the data.
Parse an account name. Account names may have single spaces inside them, and are terminated by two or more spaces. They should have one or more components of at least one character, separated by the account separator char.
Get the user's journal file path. Like ledger, we look first for the LEDGER_FILE environment variable, and if that does not exist, for the legacy LEDGER environment variable. If neither is set, or the value is 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.
If the specified journal file does not exist, give a helpful error and quit.