Feels a little weird to have so much python code, tempted to have a separate python script.  But... I'm ok with it. :)