ruby script that makes good output and python to parse it