Python Zip Package as an alternative to the Python script node

Hi,

I am extensively using the Python Script node in my projects. Unfortunately I find it rather cumbersome especially in case of bigger codes, and object oriented programming is also impossible.

Now I am experimenting with packaging my code as a zip package and uploading it to the workflow group. Everything works fine. The package can be imported into the Python Script node like any Conda packages, and I can successfully execute the code.

What do you think about this approach? Would this solution work on the KNIME server in a production Environment?
package_import1.knar (19.9 KB)
KNIME python package

2 Likes

Dear @kuhlburger_t,

that looks awesome! Indeed the node’s name has Script in it and object oriented programming within the node is understandably difficult. I am happy that you found this nice way. I currently do not see why this should not work on a server, but I have also not never tried it out.

You might stay tuned for KNIME Analytics Platform 5.2, maybe the Python Script node will look different then…

Best regards
Steffen

2 Likes

@kuhlburger_t
interesting indeed.
what does the zip file contain? A init.py or just python files with classes and functions?
br

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.