Python Runtime
The Python runtime enables you to execute user-defined Python handlers. It registers a Function kind python and supports three actions: job, serve, and build.
job: Execute a Python handler as a one-off jobserve: Deploy a Python handler as a long-lived servicebuild: Create a Docker image with all required dependencies for efficient execution
Prerequisites
Supported Python versions:
- Python ≥ 3.9, < 3.13
Required packages:
digitalhub-runtime-python
Install from PyPI:
Usage overview
To execute a Python handler on the platform:
- Implement the handler as described in handler definition.
- Create a
Functionresource that references your handler and declares inputs/outputs. - Call
function.run()to execute the handler.
See how to for detailed instructions on which actions you can execute and how to configure your Python functions. See Examples for code samples.