The famous Phaistos Disc from Crete, obfuscation unbroken after thousands of years.
</figcaption>
Opy will obfuscate your extensive, real world, multi module Python source code for free!
And YOU choose per project what to obfuscate and what not, by editing the config file:
You can recursively exclude all identifiers of certain modules from obfuscation.
You can exclude human readable configuration files containing Python code.
You can use getattr, setattr, exec and eval by excluding the identifiers they use.
You can even obfuscate module file names and string literals.
You can run your obfuscated code from any platform.
Bugs fixed:
utf-8 forced for setup (issue 25)
pep8_comments config setting now defaults to True, making it possible for opy to obfuscate itself as a test
erroneous copying of directories above project root fixed
name of __init__.py files now left unaltered by default
module directories renamed appropriately
.pyc files not copied to target directory tree anymore. N.B. Delete them from your existing target trees since they break obfuscation!
from __future__ import now handled correctly
Bug reports and feature requests are most welcome and will be taken under serious consideration on a non-committal basis
What’s new:
possibiliy to specify input dir, output dir and config file documented
skip_path_fragments implemented
explanatory comments in config file made more clear
reasonable defaults provided for all configuration settings
-h an –help added in addition to ?
pep8_comments option added
support for obfuscation of names starting with __ added
license changed from QQuickLicense to Apache 2.0
empty lines are removed
Installation:
Download and unzip Opy into an arbitrary directory of your computer.
You only need the files opy.py and py_config.txt. They are in the opy subdirectory of your unzipped Opy version.
Put opy.py or a script to launch it in the path of your OS, or simply copy opy.py to the topdirectory of your project.
Use:
For safety, backup your sourcecode and valuable data to an off-line medium.
Put a copy of opy_config.txt in the top directory of your project.
Adapt it to your needs according to the remarks in opy_config.txt.
This file only contains plain Python and is exec’ed, so you can do anything clever in it.
Open a command window, go to the top directory of your project and run opy.py from there.
If the topdirectory of your project is e.g. ../work/project1 then the obfuscation result wil be in ../work/project1_opy.
Further adapt opy_config.txt until you’re satisfied with the result.
Type ‘opy ?’ or ‘python opy.py ?’ (without the quotes) on the command line to display a help text and a reference to the licence.
Important remark:
Obfuscate your Python code only when stricktly needed. Freedom is one of the main benefits of the Python community. In line with this the source of Opy is not obfuscated.
Copyright 2014, 2015, 2016, 2017 Jacques de Hooge, GEATEC engineering, www.geatec.com
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.