This repository is maintained by the KNIME Team Rakete.
The KNIME Python Integration closes the gap between KNIME Analytics Platform and Python. It provides nodes to write and execute Python scripts and functionality to make use of Python in other parts of KNIME Analytics Platform.
The legacy Python integrations can be found at knime-python-legacy.
This repository contains the source code for the KNIME Python Integration. The code is organized as follows:
- org.knime.ext.py4j: OSGi Wrapper for py4j
- org.knime.python3.py4j.dependencies: Additional dependencies of the OSGi Wrapper for py4j to make classes visible to the classloader of the py4j wrapper plugin
- org.knime.python3: Core functionality for running Python code from KNIME AP
- org.knime.python3.arrow: Functionality for transferring Arrow tables between KNIME AP and Python
- org.knime.python3.arrow.types: Python implementation of special types
- org.knime.python3.nodes: Framework for writing KNIME AP nodes in Python
- org.knime.python3.scripting: Useful functionality for providing Python scripting in KNIME AP
- org.knime.python3.scripting.nodes: Implementation of Python scripting nodes for KNIME AP
- org.knime.python3.views: Library for creating node views in Python
Test the unit tests locally:
- Pip install pytest
- pytest
Test the unit tests locally and see the coverage:
- Pip install coverage
- coverage run -m pytest
- coverage report # to get a report
- coverage html # to transform report to an html site for better view
Additionally, you can enhance VS Code to see the coverage:
- Install the VS Code extension
Coverage Gutters
- coverage xml (after you did
coverage run -m pytest
andcoverage report
; this transforms the report to xml, which is read by VS Code) - Left bottom: click
watch
to see the coverage generally indicated
You can also test within VS Code:
- Setup a testing framework (e.g. pytest) by using the
Testing
icon at the left sidebar - Regularly execute tests from there
Use the Ruff Formatter for Python files.
$ ruff format .
You can find instructions on how to work with our code or develop extensions for KNIME Analytics Platform in the knime-sdk-setup repository on BitBucket or GitHub.