Skip to main content

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

Project description

Lancer

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

Features

  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. Code still compiles after all these improvements! 👷

Example

Before:

# 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))

After:

# 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 ./FILE_PATH.py [-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_PATH.py, --file ./FILE_PATH.py
                        Python file to be lance'd.
  -y, --yolo            Overwrite original file, lol.

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

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.

Contribute

Bug reports, fixes and additional features are always welcome! Make sure to run the tests with python setup.py 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.

Source Distribution

py-lancer-0.9.2.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

py_lancer-0.9.2-py2.py3-none-any.whl (13.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file py-lancer-0.9.2.tar.gz.

File metadata

  • Download URL: py-lancer-0.9.2.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for py-lancer-0.9.2.tar.gz
Algorithm Hash digest
SHA256 5c093038c7e6bb530ebe7fe431d2a4b63287f4d8a75b573610add5f397951721
MD5 1c295a2a4c1b8fce579838eeba90f6f5
BLAKE2b-256 901c044eb66aa03b1bebf8208c03776e1db9efb8576bc847e74f1bc04b56b3fb

See more details on using hashes here.

File details

Details for the file py_lancer-0.9.2-py2.py3-none-any.whl.

File metadata

  • Download URL: py_lancer-0.9.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for py_lancer-0.9.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a656026203c648143ede45e70c10f0a991182357a441932df5bb85e57e01d579
MD5 98a23deac5ee66d2f1fefccb22c9688f
BLAKE2b-256 e922f2e62e0317cd97c6d764b7e7f4b73bb0b5c3fe98aeda5a97c4bdcea52f7c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page