kpipeliner 1.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. kpipeliner-1.12.1/.gitignore +11 -0
  2. kpipeliner-1.12.1/PKG-INFO +121 -0
  3. kpipeliner-1.12.1/README.md +97 -0
  4. kpipeliner-1.12.1/kpipeline/__init__.py +12 -0
  5. kpipeliner-1.12.1/kpipeline/config.yaml +49 -0
  6. kpipeliner-1.12.1/kpipeline/kpipeline.py +1617 -0
  7. kpipeliner-1.12.1/kpipeline/src/__init__.py +0 -0
  8. kpipeliner-1.12.1/kpipeline/src/executor.py +213 -0
  9. kpipeliner-1.12.1/kpipeline/src/kbase_nodes.py +149 -0
  10. kpipeliner-1.12.1/kpipeline/src/kgraph.py +489 -0
  11. kpipeliner-1.12.1/kpipeline/src/kmcp.py +257 -0
  12. kpipeliner-1.12.1/kpipeline/src/knode.py +1144 -0
  13. kpipeliner-1.12.1/kpipeline/src/kparameter.py +70 -0
  14. kpipeliner-1.12.1/kpipeline/src/kpaths.py +156 -0
  15. kpipeliner-1.12.1/kpipeline/src/kwui.py +1469 -0
  16. kpipeliner-1.12.1/kpipeline/templates/config.graph_template.yaml +71 -0
  17. kpipeliner-1.12.1/kpipeline/templates/config.node_template.yaml +93 -0
  18. kpipeliner-1.12.1/kpipeline/templates/kwui_workflow_template.py +59 -0
  19. kpipeliner-1.12.1/kpipeline/templates/node_template.py +76 -0
  20. kpipeliner-1.12.1/kpipeline_gui/__init__.py +0 -0
  21. kpipeliner-1.12.1/kpipeline_gui/frontend/dist/assets/index-3b6e8f55.css +1 -0
  22. kpipeliner-1.12.1/kpipeline_gui/frontend/dist/assets/index-6e2583a2.js +65 -0
  23. kpipeliner-1.12.1/kpipeline_gui/frontend/dist/assets/klogo-f2c8dac3.png +0 -0
  24. kpipeliner-1.12.1/kpipeline_gui/frontend/dist/index.html +19 -0
  25. kpipeliner-1.12.1/kpipeline_gui/mcp_app.py +146 -0
  26. kpipeliner-1.12.1/kpipeline_gui/mcp_server.py +73 -0
  27. kpipeliner-1.12.1/kpipeline_gui/server.py +1619 -0
  28. kpipeliner-1.12.1/pyproject.toml +64 -0
