hledger-0.5.1: A ledger-compatible text-based accounting tool.Source codeContentsIndex
Ledger.IO
Description
Utilities for doing I/O with ledger files.
Synopsis
type IOArgs = (DateSpan, Maybe Bool, Bool, Bool, [String], [String])
myLedgerPath :: IO String
myTimelogPath :: IO String
myLedger :: IO Ledger
myTimelog :: IO Ledger
readLedger :: FilePath -> IO Ledger
readLedgerWithIOArgs :: IOArgs -> FilePath -> IO Ledger
rawLedgerFromString :: String -> IO RawLedger
filterAndCacheLedger :: IOArgs -> String -> RawLedger -> Ledger
tildeExpand :: FilePath -> IO FilePath
Documentation
type IOArgs = (DateSpan, Maybe Bool, Bool, Bool, [String], [String])Source

A tuple of arguments specifying how to filter a raw ledger file:

  • only include transactions in this date span
  • only include if cleared/uncleared/don't care
  • only include if real/don't care
  • convert all amounts to cost basis
  • only include if matching these account patterns
  • only include if matching these description patterns
myLedgerPath :: IO StringSource
Get the user's default ledger file path.
myTimelogPath :: IO StringSource
Get the user's default timelog file path.
myLedger :: IO LedgerSource
Read the user's default ledger file, or give an error.
myTimelog :: IO LedgerSource
Read the user's default timelog file, or give an error.
readLedger :: FilePath -> IO LedgerSource
Read a ledger from this file, with no filtering, or give an error.
readLedgerWithIOArgs :: IOArgs -> FilePath -> IO LedgerSource
Read a ledger from this file, filtering according to the io args, | or give an error.
rawLedgerFromString :: String -> IO RawLedgerSource
Read a RawLedger from the given string, using the current time as reference time, or give a parse error.
filterAndCacheLedger :: IOArgs -> String -> RawLedger -> LedgerSource
Convert a RawLedger to a canonicalised, cached and filtered Ledger.
tildeExpand :: FilePath -> IO FilePathSource
Expand ~ in a file path (does not handle ~name).
Produced by Haddock version 2.6.0