python script

it's not the most elegant, but it works. outputs to csv.