Open jones-chris opened 4 years ago
Can you try this:
from io import BytesIO
from ofxparse import OfxParser
ofx_string = """OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
(...)
"""
f = BytesIO(ofx_string)
ofx = OfxParser.parse(f)
# Account
account = ofx.account
account.routing_number
i tried but this TypeError occurs.. TypeError Traceback (most recent call last)
@valinolucas407, try to encode your string, like this:
from io import BytesIO
from ofxparse import OfxParser
ofx_string = """OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
(...)
"""
ofx = OfxParser.parse(BytesIO(ofx_string.encode('utf-8')))
account = ofx.account
account.routing_number
Thanks @leogregianin for explaining this. @valinolucas407, did you get your code to work?
It would be helpful if this library could read an OFX string instead of only OFX files.