Closed prouderthings closed 4 years ago
Yeah that's a documentation bug - obsolete syntax, I'll review to fix. What you want is in models
, as you might suspect. The actual syntax now looks like this:
In [1]: from ofxtools.models import STMTRQ
OK, so what's your source for the obsolete docs? It doesn't match anything I published here. If I'm somehow delivering to you docs that lag way behind what's installed on your HDD, I need to understand that in order to shut it down.
Thanks for the quick response!
My sources are below (example is at the bottom):
Web URL: https://ofxtools.readthedocs.io/en/latest/client.html#using-ofxclient-in-another-program Source URL: https://ofxtools.readthedocs.io/en/latest/_sources/client.rst.txt
Ah gotcha, verified. I was looking in the wrong place. This is a quick & easy fix. Thanks for reporting.
Yeah it's really just the import statement. This works fine for me:
In [1]: import datetime; import ofxtools
...: from ofxtools.Client import OFXClient, StmtRq, CcStmtEndRq
...: client = OFXClient("https://ofx.chase.com", userid="MoMoney",
...: org="B1", fid="10898",
...: version=220, prettyprint=True,
...: bankid="111000614")
...: dtstart = datetime.datetime(2015, 1, 1, tzinfo=ofxtools.utils.UTC)
...: dtend = datetime.datetime(2015, 1, 31, tzinfo=ofxtools.utils.UTC)
...: s0 = StmtRq(acctid="1", accttype="CHECKING", dtstart=dtstart, dtend=dtend)
...: s1 = StmtRq(acctid="2", accttype="SAVINGS", dtstart=dtstart, dtend=dtend)
...: c0 = CcStmtEndRq(acctid="3", dtstart=dtstart, dtend=dtend)
...: response = client.request_statements("t0ps3kr1t", s0, s1, c0)
In [2]: response
Out[2]: <_io.BytesIO at 0x7f5345595900>
I'll post a patch to docs in the Client
docstring and in the location you pointed to, and consider that to close this bug.
I really should try to smoke much less crack while trying to close bug reports.
I may be missing something, but in the docs for the method call using OFXClient in another program, the example shows:
When I run this in my virtualenv, I get an ImportError:
Using pkgutil, I can see the available submodules:
Any ideas? Using Python 3.7.7, installed with 'pip install ofxtools'