diff options
author | Andrej Shadura <andrewsh@debian.org> | 2018-11-05 14:44:38 +0100 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2018-11-05 14:44:38 +0100 |
commit | 4d73449bab819dddc8e7f52ddf01b6bacd2a7e40 (patch) | |
tree | 992d9135cdaf62c13cf05fb6bc73628b1d5c7577 /README.rst | |
parent | 8f6a863fcd6a0518ea8e3e1e863346553d0250ba (diff) | |
parent | 59c3ccc50d3504bfeb1a3f7e31ba806e2b5c3a07 (diff) |
Update upstream source from tag 'upstream/0.19'
Update to upstream version '0.19'
with Debian dir 0cc2866dc4222e919db114429121a55eadb99c77
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 117 |
1 files changed, 99 insertions, 18 deletions
@@ -22,23 +22,105 @@ Here's a sample program from ofxparse import OfxParser with codecs.open('file.ofx') as fileobj: ofx = OfxParser.parse(fileobj) - ofx.accounts # An account with information - ofx.account.number # The account number - ofx.account.routing_number # The transit id (sometimes called branch number) - ofx.account.statement # Account information for a period of time - ofx.account.statement.start_date # The start date of the transactions - ofx.account.statement.end_date # The end date of the transactions - ofx.account.statement.transactions # A list of account activities - ofx.account.statement.balance # The money in the account as of the statement date - ofx.account.statement.available_balance # The money available from the account as of the statement date + + # The OFX object + + ofx.account # An Account object + + # AccountType + # (Unknown, Bank, CreditCard, Investment) + + # Account + + account = ofx.occount + 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.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. +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 =========== @@ -46,13 +128,13 @@ Development Prerequisites:: # Ubuntu sudo apt-get install python-beautifulsoup python-nose python-coverage-test-runner - - # pip for Python 3: + # Python 3 (pip) pip install BeautifulSoup4 six lxml nose coverage - - # pip for Python 2: + # 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. @@ -92,4 +174,3 @@ 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. - |