#***************************************************************************
#                      .acst2qif.cfg  -  description
#                         -------------------
# copyright status      : configuration file only, Public Domain
# email                 : volker.paul@v-paul.de
#
#***************************************************************************/

# Configuration file for acst2qif.py
# Location: default ~/.acst2qif.cfg; 
# specify a different location with -c/--configfile option

# Adapt this to your situation according to the comments below.

# In [General], list accounts and a default outfile.
# Prepare each account type, especially regular expressions.
# Prepare each single account, e.g. dir where balances are kept, categoryDic etc.

[General]
# List of accounts to process automatically 
# (sections in this file, may be slightly different from account name).
# Idea: Put data from several accounts into one .qif file and import only this one file.
# Unless you specify an input file list with the -i/--input option,
# input files are automatically specified as follows:
#   Loop over this accounts list
#     for each account, lookup its directory (dir entry)
#     from this directory, sort files alphabetically and take the last one
# If the alphabetical corresponds to the temporal order 
# (e.g. use ISO date format 2010-12-31 or 2010q4 for 4th quarter of 2010),
# then this always gives the latest file of that directory.
accounts: Fritz_MyBank_Giro

# Default path to .qif file to import into KMyMoney.
# You can specify a different path with the -o/--output option.
outfile: /home/fritz/data/admin/banking/account_statements.qif


# Account types =======================================================
# These are settings for all accounts of this type.
# The Value of the "type" setting in an account section refers to this.

[MyBank]
# Regexp for detecting item head, with transaction date (parts: day, month, year), detail text, amount.
# The head is often the single line of an entry.
ihead_regexp: ^ (?P<day>\d\d)\.(?P<month>\d\d)\. +\d\d\.\d\d\. +(?P<detail>.{60})  +(?P<amount>.*)$
# Regexp for detecting additional item text (2nd and following lines of a transaction), after the head line.
iadd_regexp: ^ {20} *(?P<detail>\S.*)$
# Regexp to match an amount (from head line) if it's a creadit amount (positive).
credit_regexp: ^ {20} *(?P<int>[\d\.]+),(?P<frac>\d\d).*$
# Regexp for debit amount (negative); may be the same as for credit amount.
debit_regexp: ^ *(?P<int>[\d\.]+),(?P<frac>\d\d).*$
# Mapping from transaction text to account/category name in KMyMoney.
# Realised as a Python dictionary. 
# Key: regexp to match transaction text
# Value: other account/category name
# Account names (in contrast to categories) may have to be enclosed in []
# Statements can come in different formats depending on 
# whether it's a regular monthly/quarterly statement or a 
# statement generated on demand and printed to PDF file.
# Ideally the converter understands both.
# Depending on the bank, years can be 2 or 4 digits long. Empty space length varies. 
# After the amount, a running balance can follow or not 
# (if it does, it is ignored, as it cannot be imported).
# Unfortunately, sometimes debit and credit look identical but are placed in different columns,
# so they can only be distinguished by counting spaces.
categoryDic: {
    "Abschluss":"Zinsen",
    }                     

# Accounts ================================================================

[Fritz_MyBank_Giro]
# Contains settings specific to this account.
# Values shared by all accounts of the same type (bank) go in the type section.
name: Fritz:MyBank Giro
qif_account_type: otha
# Type must be a section defined above.
type: MyBank
# Default directory for PDF account statements of this account.
dir: /home/fritz/data/admin/banking/Fritz/MyBank/statements
# Some categoryDic entries come from the individual account, some from the account type.
categoryDic: {
    ".*AB-PA ?472":"Auto:KFZ-Steuer",
    ".*DEUTSCHE TELEKOM AG":"Kommunikation:Telefon",
    "Abrechnung .* siehe Anlage":"Zinsen",
    "Lastschrift ELASTROM":"Nebenkosten:Strom",
    }
