github.com · Saved

google/yapf · GitHub

github.com/google/yapf

Repository

google/yapf

A formatter for Python files

Python · 13,989 stars · Apache-2.0 · last push October 23, 2026

From the page

Saved with the link. Notes from 2007 to 2016 are mostly the page's own words, so this is probably an excerpt.

YAPF takes a different approach. It's based off of 'clang-format', developed by Daniel Jasper. In essence, the algorithm takes the code and reformats it to the best formatting that conforms to the style guide, even if the original code didn't violate the style guide. The idea is also similar to the 'gofmt' tool for the Go programming language: end all holy wars about formatting - if the whole code base of a project is simply piped through YAPF whenever modifications are made, the style remains consistent throughout the project and there's no point arguing about style in every code review.