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.
- data CsvRules = CsvRules {}
- type FieldPosition = Int
- type AccountRule = ([(String, Maybe String)], AccountName)
- type CsvRecord = [String]
- convert :: [Opt] -> [String] -> Journal -> IO ()
- maxFieldIndex :: CsvRules -> Int
- rulesFileFor :: FilePath -> FilePath
- initialRulesFileContent :: String
- parseCsvRulesFile :: FilePath -> IO (Either ParseError CsvRules)
- parseCsvRules :: FilePath -> String -> Either ParseError CsvRules
- csvrulesfile :: GenParser Char CsvRules CsvRules
- definitions :: GenParser Char CsvRules ()
- accountrule :: GenParser Char CsvRules AccountRule
- printTxn :: Bool -> CsvRules -> CsvRecord -> IO ()
- transactionFromCsvRecord :: CsvRules -> CsvRecord -> Transaction
- normaliseDate :: String -> String
- identify :: [AccountRule] -> String -> String -> (String, String)
Documentation
A set of data definitions and account-matching patterns sufficient to convert a particular CSV data file into meaningful journal transactions. See above.
type FieldPosition = IntSource
type AccountRule = ([(String, Maybe String)], AccountName)Source
convert :: [Opt] -> [String] -> Journal -> IO ()Source
Read the CSV file named as an argument and print equivalent journal transactions, using/creating a .rules file.
maxFieldIndex :: CsvRules -> IntSource
The highest (0-based) field index referenced in the field definitions, or -1 if no fields are defined.
definitions :: GenParser Char CsvRules ()Source
Real independent parser choice, even when alternative matches share a prefix.
normaliseDate :: String -> StringSource
Convert some date string with unknown format to YYYYMMDD.