Hi all!
I am working with an Esri partner to modernize an existing python toolbox in preparation for commercialization on their behalf and we've encountered a couple of questions I have yet to find an answer to that I believe will apply to a broad swath of users.
At this stage, we're focusing on the encryption and packaging of source-code. First, I'm going to outline the work already done on encryption, but will primarily have questions on packaging as I think it will influence the execution of the former anyways.
Encryption
Due to the size of our code base, we've went ahead and separated out most of the core logic into separate modules to then be brought into the toolbox via import in the .PYT. Through some experimentation I've been able to test the existing "Right-click --> Encrypt.." workflow as well as applying EncryptPYT across our modularized repo structure and have found that neither option in my current implementation covers our ideal scenario.
When running encrypt against solely the Python Toolbox (.PYT), our source code is masked via the UI, but depending on packaging would be available for a savvy and/or curious user to discover on their file system. I've also found that applying the arcpy function to each sub-module renders them un-readable by Pro (and likely python itself) as I imagine neither handles on-the-fly decryption without a larger lift.
Packaging
In conjunction with encryption, we are also brainstorming ideas around packaging and licensing toolboxes for end-user delivery. Our long-term goal would be develop a pattern that provides an end-user experience that's nearly seamless from the perspective of Pro. Some examples of what this could look like include:
- "installing" a toolbox somewhere that Pro natively reads and the toolbox would appear in an end-user's Geoprocessing pane like any-other GP tools
- Licensing tools via Named Users, as this is how most customers are likely managing extensions/add-on functionality
- Packaging a toolbox code in a way that protects author IP, while allowing full-functionality to the end-user
Do y'all have any recommendations on patterns you've found to provide some of these core aspects of design? For most cases, are Python toolboxes being distributed internally, and therefore IP considerations may not apply? If so, I'd still love to discuss successful packaging patterns that allow your users to develop and execute your custom logic most efficiently!
Through numerous posts in this community and across others, we've been able to leverage patterns for a handful of design challenges, so thank you all in advance!