Select to view content in your preferred language

Embedding and executing a python script or toolbox in Pro add-in without revealing python file contents

97
1
Tuesday
KevinCheriyan
Frequent Contributor

I'm using the Pro SDK to package up a python toolbox for distribution with my userbase. I use the directions given in the docs here to embed the .py files in the required project structure and use a button from the SDK to execute the toolbox (ExecuteToolAsync method).

Here's the problem. When the add-in loads, the contents of my Toolboxes folder is directly copied to  \Users\<username>\AppData\Local\ESRI\ArcGISPro\Toolboxes. Anyone who reads the docs knows to navigate to this location and access the python code. But I don't want to expose my python code to users. 

What are my options if I want to ship a single .addInX file to users that also contains a .pyt, without revealing my business logic? The python code is written with several machine learning libraries, so it's not feasible to rewrite the python code in C#. 

Thanks!


--------------------------------------------------
Application Developer, GeoMarvel
0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

Encrypting a Python toolbox—ArcGIS Pro | Documentation

Comparing custom and Python toolboxes—ArcGIS Pro | Documentation

custom toolboxes can have their code password protected and you could even dabble with encrypting the *.py file

In any event, licensing is your best option against undesired use since just about anything can be revealed if someone is persistent


... sort of retired...
0 Kudos