Open nagybal opened 4 years ago
Uhh, sorry for the incredibly slow response. For some reason, GitHub never notified me about it.
Did you run into any specific issues? It's not apparent for me based on the log you pasted.
When installed from pip, it simply adds itself as a plugin to ofxstatement, so you'll be able to use it as a converter type. ofxstatement list-plugins
should show it as a plugin and you could use it as an argument of the convert command, eg, ofxstatement -t otp input.xml output.ofx
My bad, I did read the main manual and figured it out. I did install using pip but I still can't convert. Any idea?
vkhunyadi-iMac:Downloads bigb$ pip3 install ofxstatement-otp
Requirement already satisfied: ofxstatement-otp in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (0.0.4)
Requirement already satisfied: ofxstatement in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from ofxstatement-otp) **(0.6.5)**
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from ofxstatement->ofxstatement-otp) (47.1.0)
Requirement already satisfied: appdirs>=1.3.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from ofxstatement->ofxstatement-otp) (1.4.4)
vkhunyadi-iMac:Downloads bigb$ ofxstatement convert -t otp HUF.xml HUF.ofx
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/ofxstatement", line 11, in <module>
load_entry_point('ofxstatement==0.6.5', 'console_scripts', 'ofxstatement')()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/tool.py", line 178, in run
return args.func(args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/tool.py", line 149, in convert
statement = parser.parse()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/plugins/otp.py", line 29, in parse
tree = ET.parse(self.filename)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
tree.parse(source, parser)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/xml/etree/ElementTree.py", line 595, in parse
self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 41, column 312
The EUR statement fails as well but on different lines.
vkhunyadi-iMac:Downloads bigb$ ofxstatement convert -t otp EUR.xml EUR.ofx
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/ofxstatement", line 11, in <module>
load_entry_point('ofxstatement==0.6.5', 'console_scripts', 'ofxstatement')()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/tool.py", line 178, in run
return args.func(args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/tool.py", line 149, in convert
statement = parser.parse()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/plugins/otp.py", line 31, in parse
self._parse_statement_properties(tree)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ofxstatement/plugins/otp.py", line 39, in _parse_statement_properties
bnk = stmt.find('./Acct/Svcr/FinInstnId/Nm')
AttributeError: 'NoneType' object has no attribute 'find'
Hmm, these seem to be genuine parsing errors, I have encountered those many times, as OTP tends to treat the OFX standard loosely and keeps introducing new changes.
The HUF error seems to indicate that the XML itself is not well-formed -- maybe one of the tags are not closed, escaping is broken or something else. There's not much to do about it as there's no mechanism in ofxstatement to preprocess these files, and adding it would be a huge overkill (you can try though!). You can try looking at HUF.xml itself (based on the traceback, in line 41, column 312), to see what's going on, and maybe report it to OTP if something's genuinely wrong. You can also fix it manually, of course, but that pretty much beats the purpose of having a tool like this to be able to automate conversions. When I encountered such problems, they usually just went away after a few days.
The EUR.xml is more specific to this module itself, but I could not reproduce it and it also signals a serious issue with the XML exported by OTP. The file should contain a node called <Rpt>
, under which everything else is listed. If it does not have it, the conversion is not possible. Are you sure there are entries within the selected timeframe for the export or you managed to download the entire file?
If you send over those XML files, I can also take a look at them. But they, of course, contain highly sensitive information of your financial transactions, so please manually sanitize them before you do that.
If you send over those XML files, I can also take a look at them. But they, of course, contain highly sensitive information of your financial transactions, so please manually sanitize them before you do that.
For the best troubleshooting possible I would rather send the XML files over via direct message. Please email me something nagy.balage@gmail.com
I believe I have successfully installed the plug-in. How to use it?