yapf

A formatter for Python files (by google)

Yapf Alternatives

Similar projects and alternatives to yapf

  1. qmk_firmware

    Open-source keyboard firmware for Atmel AVR and Arm USB families

  2. Judoscale

    Save 47% on cloud hosting with autoscaling that just works. Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues.

    Judoscale logo
  3. prettier

    481 yapf VS prettier

    Prettier is an opinionated code formatter.

  4. Poetry

    407 yapf VS Poetry

    Python packaging and dependency management made easy

  5. black

    336 yapf VS black

    The uncompromising Python code formatter

  6. pyenv

    272 yapf VS pyenv

    Simple Python version management

  7. pyright

    145 yapf VS pyright

    Static Type Checker for Python

  8. mypy

    124 yapf VS mypy

    Optional static typing for Python

  9. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  10. ruff

    117 yapf VS ruff

    An extremely fast Python linter and code formatter, written in Rust.

  11. isort

    43 yapf VS isort

    A Python utility / library to sort imports.

  12. Flake8

    38 yapf VS Flake8

    flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

  13. ipython

    35 yapf VS ipython

    Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

  14. pytype

    26 yapf VS pytype

    A static type analyzer for Python code

  15. pyre-check

    24 yapf VS pyre-check

    Performant type-checking for python.

  16. autopep8

    18 yapf VS autopep8

    A tool that automatically formats Python code to conform to the PEP 8 style guide.

  17. pycodestyle

    7 yapf VS pycodestyle

    Simple Python style checker in one Python file

  18. MonkeyType

    10 yapf VS MonkeyType

    A Python library that generates static type annotations by collecting runtime types (by Instagram)

  19. awesome-python-typing

    Collection of awesome Python types, stubs, plugins, and tools to work with them.

  20. ssort

    6 yapf VS ssort

    Tool for automatically sorting python statements within a module

  21. vim-sleuth

    27 yapf VS vim-sleuth

    sleuth.vim: Heuristically set buffer options

  22. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better yapf alternative or higher similarity.

yapf discussion

Log in or Post with

yapf reviews and mentions

Posts with mentions or reviews of yapf. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-18.
  • YouTube asks channel owner to verify phone, permanently overwrites personal info
    1 project | news.ycombinator.com | 17 Feb 2025
    I think they mean that just because code is under github.com/google, it doesn't make it an "official" Google thing.

    For example, yapf[0] is under the Google Github org but has the disclaimer:

    >Note YAPF is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

    libphonenumber doesn't have any similar disclaimer and does seem to be an "official" Google product, but it's hard to tell what Google considers official or not.

    [0] https://github.com/google/yapf

  • Enhance Your Project Quality with These Top Python Libraries
    16 projects | dev.to | 18 Mar 2024
    YAPF (Yet Another Python Formatter): YAPF takes a different approach in that it’s based off of ‘clang-format’, a popular formatter for C++ code. YAPF reformats Python code so that it conforms to the style guide and looks good.
  • Why is Prettier rock solid?
    13 projects | news.ycombinator.com | 19 Feb 2024
    I think I agree about the testing and labor of complicated translation rules.

    But it doesn't appear that almost every pretty printer uses the Wadler pretty printing paper. It seems like MOST of them don't?

    e.g. clang-format is one of the biggest and best, and it has a model that includes "unwrapped lines", a "layouter", a line break cost function, exhaustive search with memoization, and Dijikstra's algorithm:

    https://llvm.org/devmtg/2013-04/jasper-slides.pdf

    The YAPF Python formatter is based on this same algorithm - https://github.com/google/yapf

    The Dart formatter used a model of "chunks, rules, and spans"

    https://journal.stuffwithstuff.com/2015/09/08/the-hardest-pr...

    It almost seems like there are 2 camps -- the functional algorithms for functional/expression-based languages, and other algorithms for more statement-based languages.

    Though I guess Prettier/JavaScript falls on the functional side.

    I just ran across this survey on lobste.rs and it seems to cover the functional pretty printing languages influenced by Wadler, but functional style, but not the other kind of formatter ("Google" formatters perhaps)

    https://arxiv.org/pdf/2310.01530.pdf

  • A Tale of Two Kitchens - Hypermodernizing Your Python Code Base
    31 projects | dev.to | 12 Nov 2023
    To get all your code into a consistent format the next step is to run a formatter. I recommend black, the well-known uncompromising code formatter, which is the most popular choice. Alternatives to black are autoflake, prettier and yapf, if you do not agree with blacks constraints.
  • Front page news headline scraping data engineering project
    3 projects | /r/dataengineering | 13 May 2023
    Use yapf to format code -> https://github.com/google/yapf
  • Confused by Google's docstring "Attributes" section.
    1 project | /r/learnpython | 19 Apr 2023
    Google is surprisingly rigorous when it comes to code formatting. I have been a software engineer at Amazon and it was nothing like what the book says happens at Google. So the conventions you see for python docstring formatting are primarily designed to integrate with Google's internal tooling. By using docstrings following the Google conventions, you will ultimately end up with automated documentation and other fancy automated things (like type checking which they did in the docstring before there were type hints). Also notably, Google has an open source python formatting tool that they use internally called YAPF (which stands for "Yet Another Python Formatter". So if you really want to go all-in on Google python style, grab that, too.
  • Alternate python spacing.
    1 project | /r/Python | 19 Mar 2023
  • Not sure if this is the worst or most genius indentation I've seen
    4 projects | /r/ProgrammerHumor | 6 Mar 2023
    https://github.com/google/yapf has configs, do ctrl+f SPLIT_COMPLEX_COMPREHENSION in the readme
  • Google Python Style Guide
    6 projects | news.ycombinator.com | 11 Feb 2023
  • Enable hyphenation only for code blocks
    2 projects | /r/LaTeX | 6 Jan 2023
    Only as recommendation: If the lines of the source code (here: you C code you aim to document) are kept short, in manageable bytes (similar to entries parser.add_argument in Clark's "Tiny Python Projects", example seldomly pass beyond the frequently recommended threshold of 80 characters/line), reporting with listings becomes easier (equally, the reading of the difference logs/views by git and vimdiff), than with lines of say 120 characters per line. Though we no longer are constrained to 80 characters per line by terminals/screens and punch cards (when Fortran still was FORTRAN), this is a reason e.g., yapf for Python allows you to choose between 4 spaces/indentation (PEP8 style), or 2 spaces/indentation (Google style).
  • A note from our sponsor - CodeRabbit
    coderabbit.ai | 24 Apr 2025
    Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR. Learn more →

Stats

Basic yapf repo stats
22
13,877
5.0
20 days ago

google/yapf is an open source project licensed under Apache License 2.0 which is an OSI approved license.

The primary programming language of yapf is Python.


Sponsored
Save 47% on cloud hosting with autoscaling that just works
Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues.
judoscale.com

Did you know that Python is
the 2nd most popular programming language
based on number of references?