@@ -0,0 +1,11 @@
1
+ .venv/
2
+ *.pyc
3
+ .claude/
4
+ __pycache__/
5
+ /dist/
6
+ *.egg-info/
7
+ graphify-out/
8
+ milestones.md
9
+ decisions.md
10
+ CLAUDE.md
11
+ Readme
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.5
2
+ Name: kpipeliner
3
+ Version: 1.12.1
4
+ Summary: kpipeliner (kpl) is a node-based pipeline manager.
5
+ Project-URL: Repository, https://github.com/Kaptura-GmbH/kpipeliner
6
+ Keywords: automation,nodes,pipeline,workflow
7
+ Classifier: Operating System :: POSIX :: Linux
8
+ Classifier: Programming Language :: Python :: 3
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: fastapi>=0.111.0
11
+ Requires-Dist: psutil>=5.9
12
+ Requires-Dist: pyyaml>=6.0
13
+ Requires-Dist: tqdm>=4.65
14
+ Requires-Dist: uvicorn[standard]>=0.30.0
15
+ Requires-Dist: websockets>=12.0
16
+ Provides-Extra: all
17
+ Requires-Dist: kwebui; (python_version >= '3.12') and extra == 'all'
18
+ Requires-Dist: mcp>=2.0.0; extra == 'all'
19
+ Provides-Extra: kwui
20
+ Requires-Dist: kwebui; (python_version >= '3.12') and extra == 'kwui'
21
+ Provides-Extra: mcp
22
+ Requires-Dist: mcp>=2.0.0; extra == 'mcp'
23
+ Description-Content-Type: text/markdown
24
+
25
+ # kpipeliner
26
+
27
+ A node-based pipeline manager. A pipeline is a graph of nodes; each node is a
28
+ standalone Python program (its own subprocess, optionally its own
29
+ venv/conda/pixi environment) with typed inputs and outputs declared in YAML.
30
+ Build and run pipelines from the CLI (`kpl`), a visual web GUI, or hand them
31
+ over to an LLM through MCP.
32
+
33
+ ![kpipeliner GUI](docs/wiki/images/gui-overview.png)
34
+
35
+ ## Highlights
36
+
37
+ - **Graph = YAML.** Connections are just strings (`nodes.<name>.<output>`) —
38
+ no hidden edge list, easy to read, easy to script.
39
+ - **Subprocess isolation.** Every node runs on its own, with its own Python
40
+ environment if it needs one; a crash in one node never takes down another.
41
+ - **Caching by default.** Node outputs are cached per run-UUID; re-running a
42
+ pipeline only recomputes what actually changed.
43
+ - **CLI + GUI + MCP.** Script it, click through it in the browser, or connect
44
+ an MCP client and let an LLM design/inspect/run it for you.
45
+ - **Groups & reusable components.** Bundle nodes in the GUI and export them as
46
+ drag-and-drop components for other pipelines.
47
+
48
+ ## Install
49
+
50
+ kpipeliner is a normal Python package — installing it is the whole installation
51
+ (dependencies, the prebuilt web GUI and the `kpl` command; no Node.js, no installer
52
+ script). With [uv](https://docs.astral.sh/uv/):
53
+
54
+ ```bash
55
+ uv tool install kpipeliner # `kpl` ends up on your PATH
56
+ kpl --help
57
+ ```
58
+
59
+ or into an environment of your own: `uv pip install kpipeliner` (or `pip install kpipeliner`).
60
+
61
+ Optional extras — nothing imports them unless you use the feature, so leaving them out is fine:
62
+
63
+ ```bash
64
+ uv tool install "kpipeliner[mcp]" # `kpl mcp` / `kpl gui --mcp` (LLM client access)
65
+ uv tool install "kpipeliner[kwui]" # `kpl run --kwui` (a web UI per node)
66
+ uv tool install "kpipeliner[all]" # both
67
+ ```
68
+
69
+ Configuration lives in a `config.yaml` that ships with the package; the first run copies it
70
+ to `~/.config/kpipeliner/config.yaml` (or `$KPL_HOME/config.yaml`) so your edits survive
71
+ upgrades. `kpl config` prints its location.
72
+
73
+ **Developing kpipeliner itself:** clone the repository and run `uv pip install -e .` (or
74
+ `uv sync --all-extras`) — an editable install; the checkout's own `config.yaml` is used.
75
+ To build the package: `uv build` (rebuild the GUI first with `npm run build` in
76
+ `kpipeline_gui/frontend` if the frontend changed — the built `dist/` is what ships).
77
+
78
+ ## Quick start
79
+
80
+ ```bash
81
+ mkdir my_pipeline && cd my_pipeline
82
+ kpl init # creates graph_config.yaml, data/, cache/
83
+ kpl list # see available node types
84
+ kpl add <node_type> # add a node instance
85
+ kpl tree # inspect the graph
86
+ kpl run # run it (or: kpl gui to do all of this visually)
87
+ ```
88
+
89
+ ## Commands
90
+
91
+ | Command | Description |
92
+ |---|---|
93
+ | `kpl init` | Initialize a pipeline in the current directory |
94
+ | `kpl gui` | Launch the web GUI (port 8601+) |
95
+ | `kpl gui --mcp` | GUI + an MCP endpoint at `/mcp`, same port |
96
+ | `kpl mcp` | Headless MCP server only — no GUI/REST API |
97
+ | `kpl list` | List available node types |
98
+ | `kpl add <type> [name]` | Add a node instance to the graph |
99
+ | `kpl run [node]` | Run the declared outputs (or one node) + dependencies |
100
+ | `kpl run_debug [node]` | Same, with full log output |
101
+ | `kpl run --kwui` | Run behind a per-node web UI (kwebui) |
102
+ | `kpl tree` | Print the graph with dependencies and I/O |
103
+ | `kpl status` | Show cached/frozen state per node |
104
+ | `kpl clean [node]` | Clear cache (all nodes, or one) |
105
+ | `kpl kwui init` | Create `workflow.py` for kwui mode in this pipeline |
106
+ | `kpl base_node create` | Scaffold a new node type in the current directory |
107
+ | `kpl base_node install [--node_name N]` | Install the current directory as a node type |
108
+ | `kpl base_node uninstall <name>` | Remove an installed node type |
109
+ | `kpl node_env install [--node_type T]` | Install a node's Python environment |
110
+ | `kpl uninstall` | Remove kpl from your PATH |
111
+
112
+ Run any command with `--help` for its full option list.
113
+
114
+ ## Documentation
115
+
116
+ - **[User Guide](docs/wiki/User-Guide.md)** — the full walkthrough: CLI and
117
+ GUI workflows, groups, custom nodes, MCP, kwui mode, and the
118
+ `graph_config.yaml`/`node_config.yaml`/`config.yaml` reference.
119
+ - **[kpipeliner.md](kpipeliner.md)** — a self-contained agent guide for
120
+ building pipelines/nodes (also installed as a Claude Code skill).
121
+ - **[Readme](Readme)** — version history / changelog.
@@ -0,0 +1,97 @@
1
+ # kpipeliner
2
+
3
+ A node-based pipeline manager. A pipeline is a graph of nodes; each node is a
4
+ standalone Python program (its own subprocess, optionally its own
5
+ venv/conda/pixi environment) with typed inputs and outputs declared in YAML.
6
+ Build and run pipelines from the CLI (`kpl`), a visual web GUI, or hand them
7
+ over to an LLM through MCP.
8
+
9
+ ![kpipeliner GUI](docs/wiki/images/gui-overview.png)
10
+
11
+ ## Highlights
12
+
13
+ - **Graph = YAML.** Connections are just strings (`nodes.<name>.<output>`) —
14
+ no hidden edge list, easy to read, easy to script.
15
+ - **Subprocess isolation.** Every node runs on its own, with its own Python
16
+ environment if it needs one; a crash in one node never takes down another.
17
+ - **Caching by default.** Node outputs are cached per run-UUID; re-running a
18
+ pipeline only recomputes what actually changed.
19
+ - **CLI + GUI + MCP.** Script it, click through it in the browser, or connect
20
+ an MCP client and let an LLM design/inspect/run it for you.
21
+ - **Groups & reusable components.** Bundle nodes in the GUI and export them as
22
+ drag-and-drop components for other pipelines.
23
+
24
+ ## Install
25
+
26
+ kpipeliner is a normal Python package — installing it is the whole installation
27
+ (dependencies, the prebuilt web GUI and the `kpl` command; no Node.js, no installer
28
+ script). With [uv](https://docs.astral.sh/uv/):
29
+
30
+ ```bash
31
+ uv tool install kpipeliner # `kpl` ends up on your PATH
32
+ kpl --help
33
+ ```
34
+
35
+ or into an environment of your own: `uv pip install kpipeliner` (or `pip install kpipeliner`).
36
+
37
+ Optional extras — nothing imports them unless you use the feature, so leaving them out is fine:
38
+
39
+ ```bash
40
+ uv tool install "kpipeliner[mcp]" # `kpl mcp` / `kpl gui --mcp` (LLM client access)
41
+ uv tool install "kpipeliner[kwui]" # `kpl run --kwui` (a web UI per node)
42
+ uv tool install "kpipeliner[all]" # both
43
+ ```
44
+
45
+ Configuration lives in a `config.yaml` that ships with the package; the first run copies it
46
+ to `~/.config/kpipeliner/config.yaml` (or `$KPL_HOME/config.yaml`) so your edits survive
47
+ upgrades. `kpl config` prints its location.
48
+
49
+ **Developing kpipeliner itself:** clone the repository and run `uv pip install -e .` (or
50
+ `uv sync --all-extras`) — an editable install; the checkout's own `config.yaml` is used.
51
+ To build the package: `uv build` (rebuild the GUI first with `npm run build` in
52
+ `kpipeline_gui/frontend` if the frontend changed — the built `dist/` is what ships).
53
+
54
+ ## Quick start
55
+
56
+ ```bash
57
+ mkdir my_pipeline && cd my_pipeline
58
+ kpl init # creates graph_config.yaml, data/, cache/
59
+ kpl list # see available node types
60
+ kpl add <node_type> # add a node instance
61
+ kpl tree # inspect the graph
62
+ kpl run # run it (or: kpl gui to do all of this visually)
63
+ ```
64
+
65
+ ## Commands
66
+
67
+ | Command | Description |
68
+ |---|---|
69
+ | `kpl init` | Initialize a pipeline in the current directory |
70
+ | `kpl gui` | Launch the web GUI (port 8601+) |
71
+ | `kpl gui --mcp` | GUI + an MCP endpoint at `/mcp`, same port |
72
+ | `kpl mcp` | Headless MCP server only — no GUI/REST API |
73
+ | `kpl list` | List available node types |
74
+ | `kpl add <type> [name]` | Add a node instance to the graph |
75
+ | `kpl run [node]` | Run the declared outputs (or one node) + dependencies |
76
+ | `kpl run_debug [node]` | Same, with full log output |
77
+ | `kpl run --kwui` | Run behind a per-node web UI (kwebui) |
78
+ | `kpl tree` | Print the graph with dependencies and I/O |
79
+ | `kpl status` | Show cached/frozen state per node |
80
+ | `kpl clean [node]` | Clear cache (all nodes, or one) |
81
+ | `kpl kwui init` | Create `workflow.py` for kwui mode in this pipeline |
82
+ | `kpl base_node create` | Scaffold a new node type in the current directory |
83
+ | `kpl base_node install [--node_name N]` | Install the current directory as a node type |
84
+ | `kpl base_node uninstall <name>` | Remove an installed node type |
85
+ | `kpl node_env install [--node_type T]` | Install a node's Python environment |
86
+ | `kpl uninstall` | Remove kpl from your PATH |
87
+
88
+ Run any command with `--help` for its full option list.
89
+
90
+ ## Documentation
91
+
92
+ - **[User Guide](docs/wiki/User-Guide.md)** — the full walkthrough: CLI and
93
+ GUI workflows, groups, custom nodes, MCP, kwui mode, and the
94
+ `graph_config.yaml`/`node_config.yaml`/`config.yaml` reference.
95
+ - **[kpipeliner.md](kpipeliner.md)** — a self-contained agent guide for
96
+ building pipelines/nodes (also installed as a Claude Code skill).
97
+ - **[Readme](Readme)** — version history / changelog.
@@ -0,0 +1,12 @@
1
+ from kpipeline.src.kparameter import KParameter
2
+ from kpipeline.src.knode import KNode, NodeState
3
+ from kpipeline.src.kgraph import KGraph
4
+ from kpipeline.src.executor import PipelineExecutor
5
+
6
+ __all__ = ['KParameter', 'KNode', 'KGraph', 'NodeState', 'PipelineExecutor']
7
+
8
+ try:
9
+ from importlib.metadata import PackageNotFoundError, version as _version
10
+ __version__ = _version('kpipeliner')
11
+ except Exception: # not installed (plain checkout on sys.path)
12
+ __version__ = 'unknown'
@@ -0,0 +1,49 @@
1
+ # kpipeliner installation-wide configuration.
2
+ #
3
+ # This is the packaged DEFAULT. The first time kpl runs, it copies this file to your
4
+ # own config directory so your edits survive upgrades of the package:
5
+ # $KPL_HOME/config.yaml if the KPL_HOME environment variable is set, else
6
+ # ~/.config/kpipeliner/config.yaml
7
+ # Run `kpl config` to see the exact path. Relative paths below are relative to that
8
+ # directory; absolute paths and ~ are fine too. Delete a key to get its default back.
9
+
10
+ # Directory containing the base node types (the node library your pipelines use).
11
+ # Nodes are grouped in category subdirectories; a category starting with '_' is
12
+ # ignored; nodes directly in the root get the category 'no category'. A pipeline can
13
+ # opt out of / extend this via load_default_base_nodes_dir and custom_base_nodes_dirs
14
+ # in its graph_config.yaml. (Legacy key name: base_nodes)
15
+ default_base_nodes_dir: base_nodes
16
+
17
+ # Directory for groups exported from the GUI as reusable components. Components are
18
+ # stored as <group_base_nodes>/<category>/<name>.yaml and appear in the components
19
+ # panel under 'groups/<category>'.
20
+ group_base_nodes: group_base_nodes
21
+
22
+ # Whether a `nodes.X.Y` input reference is resolved lazily (the node's own process
23
+ # reads the cached value the first time its code touches self.inputs[name].value) or
24
+ # eagerly (kpl reads it up front and passes it on the command line). Note: either way
25
+ # the producing node is run first — lazy only postpones READING its result.
26
+ lazy_input_resolution: true
27
+
28
+ # Where `kpl run --kwui` / `kpl run_debug --kwui` serve workflow.py (needs the optional
29
+ # `kwui` extra: pip install "kpipeliner[kwui]").
30
+ # host: 0.0.0.0 listens on all interfaces, so the page is reachable from other machines
31
+ # on the network (kwebui has no authentication — use 127.0.0.1 to keep it on this
32
+ # machine).
33
+ # port: starting port; the first free one at or above it is used.
34
+ # open_browser: open a browser on this machine as soon as the server is up.
35
+ # Per-run overrides: --kwui-host / --kwui-port / --kwui-no-browser.
36
+ kwui:
37
+ host: 0.0.0.0
38
+ port: 8701
39
+ open_browser: true
40
+
41
+ # Appearance of the web GUI (`kpl gui`); the GUI itself also edits these.
42
+ gui:
43
+ background:
44
+ pattern: dots # dots, lines, cross, none
45
+ gap: 10
46
+ size: 1
47
+ color: '#2d3748'
48
+ snap:
49
+ enabled: true