Rewrote data extraction script from Perl/Unix tools to Python.