Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library to Tidy Up Python Code using pep8 conventions

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.

like image 754
user993563 Avatar asked Nov 21 '11 15:11

user993563


2 Answers

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.

like image 140
Cédric Julien Avatar answered Oct 04 '22 20:10

Cédric Julien


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

like image 37
Noufal Ibrahim Avatar answered Oct 04 '22 19:10

Noufal Ibrahim