Skip to main content

Lancer

Ever heard of Black? This is the opposite. A tool to turn your clean python code into a hideous (working) 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. Add irritating white spaces.
  4. 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.

Release files for py-lancer 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-lancer 1.0.0
File Size Uploaded
py-lancer-1.0.0.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-lancer 1.0.0
File Interpreter ABI Platform
py_lancer-1.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 34.1 kB

Release files / py-lancer-1.0.0.tar.gz

Download URL py-lancer-1.0.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9049b124a6253343cf7afd75a79b84dbc2a9bcd06068115c189741d004489500
BLAKE2b-256 checksum
How to use checksums
78878bc03bae607039237ae7f949b24cd8d5dab656c3a9d6b700e4ae20b52c2c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / py_lancer-1.0.0-py2.py3-none-any.whl

Download URL py_lancer-1.0.0-py2.py3-none-any.whl
Size 13.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
567cacf1bccc7f54c92b490f7e99b787a208029ff35bf8c98cc47741a2efa99f
BLAKE2b-256 checksum
How to use checksums
d92d8fe085d66fc77b071e325f3269a6af64c8e73f56f46585581e44ec00320a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.9.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page