Maybe you can try on [pyconcrete][1]
encrypt `.pyc` to `.pye` and decrypt when import it
encrypt & decrypt by library OpenAES
Usage
--------------
### Full encrypted
* convert all of your `.py` to `*.pye`
$ pyconcrete-admin.py compile --source={your py script} --pye
$ pyconcrete-admin.py compile --source={your py module dir} --pye
* remove `*.py` `*.pyc` or copy `*.pye` to other folder
* *main*.py encrypted as *main*.pye, it can't be executed by normal `python`.
You must use `pyconcrete` to 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
[1]: https://github.com/Falldog/pyconcrete