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
This commit is contained in:
Eli Ribble 2016-07-20 15:44:57 -06:00
parent 140f8fe6c7
commit b9dcf0e9a9
3 changed files with 61 additions and 2 deletions

23
bin/import-sources Executable file
View file

@ -0,0 +1,23 @@
#!/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()