vanth/bin/update-ofxsource
Eli Ribble 4f3ef1b102 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.
2016-05-18 15:42:46 -06:00

25 lines
676 B
Python
Executable file

#!/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()