My task: casual obfuscation to prevent code from being easily reused. Just obfuscating variable names would be fine.

Are there any tools that allow the following?

  1. Obfuscate Python 3 code.
  2. Generate sourcemaps.
  3. Decode exception stacktraces.

I would like to avoid anything involving complex custom compilers like Cython, i.e. something very complex and susceptible to lagging behind/diverging from the official Python language.

  • Can you detail a bit more, why you want to obfuscate your code? For example, do you want to avoid professional reverse engineering or do you want to avoid students to use intermediate solutions? – Wrzlprmft Feb 11 '20 at 19:28
  • @Wrzlprmft I want to prevent my distributed Python code from being "forked" and easily reused. Minification (with variable names mangling) alone would be sufficient for me, but available solutions don't seem to support stacktrace decoding (like JS sourcemaps). – Andrey Moiseev Feb 12 '20 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.