vanth/bin/import-sources
Eli Ribble b9dcf0e9a9 Add script to import data from ofxhome into our DB
Makes my life a little easier to have all of these ofxsources so that I
can test out different sources and start building out support for
communicating with these different institutions

I'm throwing away quite a bit of the data I have but that's okay for now
until I know that I need them
2016-07-20 15:44:57 -06:00

23 lines
579 B
Python
Executable file

#!/usr/bin/env python3
import argparse
import vanth.main
import vanth.ofxhome
import vanth.platform.ofxsource
def main():
vanth.main.setup_logging()
config = vanth.main.get_config()
vanth.main.create_db_connection(config)
parser = argparse.ArgumentParser()
parser.add_argument('dbfile', help='The database file of XML dumped from the open OFX Home DB')
args = parser.parse_args()
with open(args.dbfile, 'r') as f:
data = vanth.ofxhome.parse(f.read())
vanth.platform.ofxsource.ensure_exist(data)
if __name__ == '__main__':
main()