ofxparse
========
ofxparse is a parser for Open Financial Exchange (.ofx) format files. OFX
files are available from almost any online banking site, so they work well
if you want to pull together your finances from multiple sources. Online
trading accounts also provide account statements in OFX files.
There are three different types of OFX files, called BankAccount,
CreditAccount and InvestmentAccount files. This library has been tested with
real-world samples of all three types. If you find a file that does not work
with this library, please consider contributing the file so ofxparse can be
improved. See the Help! section below for directions on how to do this.
Example Usage
=============
Here's a sample program
.. code:: python
from ofxparse import OfxParser
with codecs.open('file.ofx') as fileobj:
ofx = OfxParser.parse(fileobj)
# The OFX object
ofx.account # An Account object
# AccountType
# (Unknown, Bank, CreditCard, Investment)
# Account
account = ofx.account
account.account_id # The account number
account.number # The account number (deprecated -- returns account_id)
account.routing_number # The bank routing number
account.branch_id # Transit ID / branch number
account.type # An AccountType object
account.statement # A Statement object
account.institution # An Institution object
# InvestmentAccount(Account)
account.brokerid # Investment broker ID
account.statement # An InvestmentStatement object
# Institution
institution = account.institution
institution.organization
institution.fid
# Statement
statement = account.statement
statement.start_date # The start date of the transactions
statement.end_date # The end date of the transactions
statement.balance # The money in the account as of the statement date
statement.available_balance # The money available from the account as of the statement date
statement.transactions # A list of Transaction objects
# InvestmentStatement
statement = account.statement
statement.positions # A list of Position objects
statement.transactions # A list of InvestmentTransaction objects
# Transaction
for transaction in statement.transactions:
transaction.payee
transaction.type
transaction.date
transaction.user_date
transaction.amount
transaction.id
transaction.memo
transaction.sic
transaction.mcc
transaction.checknum
# InvestmentTransaction
for transaction in statement.transactions:
transaction.type
transaction.tradeDate
transaction.settleDate
transaction.memo
transaction.security # A Security object
transaction.income_type
transaction.units
transaction.unit_price
transaction.comission
transaction.fees
transaction.total
transaction.tferaction
# Positions
for position in statement.positions:
position.security # A Security object
position.units
position.unit_price
position.market_value
# Security
security = transaction.security
# or
security = position.security
security.uniqueid
security.name
security.ticker
security.memo
Help!
=====
Sample ``.ofx`` and ``.qfx`` files are very useful. If you want to help us out,
please edit all identifying information from the file and then email it to
jseutter dot ofxparse at gmail dot com.
Development
===========
Prerequisites::
# Ubuntu
sudo apt-get install python-beautifulsoup python-nose python-coverage-test-runner
# Python 3 (pip)
pip install BeautifulSoup4 six lxml nose coverage
# Python 2 (pip)
pip install BeautifulSoup six nose coverage
The `six` package is required for python 2.X compatibility
Tests:
Simply running the ``nosetests`` command should run the tests.
.. code:: bash
nosetests
If you don't have nose installed, the following might also work:
.. code:: bash
python -m unittest tests.test_parse
Test Coverage Report:
.. code:: bash
coverage run -m unittest tests.test_parse
# text report
coverage report
# html report
coverage html
firefox htmlcov/index.html
Homepage
========
| Homepage: https://sites.google.com/site/ofxparse
| Source: https://github.com/jseutter/ofxparse
License
=======
ofxparse is released under an MIT license. See the LICENSE file for the actual
license text. The basic idea is that if you can use Python to do what you are
doing, you can also use this library.
Raw data
{
"_id": null,
"home_page": "http://sites.google.com/site/ofxparse",
"name": "ofxparse",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "ofx,Open Financial Exchange,file formats",
"author": "Jerry Seutter",
"author_email": "jseutter.ofxparse@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/45/ae/98a2acfd06d15869c4b1be7fb74849c8a67cf15b65181f1fe879547e7494/ofxparse-0.21.tar.gz",
"platform": "",
"description": "ofxparse\n========\n\nofxparse is a parser for Open Financial Exchange (.ofx) format files. OFX\nfiles are available from almost any online banking site, so they work well\nif you want to pull together your finances from multiple sources. Online\ntrading accounts also provide account statements in OFX files.\n\nThere are three different types of OFX files, called BankAccount,\nCreditAccount and InvestmentAccount files. This library has been tested with\nreal-world samples of all three types. If you find a file that does not work\nwith this library, please consider contributing the file so ofxparse can be\nimproved. See the Help! section below for directions on how to do this.\n\nExample Usage\n=============\n\nHere's a sample program\n\n.. code:: python\n\n from ofxparse import OfxParser\n with codecs.open('file.ofx') as fileobj:\n ofx = OfxParser.parse(fileobj)\n \n # The OFX object\n \n ofx.account # An Account object\n\n # AccountType\n # (Unknown, Bank, CreditCard, Investment)\n\n # Account\n \n account = ofx.account \n account.account_id # The account number\n account.number # The account number (deprecated -- returns account_id)\n account.routing_number # The bank routing number\n account.branch_id # Transit ID / branch number\n account.type # An AccountType object\n account.statement # A Statement object\n account.institution # An Institution object\n\n # InvestmentAccount(Account)\n\n account.brokerid # Investment broker ID\n account.statement # An InvestmentStatement object\n\n # Institution\n \n institution = account.institution\n institution.organization\n institution.fid\n \n # Statement\n \n statement = account.statement\n statement.start_date # The start date of the transactions\n statement.end_date # The end date of the transactions\n statement.balance # The money in the account as of the statement date\n statement.available_balance # The money available from the account as of the statement date\n statement.transactions # A list of Transaction objects\n\n # InvestmentStatement\n\n statement = account.statement \n statement.positions # A list of Position objects\n statement.transactions # A list of InvestmentTransaction objects\n\n # Transaction\n \n for transaction in statement.transactions:\n transaction.payee\n transaction.type\n transaction.date\n transaction.user_date\n transaction.amount\n transaction.id\n transaction.memo\n transaction.sic\n transaction.mcc\n transaction.checknum\n\n # InvestmentTransaction\n \n for transaction in statement.transactions:\n transaction.type\n transaction.tradeDate\n transaction.settleDate\n transaction.memo\n transaction.security # A Security object\n transaction.income_type\n transaction.units\n transaction.unit_price\n transaction.comission\n transaction.fees\n transaction.total\n transaction.tferaction\n\n # Positions\n \n for position in statement.positions:\n position.security # A Security object\n position.units\n position.unit_price\n position.market_value\n\n # Security\n \n security = transaction.security\n # or\n security = position.security\n security.uniqueid\n security.name\n security.ticker\n security.memo\n \n\nHelp!\n=====\n\nSample ``.ofx`` and ``.qfx`` files are very useful. If you want to help us out,\nplease edit all identifying information from the file and then email it to\njseutter dot ofxparse at gmail dot com.\n\nDevelopment\n===========\n\nPrerequisites::\n # Ubuntu\n sudo apt-get install python-beautifulsoup python-nose python-coverage-test-runner\n # Python 3 (pip)\n pip install BeautifulSoup4 six lxml nose coverage\n # Python 2 (pip)\n pip install BeautifulSoup six nose coverage\n\nThe `six` package is required for python 2.X compatibility\n\nTests:\nSimply running the ``nosetests`` command should run the tests.\n\n.. code:: bash\n\n nosetests\n\nIf you don't have nose installed, the following might also work:\n\n.. code:: bash\n\n python -m unittest tests.test_parse\n\nTest Coverage Report:\n\n.. code:: bash\n\n coverage run -m unittest tests.test_parse\n \n # text report\n coverage report\n\n # html report\n coverage html\n firefox htmlcov/index.html\n\n\nHomepage\n========\n| Homepage: https://sites.google.com/site/ofxparse\n| Source: https://github.com/jseutter/ofxparse\n\nLicense\n=======\n\nofxparse is released under an MIT license. See the LICENSE file for the actual\nlicense text. The basic idea is that if you can use Python to do what you are\ndoing, you can also use this library.\n\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Tools for working with the OFX (Open Financial Exchange) file format",
"version": "0.21",
"split_keywords": [
"ofx",
"open financial exchange",
"file formats"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "defa68c6734b6121b4ea17f2ecf6b503",
"sha256": "057ab68d31270dece4d1a47662096aa76341968aaee145ffc711cb44cbd5c4a7"
},
"downloads": -1,
"filename": "ofxparse-0.21.tar.gz",
"has_sig": false,
"md5_digest": "defa68c6734b6121b4ea17f2ecf6b503",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 53837,
"upload_time": "2021-05-31T03:38:59",
"upload_time_iso_8601": "2021-05-31T03:38:59.526783Z",
"url": "https://files.pythonhosted.org/packages/45/ae/98a2acfd06d15869c4b1be7fb74849c8a67cf15b65181f1fe879547e7494/ofxparse-0.21.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-05-31 03:38:59",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "ofxparse"
}