More work on python script. Need to fix insert into DB.