Add simple script for inserting ofxsources

This only adds one institution that I care about, AFCU, but could be
extended to use the data from ofxhome.com. I downloaded the data from
them but found two problems. One, they work in XML, which I don't feel
like parsing, but two and far more importantly, they provide the second
piece of data I need, the routing number for the bank. That sucks. So
it's likely that if this project does well we will have more data than
them.
This commit is contained in:
Eli Ribble 2016-05-18 15:42:46 -06:00
parent 63a22e27e0
commit 4f3ef1b102
2 changed files with 39 additions and 4 deletions

25
bin/update-ofxsource Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env python3
import logging
import uuid
import vanth.main
import vanth.tables
LOGGER = logging.getLogger(__name__)
def main():
vanth.main.setup_logging()
config = vanth.main.get_config()
engine = vanth.main.create_db_connection(config)
new_uuid = uuid.uuid4()
query = vanth.tables.OFXSource.insert().values( # pylint: disable=no-value-for-parameter
uuid = str(new_uuid),
name = 'America First Credit Union',
fid = '54324',
bankid = '324377516',
)
results = engine.execute(query)
LOGGER.info("Created OFX source %s", results.inserted_primary_key[0])
if __name__ == '__main__':
main()