YAPF Online Demo

YAPF is an open-source formatter for Python files owned by Google. This is an example implementation.

Source code is available on GitHub.

The ultimate goal is that the code YAPF produces is as good as the code that a programmer would write if they were following the style guide. It takes away some of the drudgery of maintaining your code.

x = { 'a':37,'b':42, 'c':927} y = 'hello ''world' z = 'hello '+'world' a = 'hello {}'.format('world') class foo ( object ): def f (self ): return 37*-2 def g(self, x,y=42): return y def f ( a ) : return 37-a[42-x : y**3]
x = {'a': 37, 'b': 42, 'c': 927} y = 'hello ' 'world' z = 'hello ' + 'world' a = 'hello {}'.format('world') class foo(object): def f(self): return 37 * -2 def g(self, x, y=42): return y def f(a): return 37 - a[42 - x:y**3]