penny-lib- Extensible double-entry accounting system - library

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. $).

groupSpecs :: GroupSpecs

How to group digits when printing the resulting ledger. All quantities (not just those affected by this program) will be formatted using this specification.

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 (Exceptional 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 Config Source




data GroupSpecs Source




left :: GroupSpec
right :: GroupSpec


data GroupSpec Source

Specifies how to perform digit grouping when rendering a quantity. All grouping groups into groups of 3 digits.



Do not perform any digit grouping


Group digits, but only if the number to be grouped is greater than 9,999 (if grouping the whole part) or if there are more than 4 decimal places (if grouping the fractional part).


Group digits whenever there are at least four decimal places.

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.