By this, I simply mean that data is well-formed, has the correct OFX message structure, and doesn't contain any error conditions. What I felt could be done (and better than nothing), was to look inside the data sent from the financial institution and see if it "looked" right.
Encryption could occur outside the Python environment (e.g., using Windows encryption), but encryption modules exist for Python, so why not use them?įully validating an OFX file isn't tr ivial, and wasn't something that I intended to do myself. The better option was to encrypt the data, similar to the way Money does it internally. I personally didn't care for the idea of having my account credentials stored inside a plain text file. TheFinanceBuff got around the second of these issues by calling the main routine from a batch file and putting his account information there. Doing so allowed the user to edit their institution data, without worrying about accidentally damaging the working portions. Still, it seemed better that this information be stored separate from the executing routines.
The first issue wasn't really a problem, since institution data resided in a data structure at the head of the primary code module. The code also provided no validation of the resulting OFX files prior to sending them to Money, often resulting with Money bombing after something went squirrely (as I can attest). For example, the original scripts required you to define your institution (site) information inside the body of the main code and then provide a password for each account, each time you performed a download. After a few attempts, it became obvious that the scripts did indeed work, but were primitive.
It presented a solid framework within which we could get some work done, without worrying about pretty or user-friendly interfaces.My first step was to install the ActivePython interpreter, download the initial scripts, and edit for a couple of the institutions and accounts that I used. Frankly, after using Python for only a few hours, I developed a great appreciation for it's power and simplicity. I had, however, spent countless hours coding in a variety of languages and scripting interfaces, so I saw this as a new "challenge". Until seeing this code, I had never considered Python. The code was fairly straight-forward, but unless you're comfortable with Python, it looks like gibberish.
I found the code during an initial search for a fix, when I ran across a discussion by TheFinanceBuff. A bit of Python scripting code began it's life circa 2004, when a guy named Steve Dunham posted it for GNUCash development.