talira

Configurable Python code formatter based on clang-format's algorithm

open sourceApache-2.0free

YAPF looks abandoned: nothing has changed since 10 Feb 2025, and its makers haven't said it has ended.

No commit to the main branch since 10 February 2025, and no reply from a Google member in issues since October 2025; other branches have only automated updates.

YAPF is an Apache-2.0 Python formatter from a repository Google owns, built on the algorithm of clang-format: it calculates the best layout for the code that conforms to the configured style (pep8, google, facebook or your own settings in a style file) rather than only fixing style violations. It runs as a CLI or a library, supports Python 3.7+, and has community plugins for many editors. Its README calls it beta and says it isn't an official Google product. Development has stalled: the last commit to its main branch was in February 2025. Black is the widely used alternative.

Problems it solves

  • reformat my Python code with a style I can configure
  • a Python formatter that follows the Google style guide
  • keep Python formatting consistent across my team without arguing about style

Features

  • reformats code to the best layout for a chosen style, not only style fixes
  • built-in pep8, google and facebook styles, or your own style file
  • CLI and Python library, with community editor plugins

Limitations

  • Its README calls it beta and says it isn't an official Google product.1
  • Supports Python 3.7+.1

Alternatives

The same job

These do what YAPF does.

  1. Black The uncompromising Python code formatter: one deterministic style, no configuration debates
  2. Ruff An extremely fast Python linter and code formatter, written in Rust
  3. autopep8 Automatically reformats Python code to follow the PEP 8 style guide
  4. Airbnb Swift Style Guide Airbnb's Swift style guide, with a SwiftPM plugin that formats and lints to it

Compare YAPF with the top 3