pycodestyle
Simple Python style checker in one Python file
...Just one Python file, requires only stdlib. You can use just the pycodestyle.py file for this purpose. Comes with a comprehensive test suite. There's also a package for Debian/Ubuntu, but it's not always the latest version. You can also make pycodestyle.py show the source code for each error, and even the relevant text from PEP 8. Or you can display how often each error was found.