Maybe you can try on pyconcrete, it's my open-source project
encrypt .pyc to .pye and decrypt when import it
encrypt & decrypt by library OpenAES
Usage
Full encrypted
convert all of your
.pyto*.pye$ pyconcrete-admin.py compile --source={your py script} --pye $ pyconcrete-admin.py compile --source={your py module dir} --pyeremove
*.py*.pycor copy*.pyeto other foldermain.py encrypted as main.pye, it can't be executed by normal
python. You must usepyconcreteto process the main.pye script.pyconcrete(exe) will be installed in your system path (ex: /usr/local/bin)pyconcrete main.pye src/*.pye # your libs
Partial encrypted (pyconcrete as lib)
download pyconcrete source and install by setup.py
$ python setup.py install \ --install-lib={your project path} \ --install-scripts={where you want to execute pyconcrete-admin.py and pyconcrete(exe)}import pyconcrete in your main script
recommendation project layout
main.py # import pyconcrete and your lib pyconcrete/* # put pyconcrete lib in project root, keep it as original files src/*.pye # your libs