Obfuscator
Utility to obfuscate Python code
Installation
pip install localstack-obfuscator
Usage
You need to have a config file in the project you want to obfuscate.
An example config file is given below:
custom_patches: false
minify:
remove_literal_statements: true
exclude:
- "constants.py"
- "routes.py"
remove:
- ".venv"
- "build"
target_dir: "outages"
build_dir: "build"
Note that the exclude
and remove
lists perform different functions:
- The exclusion works on a per-file basis and is for files that should be kept in the package but not obfuscated.
- The removal is for files and directories that should not be in the final build at all.
This is, e.g., useful for the virtual environment directory or the build directory itself.
It also improves the performance because the files are not even copied to the build directory in the first place.
To perform the obfuscation, run the obfuscator against the project directory.
localstack-obfuscator .