Auto formatters for Python πŸ‘¨β€πŸ’»πŸ€–

Kevin Peters
3YOURMIND-Tech
Published in
9 min readJun 2, 2018

--

This post can be found also on my personal blog here: https://www.kevinpeters.net/auto-formatters-for-python

As you can see in the recent Stack Overflow developer survey, Python is one of the most popular programming languages available. With the recent rise of good auto formatters for Code like gofmt for Golang or prettier for JavaScript, there is a good question to ask: Which auto formatter to use with Python Code? An auto formatter is a tool which will format your code in a way it complies to the tool or any other standard it set.

First of all, we need to make sure that we know the reason automatic formatting tools exist. Prettier is an auto formatter for JavaScript code. It is used by many big companies like Facebook, Paypal, Algolia, Yelp, Discord and many others which you can find here. Reasons for this are:

  • You do not need a style guide for low-level problems since the auto formatter deals with those problems
  • This directly reduces the number of discussions about unnecessary things and let the developers focus on writing actual code
  • It will also help with onboarding developers on the code base because the style of the code is consistent
  • Less merge conflicts since the style will almost always be the same

--

--

Kevin Peters
3YOURMIND-Tech

Full-Stack Developer @stripe with a passion for React, Vue.js, JavaScript and .NET Core, also doing Python/Django development. https://www.kevinpeters.net/