I'm not super familiar with python, but I've tried using a pep8 auto formatter and it seemed to reformat it to comply to standards https://github.com/hhatto/autopep8
Perhaps that could be useful when having to write pep8 compliant code but don't want to manually format everything.