Encrypt source code - Python API Documentation (2024)

As of Allplan 2022-1, it's possible to encrypt the .py-files containing source code.The encrypted files are unreadable and allow to protect the developer's copyrights.

The encrypted files are given the extension .pye and are used if no .py file isavailable. Instead of the .py files the .pye files can be delivered tothe customer.

The encryption of the source code can be executed by the PythonPartEncryptPythonPartScript, located in \etc\Examples\PythonParts\ToolsAndStartExamples.

Encrypt source code - Python API Documentation (1)

The encryption can be executed for a single file or a directory. If a directoryis selected, the files from the sub directories are also encrypted. The subdirectories are created in the target directory, if they don't already exist there.

Testing the PythonPart using the encrypted file(s) can be done as follows:

  • create a directory xxx_Encrypt with xxx is the location of the .py file(s)
  • create the .pye file(s) with the PythonPart EncryptPythonPartScript
  • temporary modify the <Name> tag in the .pyp file by using xxx_Encrypt
  • execute the PythonPart
Encrypt source code - Python API Documentation (2024)
Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 5559

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.