vidstige
vidstige

Reputation: 13079

Obfuscate python eggs

I've got a nice python egg packaged as per usual with setuptools. Something like this

setup(
    name="my-egg-name",
    version="1.2.3",
    packages=['my.package','.'])

I also found this python obfuscator / minifier called pyminifier. Is there a way in setuptools to run this "on the fly"? Plan B is to have a separate build step that first processes all python code and creates new folders with obfuscated modules, and then pack the egg.

Upvotes: 0

Views: 2220

Answers (1)

Cat Typist
Cat Typist

Reputation: 21

I can provide two answers: (1) based on my reading of the software documentation (2) based on different software where I have personally tested the latest version in production and worked with other people using it in production.

  1. According to the pyminifer documentation at https://liftoff.github.io/pyminifier/ , pyminifier is supposed to support your Plan B to at least some extent (only a single directory is shown in the main page's example):

    "Pyminifier can also work on a whole directory of Python scripts:"

    $ pyminifier --destdir=/tmp/minified_pyminifier pyminifier/*.py

    If pyminifier works ok on your code, there is at least some support for your Plan B.

  2. The Python obfuscator that I usually use for production code, the BitBoost python code obfuscator (http://bitboost.com/python-obfuscator), definitely supports your Plan B as its normal mode.

Disclaimer: Although I am the author of the BitBoost python obfuscator, use it for some of my own projects, and provide the tech support to various customers using it, I am striving to be fair in providing this answer.

Upvotes: 2

Related Questions