Skip to content
No description, website, or topics provided.
Python
Branch: master
Clone or download

Latest commit

giacomos Merge pull request #8 from sorrowless/fix_transactions
Fix Account.get_transactions to give right values to user
Latest commit ad2dd68 Mar 1, 2016

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
qifparse
.gitignore Add .gitignore Nov 1, 2013
.travis.yml Remove support for Python 2.5 Feb 22, 2015
CHANGELOG.rst advance version and fix a typo Nov 3, 2013
MANIFEST.in
README.rst some 'minor' improvements Nov 3, 2013
setup.py Remove support for Python 2.5 Feb 22, 2015

README.rst

QIF Parser

https://travis-ci.org/giacomos/qifparse.png?branch=master

qifparse is a parser for Quicken interchange format files (.qif).

Even if the qif format is:

  • quite old now
  • not supported for import by Quicken any more,
  • ambiguous in some data management (notably on dates)

it's still quite commonly used by many personal finance managers.

Usage

Here's a sample parsing:

>>> from qifparse.parser import QifParser
>>> qif = QifParser.parse(file('file.qif'))
>>> qif.get_accounts()
(<qifparse.qif.Account object at 0x16148d0>, <qifparse.qif.Account object at 0x1614850>)
>>> qif.accounts[0].name
'My Cash'
>>> qif.get_categories()
(<qifparse.qif.Category object at 0x15b3d10>, <qifparse.qif.Category object at 0x15b3450>)
>>> qif.accounts[0].get_transactions()
(<Transaction units=-6.5>, <Transaction units=-6.0>)
>>> str(qif)
'!Type:Cat\nNfood\nE\n^\nNfood:lunch\nE\n^\n!Account\nNMy Cash\nTCash\n^\n!Type:Cash...
...

Here's a sample of a structure creation:

>>> qif_obj = qif.Qif()
>>> acc = qif.Account(name='My Cc', account_type='Bank')
>>> qif_obj.add_account(acc)
>>> cat = qif.Category(name='food')
>>> qif_obj.add_category(cat)
>>> tr1 = qif.Transaction(amount=0.55)
>>> acc.add_transaction(tr1, header='!Type:Bank')

>>> tr2 = qif.Transaction()
>>> tr2.amount = -6.55
>>> tr2.to_account = 'Cash'
>>> acc.add_transaction(tr2)
>>> acc.add(tr2)
>>> str(qif_obj)
'!Type:Cat\nNfood\nE\n^\n!Account\nNMy Cc\nTBank\n^\n!Type:Bank\nD02/11/2013\nT...
...

More infos

For more informations about qif format:

You can’t perform that action at this time.