kdeps-components-python
v1.0.0kdeps kdeps-component: python
set components / shelf workflow
PurposeRun a Python script through the kdeps API
LLM context: ~276 tokens when loaded (prompt or tool definition)
Where it runs
Part of the components set, used in workflow and agent mode. Ready-made workflow steps (sql, browser, email, git, ocr...) a resource calls by name; in agent mode they are also tools.
- a resource names a component (or the model calls it as a tool)
- the component's own resources runcomponents/python
- its output goes back to the caller
Loaded by: kdeps (agent loop), /settings, kdeps validate, kdeps run, kdeps bundle package, kdeps env, kdeps export k8s, kdeps test
In the code: kdeps (agent loop)yaml.(*Parser).ParseWorkflowyaml.(*Parser).loadAssetComponents
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Also installs what it requires, when missing or older: schemas/v1, tools/python.
Pin a version with kdeps install components/python@<version>.
Contents
component.yaml
apiVersion: kdeps.io/v1
kind: Component
metadata:
name: python
description: Run a Python script through the kdeps API
version: "1.0.0"
interface:
inputs:
- name: script
type: string
description: Inline Python source. Use scriptFile instead to run a file
- name: scriptFile
type: string
description: "Path to a .py file. Relative paths resolve against the kdeps process working directory"
- name: args
type: array
description: Arguments passed to the script after the script path or -c
- name: env
type: object
description: Extra environment variables as key-value pairs; the process environment is inherited
- name: timeout
type: string
description: Hard stop for the script, for example 30s
- name: venvName
type: string
description: Name of a dedicated virtual environment; omit to share the default one
- name: pythonVersion
type: string
description: Python version for the venv; defaults to KDEPS_PYTHON_VERSION, then 3.12
- name: packages
type: array
description: Python packages installed into the venv before the script runs
# Each call posts to the kdeps API tool, which runs the python executor; the
# component output is stdout parsed as JSON when possible, otherwise text.
output: "{{ fromJSON(output('call').body) }}"
resources:
- actionId: call
name: Run script
httpClient:
method: POST
# In-process host. The HTTP executor calls the handler without dialing.
url: http://kdeps.api/apis/tools.kdeps.io/v1/tools/python/call
headers:
Content-Type: application/json
failOnError: true
# Hard stop for the call; a first run may build the venv, so allow longer
# than the script's own timeout.
timeout: 900s
data:
script: "{{ get('python.script') }}"
scriptFile: "{{ get('python.scriptFile') }}"
args: "{{ get('python.args') }}"
env: "{{ get('python.env') }}"
timeout: "{{ get('python.timeout') }}"
venvName: "{{ get('python.venvName') }}"
pythonVersion: "{{ get('python.pythonVersion') }}"
packages: "{{ get('python.packages') }}"
requires:
schemas/v1: ""
tools/python: ""
version: 1.0.0
requires:
schemas/v1: ""
tools/python: ""
files:
component.yaml: |
apiVersion: kdeps.io/v1
kind: Component
metadata:
name: python
description: Run a Python script through the kdeps API
version: "1.0.0"
interface:
inputs:
- name: script
type: string
description: Inline Python source. Use scriptFile instead to run a file
- name: scriptFile
type: string
description: "Path to a .py file. Relative paths resolve against the kdeps process working directory"
- name: args
type: array
description: Arguments passed to the script after the script path or -c
- name: env
type: object
description: Extra environment variables as key-value pairs; the process environment is inherited
- name: timeout
type: string
description: Hard stop for the script, for example 30s
- name: venvName
type: string
description: Name of a dedicated virtual environment; omit to share the default one
- name: pythonVersion
type: string
description: Python version for the venv; defaults to KDEPS_PYTHON_VERSION, then 3.12
- name: packages
type: array
description: Python packages installed into the venv before the script runs
# Each call posts to the kdeps API tool, which runs the python executor; the
# component output is stdout parsed as JSON when possible, otherwise text.
output: "{{ fromJSON(output('call').body) }}"
resources:
- actionId: call
name: Run script
httpClient:
method: POST
# In-process host. The HTTP executor calls the handler without dialing.
url: http://kdeps.api/apis/tools.kdeps.io/v1/tools/python/call
headers:
Content-Type: application/json
failOnError: true
# Hard stop for the call; a first run may build the venv, so allow longer
# than the script's own timeout.
timeout: 900s
data:
script: "{{ get('python.script') }}"
scriptFile: "{{ get('python.scriptFile') }}"
args: "{{ get('python.args') }}"
env: "{{ get('python.env') }}"
timeout: "{{ get('python.timeout') }}"
venvName: "{{ get('python.venvName') }}"
pythonVersion: "{{ get('python.pythonVersion') }}"
packages: "{{ get('python.packages') }}"
Versions
| Version | Published | Status |
|---|---|---|
| 1.0.0 | 10/21/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.0.0
- Published
- 10/21/2026