Git Product home page Git Product logo

Comments (1)

sternmull avatar sternmull commented on July 26, 2024

It should work. But for now all it does is renaming variables, functions, classes, parameters and attributes that can be assumed to be "private" to the module (where all usages are known and are renamed as well):

a.py

def _add(a, _b): # use a leading underscore to mark names that are "private" and should be renamed
    tmp = a # locals don't need an underscore, they are always renamed
    return tmp + _b

def _multiply(x, y,/): # use posonly-parameters to allow renaming
    return x * y

def main(): # no leading underscore, so it will not be renamed
    print(_add(11, 22))
    print(_multiply(23, 42))

if __name__ == '__main__':
    main()

python pyfuscator.py a.py -o b.py

b.py

def _a1(a, _p1):
    _v1 = a
    return _v1 + _p1

def _a2(_v2, _v3, /):
    return _v2 * _v3

def main():
    print(_a1(11, 22))
    print(_a2(23, 42))
if __name__ == '__main__':
    main()

But please be aware that you are quite early. I pushed this code in a prototyping state just to show/discuss it. That's the reason there is no license and no documentation. It is not yet ready for production use! I plan to polish it and document its usage and limitations within the next days. Of course you are welcome if you want to play around with it in its current state. Any feedback is welcome!

from pyfuscator.

Related Issues (1)

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.