Hi there,
It sounds like you have a specific idea about what the output of this script should be. Given some input/output relationships, I would create a set of fixture and regression tests to run the code against so that, as I'm modifying your code, we could guarantee that your exact specifications are being met.
I have been programming in Python for nearly 10 years, 6 of those professionally. I have extensive experience with developing self-contained, test-hardened, repeatably deployable code. It is very important to me to deliver a project that matches your needs as best as possible. Feel free to contact me so that we can work out something that works for you.
Cheers,
Malcolm