penny- Extensible double-entry accounting system

Safe HaskellNone



Brenner - Penny financial institution interfaces

Brenner provides a uniform way to interact with downloaded data from financial Given a parser, Brenner will import the transactions and store them in a database. From there it is easy to merge the transactions (without duplicates) into a ledger file, and then to clear transactions from statements in an automated fashion.



data FitAcct Source

Information to configure a single financial institution account.




fitAcctName :: String

Name for this financial institution account, e.g. House Checking or Megabank.

fitAcctDesc :: String

Additional information about this financial institution account. Here I put information on where to find the statments for download on the website.

dbLocation :: String

Path and filename to where the database is kept. You can use an absolute or relative path (if it is relative, it will be resolved relative to the current directory at runtime.)

pennyAcct :: String

The account that you use in your Penny file to hold transactions for this card. Separate each sub-account with colons (as you do in the Penny file.)

defaultAcct :: String

When new transactions are created, one of the postings will be in the amexAcct given above. The other posting will be in this account.

currency :: String

The commodity for the currency of your card (e.g. $).

qtySpec :: S3 Radix PeriodGrp CommaGrp

How to group digits when printing the resulting ledger.

Penny remembers the formatting of quantities entered in your ledger. However, quantities imported from your bank statement do not have formatting to remember, so you have to tell Penny how to format them.

translator :: Translator

See the documentation under the Translator type for details.

side :: Side

When creating new transactions, the commodity will be on this side

spaceBetween :: SpaceBetween

When creating new transactions, is there a space between the commodity and the quantity

parser :: (ParserDesc, FitFileLocation -> IO (Either String [Posting]))

Parses a file of transactions from the financial institution. The function must open the file and parse it. This is in the IO monad not only because the function must open the file itself, but also so the function can perform arbitrary IO (run pdftotext, maybe?) If there is failure, the function can return an Exceptional String, which is the error message. Alternatively the function can raise an exception in the IO monad (currently Brenner makes no attempt to catch these) so if any of the IO functions throw you can simply not handle the exceptions.

The first element of the pair is a help string which should indicate how to download the data, as a helpful reminder.

toLincolnPayee :: Desc -> Payee -> Payee

Sometimes the financial institution provides Payee information, sometimes it does not. Sometimes the Desc might have additional information that you might want to remove. This function can be used to do that. The resulting Lincoln Payee is used for any transactions that are created by the merge command. The resulting payee is also used when comparing new financial institution postings to already existing ledger transactions in order to guess at which payee and accounts to create in the transactions created by the merge command.

data S3 a b c Source


S3a a 
S3b b 
S3c c 


(Eq a, Eq b, Eq c) => Eq (S3 a b c) 
(Ord a, Ord b, Ord c) => Ord (S3 a b c) 
(Show a, Show b, Show c) => Show (S3 a b c) 

data Radix Source



data PeriodGrp Source

The digit grouping character when the radix is a period.



ASCII space


Unicode code point 0x2009



data CommaGrp Source

The digit grouping character when the radix is a comma.



ASCII space


Unicode code point 0x2009



data Translator Source

What the financial institution shows as an increase or decrease has to be recorded as a debit or credit in the PennyAcct.



That is, when the financial institution shows a posting that increases your account balance, you record a debit. You will probably use this for deposit accounts, like checking and savings. These are asset accounts so if the balance goes up you record a debit in your ledger.


That is, when the financial institution shows a posting that increases your account balance, you record a credit. You will probably use this for liabilities, such as credit cards and other loans.

data Side Source

The commodity and and the quantity may appear with the commodity on the left (e.g. USD 2.14) or with the commodity on the right (e.g. 2.14 USD).

data SpaceBetween Source

There may or may not be a space in between the commodity and the quantity.

usePayeeOrDesc :: Desc -> Payee -> PayeeSource

A simple function to use for toLincolnPayee. Uses the financial institution payee if it is available; otherwise, uses the financial institution description.



:: Version

Binary version

-> Config 
-> IO () 

Brenner, with a pre-compiled configuration.

ofxParser :: (ParserDesc, ParserFn)Source

Parser for OFX data.

ofxPrepassParser :: (String -> String) -> (ParserDesc, ParserFn)Source

Parser for OFX data, with a prepass phase. Any incoming data is first filtered through the given function. This allows you to correct broken OFX statements. For example, Bank of America issues OFX files that do not properly escape ampersands. Using this function you can change every ampersand to something properly escaped (or just change it to the word "and".)