This Python package cleans your code!

Manpreet Singh
3 min readOct 21, 2021

Welcome back! I am not the best the best coder, therefore, my code can definitely get pretty messy at times, so what if there was a Python package that actually helped clean our code for us? Well, there actually is! There is a Python package called Black that actually allows us to do this, if you want to learn more about this package, check out the link below:

Now, this package has a lot going on with it, so let’s take a look at the following example from their GitHub, the following is some basic Python code, it’s definitely not formatted in the best way possible:

This package will take this code and clean it up for us, here is the output after running it through this package:

--

--