yacoob / aib2ofx Goto Github PK
View Code? Open in Web Editor NEWDownload data from aib.ie in OFX format
License: BSD 3-Clause "New" or "Revised" License
Download data from aib.ie in OFX format
License: BSD 3-Clause "New" or "Revised" License
Just had a case where import of OFX file from aib2ofx to iBank would blow up with:
24/12/2012 03:40:33.804 iBank: Parsing error occured while parsing OFX response. Error is The operation couldn’t be completed. (NSXMLParserErrorDomain error 68.)
A bit of binary searching through the OFX file resulted in discovery that there's literal '&' in one of the NAME fields, that blows iBank's (OSX's?) parser up. It should, of course, be escaped into &. Once changed, the file gets imported without problems. Same problem would most likely manifest for other characters that should be escaped as an entity.
If you're unfortunate enough to have >1 transactions on the same day with same details and amount, they'll end up having same transaction id in the resulting OFX file. Which will most likely cause the program reading the OFX file to ignore one. Which is not so good.
This is problematic - we need TIDs to stay constant across repetitive downloads of the OFXs - so we can't use anything like 'transaction position' to change TID.
I'm getting the following error when I run the script
Traceback (most recent call last):
File "/usr/local/bin/aib2ofx", line 9, in <module>
load_entry_point('aib2ofx==0.5.1', 'console_scripts', 'aib2ofx')()
File "/Library/Python/2.7/site-packages/aib2ofx/main.py", line 106, in main
chatter)
File "/Library/Python/2.7/site-packages/aib2ofx/main.py", line 63, in getData
show_and_tell('Logging in as \'%s\'...' % user, bank.login)
File "/Library/Python/2.7/site-packages/aib2ofx/main.py", line 54, in show_and_tell
function(chatter)
File "/Library/Python/2.7/site-packages/aib2ofx/aib.py", line 128, in login
br.open('https://onlinebanking.aib.ie/inet/roi/login.htm')
File "build/bdist.macosx-10.11-intel/egg/mechanize/_mechanize.py", line 203, in open
File "build/bdist.macosx-10.11-intel/egg/mechanize/_mechanize.py", line 230, in _mech_open
File "build/bdist.macosx-10.11-intel/egg/mechanize/_opener.py", line 193, in open
File "build/bdist.macosx-10.11-intel/egg/mechanize/_urllib2_fork.py", line 344, in _open
File "build/bdist.macosx-10.11-intel/egg/mechanize/_urllib2_fork.py", line 332, in _call_chain
File "build/bdist.macosx-10.11-intel/egg/mechanize/_urllib2_fork.py", line 1170, in https_open
File "build/bdist.macosx-10.11-intel/egg/mechanize/_urllib2_fork.py", line 1118, in do_open
urllib2.URLError: <urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)>
It looks to me like a dependency-type error.
...and script no longer works.
So far:
Now that AIB has non-crappy historical transactions list that actually spans a meaningful amount of time, we should use it. This will prevent situations where the transactions are missing from the list, because there were too many of them since the last scrape.
URL: https://onlinebanking.aib.ie/inet/roi/historicaltransactions.htm
If there's a trailing comma after the last entity in a json object, the json parser barfs. It should probably be resilient to this.
...and it really should. Staged roll out of this interface is bit problematic, but given the vast userbase :) of aib2ofx
it should be sufficient to point users of old interface to an older release.
FTR, new interface is here.
As subject. Probably should do so or at least be mentioned in docs.
Bombs out with this for me.
pip can install directly from git: https://pip.pypa.io/en/latest/reference/pip_install.html#vcs-support
Maybe all that's needed is finding the right command line for pip. My attempt:
(finanse-env)maciej@cotton:~$ pip install [email protected]:yacoob/aib2ofx.git@HEAD
Exception:
Traceback (most recent call last):
File ".../env/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File ".../env/local/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
InstallRequirement.from_line(name, None))
File ".../env/local/lib/python2.7/site-packages/pip/req.py", line 173, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File ".../env/local/lib/python2.7/site-packages/pip/req.py", line 71, in __init__
req = pkg_resources.Requirement.parse(req)
File ".../env/lib/python-wheels/setuptools-12.2-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2929, in parse
reqs = list(parse_requirements(s))
File ".../env/lib/python-wheels/setuptools-12.2-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2876, in parse_requirements
"version spec")
File ".../env/lib/python-wheels/setuptools-12.2-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2841, in scan_list
raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', '[email protected]:yacoob/aib2ofx.git@HEAD', 'at', '[email protected]:yacoob/aib2ofx.git@HEAD')
Storing debug log for failure in /home/maciej/.pip/pip.log
You sir (or mam) are just to god-damn awesome! It would almost be unfair to the rest of us, having all that awesome, releasing and maintaining this for 5 years! I honest to god fist pumped the air when I stumbled in here. One step closer to automated entry of transactions. Search high and low, and eventually you will find that some legend has already worked it all out for you. Thank you!
ps haven't even looked at it or tried using it yet, just gleamed over it and couldn't help stopping to thank you.
AIB introduced 2FA recently. aib2ofx need to handle it. Right now it looks like there's simply a confirmation on the phone, and the page auto-forwards - which will be difficult to do without full Javascript support. Oh, and it also times out immediately for Firefox and Chrome under OSX (Safari works).
There's also "Limited access" button which doesn't go through the 2FA flow and seem to allow for transaction export, so there's that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.