This repository is maintained by the KNIME Team Rakete.
It provides a template for creating KNIME Python extensions.
This repository contains a template KNIME Python Extensions. The code is organized as follows:
.
├── icons
│ │── icon.png
├── src
│ └── extension.py
├── demos
│ └── Example_with_Python_node.knwf
├── knime.yml
├── pixi.toml
├── config.yml
│── LICENSE.TXT
└── README.md
You can find instructions on how to work with our code or develop python extensions for KNIME Analytics Platform in the KNIME documentation:
-
Clone this repository or use it as a template (click on the green "Use this template" button):
-
Edit
knime.yml
- provide your metadata, license, ... -
(Optional) Modify the
src/extension.py
file to implement your own logic. -
(Optional) Add python packages to the environment with the following command, or by manually editing the
pixi.toml
file:pixi add <package_name>
It is good practice to keep the
pixi.lock
file in this repository and commit the changes to it whenever you add packages or update them withpixi update
. -
Install the python environment:
pixi install
-
Test the extension in the KNIME Analytics Platform with the extension in debug mode by adding the following line to the knime.ini file (adjust <path_to_this_repository> in the config.yml):
-Dknime.python.extension.config=<path/to/your/config.yml>
This will start the KNIME Analytics Platform with your extension installed. You can now test your extension in the KNIME Analytics Platform (e.g. demo workflow).
-
Bundle your extension:
pixi run build
or if you want the extension's local update site in a specific location (default is
./local_update_site
):pixi run build dest=<path_to_your_update_site>
-
Install the update site in KNIME via
File > Install KNIME Extensions... > Available Software Sites > Add...
and enter the path to your update site (by default
./local_update_site
). After that, you can install your extension. -
To publish on KNIME Hub, follow the KNIME Hub documentation.
For detailed instructions on how to create a KNIME Python extension, please refer to the KNIME Python Extension documentation.