Auto formatters for Python 👨‍💻🤖

Kevin Peters
Jun 2, 2018 · 9 min read
Image for post
Image for post

autopep8 — GitHub

yapf — GitHub

black — GitHub


Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Left is the base code, yapf (Google, pep8) did not make any changes, the code in the middle is formatted by black and the right one is formatted by yapf (Facebook)

Image for post
Image for post
Base code, autopep8 and yapf (Google, pep8)
Image for post
Image for post
black and yapf (Facebook)

Image for post
Image for post
Base code
Image for post
Image for post
autopep8
Image for post
Image for post
black
Image for post
Image for post
yapf (Facebook)
Image for post
Image for post
yapf (Google), yapf (pep8)

Image for post
Image for post
Base code
Image for post
Image for post
autopep8
Image for post
Image for post
black
Image for post
Image for post
yapf (Facebook)
Image for post
Image for post
yapf (Google), yapf (pep8)

Conclusion


3YOURMIND-Tech

Blog of the technology team at @3YOURMIND.

Thanks to James O'Shea

Kevin Peters

Written by

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

3YOURMIND-Tech

Blog of the technology team at @3YOURMIND. We give you an insight look into the team. We are working with Python, Vue.js, JavaScript, Java, C++ and many more languages.

Kevin Peters

Written by

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

3YOURMIND-Tech

Blog of the technology team at @3YOURMIND. We give you an insight look into the team. We are working with Python, Vue.js, JavaScript, Java, C++ and many more languages.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store