Protect Python Code

How to protect Python Code?

Option 1: Convert Python into Binaries, which client can’t decompile. – Free, Apache License

Article on Cython:

Option 2: Minify / Obfuscate
Minify: Remove empty lines, comments,…etc
Obfuscate: Convert human-readable names to nonreadable format.

List of Obfuscation software:



How to decompile “.PYC” Files?

Option 3: Please add copyright and other file headers to get a legal edge.

Note: Combination of all above based on business need.


Connecting Hive with Python

In production environment we need to connect with multiple Hive Instances.

Option 1: Use ODBC for Python.
This is not proved product to use.

Option 2: Use Pyhs2 driver.
This helps to connect to only one instance of Hive.

Stay away from connecting to Hive with Python in BigData production environment.
Better to decouple technology. Let Python write data to flat files. Load those files to Hive.

Working with Python in Mac

How to install and work with Python in mac?

Step 1:

Step 2: How to install missing module?
On bottom left side of PyCharm, click on computer icon and choose terminal.
select package in import statement. Press Alt+Enter, choose install package.
>sudo easy_install pip
Search for package here
>sudo pip install package_name