hledger-* API docs

Safe HaskellSafe-Infered

Hledger.Cli.Convert

Description

Convert account data in CSV format (eg downloaded from a bank) to journal format, and print it on stdout. See the manual for more details.

Synopsis

Documentation

type CsvRecord = [String]Source

convert :: CliOpts -> IO ()Source

Read the CSV file named as an argument and print equivalent journal transactions, using/creating a .rules file.

parseCsv :: FilePath -> IO (Either ParseError CSV)Source

maxFieldIndex :: CsvRules -> IntSource

The highest (0-based) field index referenced in the field definitions, or -1 if no fields are defined.

rulesFileFor :: CliOpts -> FilePath -> FilePathSource

validateRules :: CsvRules -> Maybe StringSource

parseCsvRulesFile :: FilePath -> IO (Either ParseError CsvRules)Source

parseCsvRules :: FilePath -> String -> Either ParseError CsvRulesSource

definitions :: GenParser Char CsvRules ()Source

datefield :: ParsecT [Char] CsvRules Identity ()Source

effectivedatefield :: ParsecT [Char] CsvRules Identity ()Source

dateformat :: ParsecT [Char] CsvRules Identity ()Source

codefield :: ParsecT [Char] CsvRules Identity ()Source

statusfield :: ParsecT [Char] CsvRules Identity ()Source

descriptionfield :: ParsecT [Char] CsvRules Identity ()Source

amountfield :: ParsecT [Char] CsvRules Identity ()Source

amountinfield :: ParsecT [Char] CsvRules Identity ()Source

amountoutfield :: ParsecT [Char] CsvRules Identity ()Source

currencyfield :: ParsecT [Char] CsvRules Identity ()Source

accountfield :: ParsecT [Char] CsvRules Identity ()Source

account2field :: ParsecT [Char] CsvRules Identity ()Source

basecurrency :: ParsecT [Char] CsvRules Identity ()Source

baseaccount :: ParsecT [Char] CsvRules Identity ()Source

blanklines :: ParsecT [Char] u Identity [()]Source

blankline :: ParsecT [Char] u Identity ()Source

commentchar :: ParsecT [Char] u Identity CharSource

commentline :: ParsecT [Char] u Identity ()Source

blankorcommentline :: GenParser Char st ()Source

matchreplacepattern :: ParsecT [Char] u Identity ([Char], Maybe [Char])Source

formatD :: CsvRecord -> Bool -> Maybe Int -> Maybe Int -> HledgerFormatField -> StringSource

normaliseDateSource

Arguments

:: Maybe String

User-supplied date format: this should be tried in preference to all others

-> String 
-> String 

Convert some date string with unknown format to YYYYMMDD.

identify :: [AccountRule] -> String -> String -> (String, String)Source

Apply account matching rules to a transaction description to obtain the most appropriate account and a new description.

caseinsensitive :: [Char] -> [Char]Source