Python Runtime
The Python runtime enables you to execute user-defined Python handlers for general-purpose Python jobs and services. and is managed by the digitalhub-runtime-python package.
Supported kinds and actions
| Purpose | Supported Actions |
|---|---|
| General-purpose Python execution | job, serve, build |
The actions behave as follows:
job: Execute a handler as a one-off jobserve: Deploy a handler as a long-lived servicebuild: Create a Docker image with the required dependencies
Prerequisites
Package Python requirement:
- Python >= 3.10, < 3.15
Execution Python versions:
PYTHON3_10PYTHON3_11PYTHON3_12PYTHON3_13
Required packages:
digitalhub-runtime-python
Install from PyPI:
Usage overview
To execute a Python-based handler on the platform:
- Implement the handler as described in handler definition.
- Create a
Functionresource with kindpython. - Call
function.run()to execute the handler.
See how to for detailed instructions on which actions you can execute and how to configure each function kind. See Examples for code samples.