GithubHelp home page GithubHelp logo

jonpizza / lancer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leviborodenko/lancer

0.0 1.0 0.0 55 KB

Turn your python code into a hideous mess. Ever heard of Black? This is the opposite.

License: MIT License

Python 100.00%

lancer's Introduction

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.

lancer's People

Contributors

leviborodenko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.