Skip to main content

A tool to turn your clean python code into a hideous mess.

Project description


Ever heard of Black? This is the opposite. A tool to turn your clean python code into a hideous (working) mess.


  1. Turn all comments into Pitbull lyrics 💃
  2. Turn all your variable names into a mixture of animal sounds and horribly similar looking characters like "bark_bark_0OO0O". 🐶
  3. Add irritating white spaces.
  4. Code still compiles after all these improvements! 👷



# function that adds two numbers
def addition(a: int, b: int) -> int:

    # find sum
    result = a + b

    # return the sum
    return result

if __name__ == '__main__':
    print("Sum of 1 and 3 is %s" % addition(1, 3))


# there's nothing like Miami's heat
def quack_Il1Ι1l(squeak_squeak_IIΙΙlI: int, honk_honk_honk_aaαaα: int) -> int:

    # Bada bing, bada boom
    growl_growl_growl_ααaaα= squeak_squeak_IIΙΙlI  + honk_honk_honk_aaαaα

    # Hey baby, givin' it your all when you're dancin' on me
    return growl_growl_growl_ααaaα

if __name__ == '__main__':
    print("Sum of 1 and 3 is %s" % quack_Il1Ι1l(1, 3))

Installation and Usage

Simply run pip install py-lancer and then use the lance command line tool.

usage: lance [-h] [--version] -f ./ [-y]

Ever heard of Black? This is the opposite.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -f ./, --file ./
                        Python file to be lance'd.
  -y, --yolo            Overwrite original file, lol.

So if you have a python file at ./, you simply run lance -f ./

How does it work

The key tool we use it the tokenizer standard module in python. It allows us to tokenize any python script which then in turn makes substituting comments and variable names fairly simple. Check out the source code for more details.


Bug reports, fixes and additional features are always welcome! Make sure to run the tests with python test and write your own for new features. Thanks.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for py-lancer, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size py_lancer-1.0.0-py2.py3-none-any.whl (13.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size py-lancer-1.0.0.tar.gz (20.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page