Question

Is there any library that takes in your python file as input and does tidy-up (modifies it based on the PEP 8 conventions). To understand what I am talking about, a JavaScript analogy is as follows:

  1. Go to this link
  2. Press the button TidyUp

Any online editor or library or script would be appreciated.

Was it helpful?

Solution

You can take a look to PythonTidy which is officially working till python2.5 (and seems to be supported in python2.6) :

Cleans up, regularizes, and reformats the text of Python scripts.

This script reads Python code from standard input and writes a revised version to standard output.

OTHER TIPS

pep8.py gives you warnings for violations. Doesn't actually correct though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top