koode-taskgraph 0.3.0__tar.gz → 0.3.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.
- koode_taskgraph-0.3.1/PKG-INFO +234 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/README.md +7 -1
- koode_taskgraph-0.3.1/koode_taskgraph.egg-info/PKG-INFO +234 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/pyproject.toml +2 -1
- koode_taskgraph-0.3.0/PKG-INFO +0 -9
- koode_taskgraph-0.3.0/koode_taskgraph.egg-info/PKG-INFO +0 -9
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/LICENSE +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/koode_taskgraph.egg-info/SOURCES.txt +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/koode_taskgraph.egg-info/dependency_links.txt +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/koode_taskgraph.egg-info/entry_points.txt +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/koode_taskgraph.egg-info/requires.txt +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/koode_taskgraph.egg-info/top_level.txt +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/setup.cfg +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/__init__.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/__main__.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/app.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/cli.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/core/__init__.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/core/executor.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/core/model.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/core/registry.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/core/serialization.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/nodes/__init__.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/nodes/builtin.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/__init__.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/items.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/main_window.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/plugins.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/properties.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/scene.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/taskgraph/ui/theme.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/tests/test_core.py +0 -0
- {koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/tests/test_gui_plugins.py +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: koode-taskgraph
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: An extensible process node graph built with QtPy and PySide6
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: PySide6>=6.7
|
|
9
|
+
Requires-Dist: QtPy>=2.4
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
<p align="left">
|
|
13
|
+
<a href="https://buymeacoffee.com/cgarjun">
|
|
14
|
+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="50" alt="Buy Me A Coffee">
|
|
15
|
+
</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
# Koode TaskGraph
|
|
19
|
+
|
|
20
|
+
TaskGraph is a small, extensible process graph editor built from scratch with
|
|
21
|
+
Python, QtPy, and PySide6.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## Run
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m venv .venv
|
|
29
|
+
source .venv/bin/activate
|
|
30
|
+
python -m pip install koode-taskgraph
|
|
31
|
+
koode-taskgraph
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For local development from this repository, use `python -m pip install -e .`.
|
|
35
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for pull request guidelines.
|
|
36
|
+
|
|
37
|
+
## Headless CLI
|
|
38
|
+
|
|
39
|
+
Execute a saved graph without starting Qt or opening a window:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
koode-taskgraph-cli --file /path/to/workflow.taskgraph
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Select the worker count and load external node locations when needed:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
koode-taskgraph-cli \
|
|
49
|
+
--file /path/to/workflow.taskgraph \
|
|
50
|
+
--workers 8 \
|
|
51
|
+
--node-path /path/to/custom_nodes
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`--node-path` may be repeated. `TASKGRAPH_NODE_PATH` is also supported with
|
|
55
|
+
the normal platform path separator. Use `--json` for structured results,
|
|
56
|
+
`--quiet` to hide progress messages, and `Ctrl+C` to cancel execution.
|
|
57
|
+
|
|
58
|
+
Exit codes are `0` for success, `1` for graph execution failure, `2` for
|
|
59
|
+
arguments/loading errors, and `130` for cancellation.
|
|
60
|
+
|
|
61
|
+
Double-click a node type in the left panel to add it. Drag from an output port
|
|
62
|
+
on the right of a node to an input port on the left of another node. Select a
|
|
63
|
+
node to edit its properties, then click **Run graph**.
|
|
64
|
+
|
|
65
|
+
## Add a node
|
|
66
|
+
|
|
67
|
+
Create a module in `taskgraph/nodes/` and define a `ProcessNode` subclass:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from taskgraph.core.model import NodeProperty, PortSpec, ProcessNode
|
|
71
|
+
from taskgraph.core.registry import register_node
|
|
72
|
+
|
|
73
|
+
@register_node
|
|
74
|
+
class PrefixText(ProcessNode):
|
|
75
|
+
type_id = "custom.prefix_text"
|
|
76
|
+
title = "Prefix Text"
|
|
77
|
+
category = "Custom"
|
|
78
|
+
inputs = (PortSpec("value", "any"),)
|
|
79
|
+
outputs = (PortSpec("text", "text"),)
|
|
80
|
+
properties = (
|
|
81
|
+
NodeProperty("prefix", "Prefix", "text", "Result: "),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def process(self, inputs):
|
|
85
|
+
return {"text": f"{self.prefix}{inputs.get('value', '')}"}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Property kinds map to generated controls in the Properties panel: `"text"` for
|
|
89
|
+
a line edit, `"file"` for a file path field with a Browse button, `"bool"` for
|
|
90
|
+
a checkbox, `"int"`/`"float"` for numeric fields, and `"choice"` for a
|
|
91
|
+
dropdown using `choices`.
|
|
92
|
+
|
|
93
|
+
Modules in `taskgraph/nodes/` are discovered automatically. Custom modules can
|
|
94
|
+
also live anywhere on disk:
|
|
95
|
+
|
|
96
|
+
1. Put one or more standalone `.py` node modules in a directory.
|
|
97
|
+
2. Select **Nodes → Add Custom Node Location…** and choose that directory.
|
|
98
|
+
3. Restarting TaskGraph reloads the saved location automatically.
|
|
99
|
+
|
|
100
|
+
Alternatively, set `TASKGRAPH_NODE_PATH` before launching. Separate multiple
|
|
101
|
+
directories with the platform path separator (`:` on macOS/Linux and `;` on
|
|
102
|
+
Windows):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
TASKGRAPH_NODE_PATH="/path/to/company_nodes:/path/to/my_nodes" koode-taskgraph
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Files beginning with `_` are ignored. Importing a custom node module executes
|
|
109
|
+
its Python code, so only add trusted directories. The editor, property panel,
|
|
110
|
+
serialization, and executor require no other changes.
|
|
111
|
+
|
|
112
|
+
## Add a GUI plugin
|
|
113
|
+
|
|
114
|
+
GUI plugins can add menus, actions, docks, and graph-building commands without
|
|
115
|
+
editing TaskGraph source. Put one or more `.py` files in a plugin directory and
|
|
116
|
+
define `register_taskgraph_plugin(api)`:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
def register_taskgraph_plugin(api):
|
|
120
|
+
def build_template_graph():
|
|
121
|
+
text = api.create_node(
|
|
122
|
+
"input.text",
|
|
123
|
+
name="Message",
|
|
124
|
+
values={"text": "hello world"},
|
|
125
|
+
position=(0, 0),
|
|
126
|
+
)
|
|
127
|
+
formatter = api.create_node(
|
|
128
|
+
"text.format",
|
|
129
|
+
name="Format Message",
|
|
130
|
+
values={"template": "Output: {value}"},
|
|
131
|
+
position=(280, 0),
|
|
132
|
+
)
|
|
133
|
+
printer = api.create_node(
|
|
134
|
+
"output.print",
|
|
135
|
+
name="Print Result",
|
|
136
|
+
position=(560, 0),
|
|
137
|
+
)
|
|
138
|
+
api.connect_dependency(text, formatter)
|
|
139
|
+
api.connect_attribute(text, "text", formatter, "value")
|
|
140
|
+
api.connect_dependency(formatter, printer)
|
|
141
|
+
api.connect_attribute(formatter, "text", printer, "value")
|
|
142
|
+
api.add_backdrop(
|
|
143
|
+
title="Template Notes",
|
|
144
|
+
note="This graph was created by a GUI plugin.",
|
|
145
|
+
position=(-40, -140),
|
|
146
|
+
size=(720, 180),
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
api.add_menu_action("Tools", "Build Template Graph", build_template_graph)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Load GUI plugins from **Plugins → Add GUI Plugin Location…**. Restarting
|
|
153
|
+
TaskGraph reloads saved plugin locations automatically. Alternatively, set
|
|
154
|
+
`TASKGRAPH_PLUGIN_PATH` before launching, using the same platform path
|
|
155
|
+
separator rules as `TASKGRAPH_NODE_PATH`.
|
|
156
|
+
|
|
157
|
+
This repository includes minimal example plugins in `examples/gui_plugins`.
|
|
158
|
+
Load that directory, then run **Examples → Create Hello World Print Graph** or
|
|
159
|
+
**Examples → Create Bingooo Print Graph**.
|
|
160
|
+
|
|
161
|
+
GUI plugins are intentionally separate from custom node locations. The
|
|
162
|
+
headless CLI loads `TASKGRAPH_NODE_PATH` only, so UI plugin code can safely
|
|
163
|
+
import Qt widgets without breaking `koode-taskgraph-cli`.
|
|
164
|
+
|
|
165
|
+
## Controls
|
|
166
|
+
|
|
167
|
+
- Standard commands are organized under the **File**, **Edit**, **Nodes**,
|
|
168
|
+
**Graph**, **Plugins**, and **View** menus.
|
|
169
|
+
- Drag a node from **Nodes** to the canvas, or double-click it.
|
|
170
|
+
- Every node has fixed gold **dependency** input/output ports. These control
|
|
171
|
+
process order but do not transfer values. Gold dependency connections show
|
|
172
|
+
an arrowhead pointing from the upstream node toward the downstream node.
|
|
173
|
+
- Declared node inputs and outputs are attribute ports. Attribute connections
|
|
174
|
+
transfer values, but execution order comes only from dependency connections.
|
|
175
|
+
An attribute connection therefore needs a dependency path from its source
|
|
176
|
+
node to its target node.
|
|
177
|
+
- Dependency ports connect only to dependency ports; compatible attribute
|
|
178
|
+
ports connect only to attribute ports.
|
|
179
|
+
- Select one or more nodes on the canvas and press **D** to toggle them
|
|
180
|
+
disabled. Disabled nodes stay in the dependency chain but their process
|
|
181
|
+
functions are skipped. The same command is available from **Edit**.
|
|
182
|
+
- **Copy Nodes** and **Paste Nodes** under **Edit** use the standard platform
|
|
183
|
+
shortcuts. Properties, disabled state, relative positions, and connections
|
|
184
|
+
entirely inside the copied selection are preserved.
|
|
185
|
+
- Select a node to edit generated property controls.
|
|
186
|
+
- Use **Node Name** at the top of the Properties panel to give each node
|
|
187
|
+
instance a descriptive name. Custom names appear in node headers and
|
|
188
|
+
execution messages and are preserved when saving or copying nodes.
|
|
189
|
+
- Select nodes or connections and press **Backspace** or **Delete** to remove
|
|
190
|
+
them. **Edit → Delete Selected** works on every platform too.
|
|
191
|
+
- Middle-drag pans, the mouse wheel zooms, and **F** frames the graph.
|
|
192
|
+
- **Shift+A** or **Graph → Auto Arrange Nodes** lays out dependency layers
|
|
193
|
+
from left to right and parallel nodes vertically, then frames the result.
|
|
194
|
+
- **Graph → Add Backdrop** creates a movable notes region behind the graph.
|
|
195
|
+
Select it to edit its title, notes, color, width, and height in Properties.
|
|
196
|
+
Drag the grip in its bottom-right corner to resize it interactively.
|
|
197
|
+
Backdrops are stored in `.taskgraph` files.
|
|
198
|
+
- **Ctrl+R** executes nodes in dependency order.
|
|
199
|
+
- Independent dependency branches execute concurrently. Choose between one
|
|
200
|
+
worker or any even worker count from 2 through 32 under
|
|
201
|
+
**Graph → Worker Count**; the setting is remembered.
|
|
202
|
+
- Use **Graph → Cancel Execution** or **Esc** to cancel the complete run.
|
|
203
|
+
Pending nodes are cancelled immediately. Running nodes receive a cooperative
|
|
204
|
+
cancellation signal, and built-in command nodes terminate their subprocess
|
|
205
|
+
groups promptly.
|
|
206
|
+
- Clear displayed execution messages with **Graph → Clear Execution Log** or
|
|
207
|
+
from the Execution panel's right-click menu.
|
|
208
|
+
- Built-in nodes are organized as **System → Run Command/Print**,
|
|
209
|
+
**Utils → Format Text**, and **Inputs → Text/Number**.
|
|
210
|
+
- The built-in **System → Run Command** node executes a command and exposes
|
|
211
|
+
stdout, stderr, and return code outputs. It supports an optional working
|
|
212
|
+
directory, shell mode, timeout, and failure on non-zero exit. Shell mode
|
|
213
|
+
executes exactly what the graph author enters, so only run trusted graphs.
|
|
214
|
+
- Node headers show live execution state: amber while running, green when
|
|
215
|
+
finished, red on failure, gray when a disabled node is skipped, and muted
|
|
216
|
+
red when a node is blocked by an upstream failure. Cancelled nodes use a
|
|
217
|
+
purple-gray state.
|
|
218
|
+
Execution coordination runs outside the GUI thread so the final running
|
|
219
|
+
node and parallel running nodes remain visible while work is in progress.
|
|
220
|
+
- A failed node blocks only its downstream dependency branch. Independent
|
|
221
|
+
parallel branches continue running and report their own final states.
|
|
222
|
+
- Closed panels can be restored from **View → Nodes/Properties/Execution**.
|
|
223
|
+
Use **View → Show All Panels** to restore everything at once.
|
|
224
|
+
|
|
225
|
+
Graph files use readable JSON with the `.taskgraph` extension.
|
|
226
|
+
|
|
227
|
+
## Architecture
|
|
228
|
+
|
|
229
|
+
- `core/model.py`: node contract—including inherited dependency port
|
|
230
|
+
specifications—and serializable graph model
|
|
231
|
+
- `core/registry.py`: decorator-based built-in and external node discovery
|
|
232
|
+
- `core/executor.py`: validation and dependency-ordered execution
|
|
233
|
+
- `ui/`: graphics editor, node items, property editor, and main window
|
|
234
|
+
- `nodes/`: built-in examples and the extension point for new processes
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="https://buymeacoffee.com/cgarjun">
|
|
3
|
+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="50" alt="Buy Me A Coffee">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# Koode TaskGraph
|
|
2
8
|
|
|
3
9
|
TaskGraph is a small, extensible process graph editor built from scratch with
|
|
4
10
|
Python, QtPy, and PySide6.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: koode-taskgraph
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: An extensible process node graph built with QtPy and PySide6
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: PySide6>=6.7
|
|
9
|
+
Requires-Dist: QtPy>=2.4
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
<p align="left">
|
|
13
|
+
<a href="https://buymeacoffee.com/cgarjun">
|
|
14
|
+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="50" alt="Buy Me A Coffee">
|
|
15
|
+
</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
# Koode TaskGraph
|
|
19
|
+
|
|
20
|
+
TaskGraph is a small, extensible process graph editor built from scratch with
|
|
21
|
+
Python, QtPy, and PySide6.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## Run
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m venv .venv
|
|
29
|
+
source .venv/bin/activate
|
|
30
|
+
python -m pip install koode-taskgraph
|
|
31
|
+
koode-taskgraph
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For local development from this repository, use `python -m pip install -e .`.
|
|
35
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for pull request guidelines.
|
|
36
|
+
|
|
37
|
+
## Headless CLI
|
|
38
|
+
|
|
39
|
+
Execute a saved graph without starting Qt or opening a window:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
koode-taskgraph-cli --file /path/to/workflow.taskgraph
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Select the worker count and load external node locations when needed:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
koode-taskgraph-cli \
|
|
49
|
+
--file /path/to/workflow.taskgraph \
|
|
50
|
+
--workers 8 \
|
|
51
|
+
--node-path /path/to/custom_nodes
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`--node-path` may be repeated. `TASKGRAPH_NODE_PATH` is also supported with
|
|
55
|
+
the normal platform path separator. Use `--json` for structured results,
|
|
56
|
+
`--quiet` to hide progress messages, and `Ctrl+C` to cancel execution.
|
|
57
|
+
|
|
58
|
+
Exit codes are `0` for success, `1` for graph execution failure, `2` for
|
|
59
|
+
arguments/loading errors, and `130` for cancellation.
|
|
60
|
+
|
|
61
|
+
Double-click a node type in the left panel to add it. Drag from an output port
|
|
62
|
+
on the right of a node to an input port on the left of another node. Select a
|
|
63
|
+
node to edit its properties, then click **Run graph**.
|
|
64
|
+
|
|
65
|
+
## Add a node
|
|
66
|
+
|
|
67
|
+
Create a module in `taskgraph/nodes/` and define a `ProcessNode` subclass:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from taskgraph.core.model import NodeProperty, PortSpec, ProcessNode
|
|
71
|
+
from taskgraph.core.registry import register_node
|
|
72
|
+
|
|
73
|
+
@register_node
|
|
74
|
+
class PrefixText(ProcessNode):
|
|
75
|
+
type_id = "custom.prefix_text"
|
|
76
|
+
title = "Prefix Text"
|
|
77
|
+
category = "Custom"
|
|
78
|
+
inputs = (PortSpec("value", "any"),)
|
|
79
|
+
outputs = (PortSpec("text", "text"),)
|
|
80
|
+
properties = (
|
|
81
|
+
NodeProperty("prefix", "Prefix", "text", "Result: "),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def process(self, inputs):
|
|
85
|
+
return {"text": f"{self.prefix}{inputs.get('value', '')}"}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Property kinds map to generated controls in the Properties panel: `"text"` for
|
|
89
|
+
a line edit, `"file"` for a file path field with a Browse button, `"bool"` for
|
|
90
|
+
a checkbox, `"int"`/`"float"` for numeric fields, and `"choice"` for a
|
|
91
|
+
dropdown using `choices`.
|
|
92
|
+
|
|
93
|
+
Modules in `taskgraph/nodes/` are discovered automatically. Custom modules can
|
|
94
|
+
also live anywhere on disk:
|
|
95
|
+
|
|
96
|
+
1. Put one or more standalone `.py` node modules in a directory.
|
|
97
|
+
2. Select **Nodes → Add Custom Node Location…** and choose that directory.
|
|
98
|
+
3. Restarting TaskGraph reloads the saved location automatically.
|
|
99
|
+
|
|
100
|
+
Alternatively, set `TASKGRAPH_NODE_PATH` before launching. Separate multiple
|
|
101
|
+
directories with the platform path separator (`:` on macOS/Linux and `;` on
|
|
102
|
+
Windows):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
TASKGRAPH_NODE_PATH="/path/to/company_nodes:/path/to/my_nodes" koode-taskgraph
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Files beginning with `_` are ignored. Importing a custom node module executes
|
|
109
|
+
its Python code, so only add trusted directories. The editor, property panel,
|
|
110
|
+
serialization, and executor require no other changes.
|
|
111
|
+
|
|
112
|
+
## Add a GUI plugin
|
|
113
|
+
|
|
114
|
+
GUI plugins can add menus, actions, docks, and graph-building commands without
|
|
115
|
+
editing TaskGraph source. Put one or more `.py` files in a plugin directory and
|
|
116
|
+
define `register_taskgraph_plugin(api)`:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
def register_taskgraph_plugin(api):
|
|
120
|
+
def build_template_graph():
|
|
121
|
+
text = api.create_node(
|
|
122
|
+
"input.text",
|
|
123
|
+
name="Message",
|
|
124
|
+
values={"text": "hello world"},
|
|
125
|
+
position=(0, 0),
|
|
126
|
+
)
|
|
127
|
+
formatter = api.create_node(
|
|
128
|
+
"text.format",
|
|
129
|
+
name="Format Message",
|
|
130
|
+
values={"template": "Output: {value}"},
|
|
131
|
+
position=(280, 0),
|
|
132
|
+
)
|
|
133
|
+
printer = api.create_node(
|
|
134
|
+
"output.print",
|
|
135
|
+
name="Print Result",
|
|
136
|
+
position=(560, 0),
|
|
137
|
+
)
|
|
138
|
+
api.connect_dependency(text, formatter)
|
|
139
|
+
api.connect_attribute(text, "text", formatter, "value")
|
|
140
|
+
api.connect_dependency(formatter, printer)
|
|
141
|
+
api.connect_attribute(formatter, "text", printer, "value")
|
|
142
|
+
api.add_backdrop(
|
|
143
|
+
title="Template Notes",
|
|
144
|
+
note="This graph was created by a GUI plugin.",
|
|
145
|
+
position=(-40, -140),
|
|
146
|
+
size=(720, 180),
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
api.add_menu_action("Tools", "Build Template Graph", build_template_graph)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Load GUI plugins from **Plugins → Add GUI Plugin Location…**. Restarting
|
|
153
|
+
TaskGraph reloads saved plugin locations automatically. Alternatively, set
|
|
154
|
+
`TASKGRAPH_PLUGIN_PATH` before launching, using the same platform path
|
|
155
|
+
separator rules as `TASKGRAPH_NODE_PATH`.
|
|
156
|
+
|
|
157
|
+
This repository includes minimal example plugins in `examples/gui_plugins`.
|
|
158
|
+
Load that directory, then run **Examples → Create Hello World Print Graph** or
|
|
159
|
+
**Examples → Create Bingooo Print Graph**.
|
|
160
|
+
|
|
161
|
+
GUI plugins are intentionally separate from custom node locations. The
|
|
162
|
+
headless CLI loads `TASKGRAPH_NODE_PATH` only, so UI plugin code can safely
|
|
163
|
+
import Qt widgets without breaking `koode-taskgraph-cli`.
|
|
164
|
+
|
|
165
|
+
## Controls
|
|
166
|
+
|
|
167
|
+
- Standard commands are organized under the **File**, **Edit**, **Nodes**,
|
|
168
|
+
**Graph**, **Plugins**, and **View** menus.
|
|
169
|
+
- Drag a node from **Nodes** to the canvas, or double-click it.
|
|
170
|
+
- Every node has fixed gold **dependency** input/output ports. These control
|
|
171
|
+
process order but do not transfer values. Gold dependency connections show
|
|
172
|
+
an arrowhead pointing from the upstream node toward the downstream node.
|
|
173
|
+
- Declared node inputs and outputs are attribute ports. Attribute connections
|
|
174
|
+
transfer values, but execution order comes only from dependency connections.
|
|
175
|
+
An attribute connection therefore needs a dependency path from its source
|
|
176
|
+
node to its target node.
|
|
177
|
+
- Dependency ports connect only to dependency ports; compatible attribute
|
|
178
|
+
ports connect only to attribute ports.
|
|
179
|
+
- Select one or more nodes on the canvas and press **D** to toggle them
|
|
180
|
+
disabled. Disabled nodes stay in the dependency chain but their process
|
|
181
|
+
functions are skipped. The same command is available from **Edit**.
|
|
182
|
+
- **Copy Nodes** and **Paste Nodes** under **Edit** use the standard platform
|
|
183
|
+
shortcuts. Properties, disabled state, relative positions, and connections
|
|
184
|
+
entirely inside the copied selection are preserved.
|
|
185
|
+
- Select a node to edit generated property controls.
|
|
186
|
+
- Use **Node Name** at the top of the Properties panel to give each node
|
|
187
|
+
instance a descriptive name. Custom names appear in node headers and
|
|
188
|
+
execution messages and are preserved when saving or copying nodes.
|
|
189
|
+
- Select nodes or connections and press **Backspace** or **Delete** to remove
|
|
190
|
+
them. **Edit → Delete Selected** works on every platform too.
|
|
191
|
+
- Middle-drag pans, the mouse wheel zooms, and **F** frames the graph.
|
|
192
|
+
- **Shift+A** or **Graph → Auto Arrange Nodes** lays out dependency layers
|
|
193
|
+
from left to right and parallel nodes vertically, then frames the result.
|
|
194
|
+
- **Graph → Add Backdrop** creates a movable notes region behind the graph.
|
|
195
|
+
Select it to edit its title, notes, color, width, and height in Properties.
|
|
196
|
+
Drag the grip in its bottom-right corner to resize it interactively.
|
|
197
|
+
Backdrops are stored in `.taskgraph` files.
|
|
198
|
+
- **Ctrl+R** executes nodes in dependency order.
|
|
199
|
+
- Independent dependency branches execute concurrently. Choose between one
|
|
200
|
+
worker or any even worker count from 2 through 32 under
|
|
201
|
+
**Graph → Worker Count**; the setting is remembered.
|
|
202
|
+
- Use **Graph → Cancel Execution** or **Esc** to cancel the complete run.
|
|
203
|
+
Pending nodes are cancelled immediately. Running nodes receive a cooperative
|
|
204
|
+
cancellation signal, and built-in command nodes terminate their subprocess
|
|
205
|
+
groups promptly.
|
|
206
|
+
- Clear displayed execution messages with **Graph → Clear Execution Log** or
|
|
207
|
+
from the Execution panel's right-click menu.
|
|
208
|
+
- Built-in nodes are organized as **System → Run Command/Print**,
|
|
209
|
+
**Utils → Format Text**, and **Inputs → Text/Number**.
|
|
210
|
+
- The built-in **System → Run Command** node executes a command and exposes
|
|
211
|
+
stdout, stderr, and return code outputs. It supports an optional working
|
|
212
|
+
directory, shell mode, timeout, and failure on non-zero exit. Shell mode
|
|
213
|
+
executes exactly what the graph author enters, so only run trusted graphs.
|
|
214
|
+
- Node headers show live execution state: amber while running, green when
|
|
215
|
+
finished, red on failure, gray when a disabled node is skipped, and muted
|
|
216
|
+
red when a node is blocked by an upstream failure. Cancelled nodes use a
|
|
217
|
+
purple-gray state.
|
|
218
|
+
Execution coordination runs outside the GUI thread so the final running
|
|
219
|
+
node and parallel running nodes remain visible while work is in progress.
|
|
220
|
+
- A failed node blocks only its downstream dependency branch. Independent
|
|
221
|
+
parallel branches continue running and report their own final states.
|
|
222
|
+
- Closed panels can be restored from **View → Nodes/Properties/Execution**.
|
|
223
|
+
Use **View → Show All Panels** to restore everything at once.
|
|
224
|
+
|
|
225
|
+
Graph files use readable JSON with the `.taskgraph` extension.
|
|
226
|
+
|
|
227
|
+
## Architecture
|
|
228
|
+
|
|
229
|
+
- `core/model.py`: node contract—including inherited dependency port
|
|
230
|
+
specifications—and serializable graph model
|
|
231
|
+
- `core/registry.py`: decorator-based built-in and external node discovery
|
|
232
|
+
- `core/executor.py`: validation and dependency-ordered execution
|
|
233
|
+
- `ui/`: graphics editor, node items, property editor, and main window
|
|
234
|
+
- `nodes/`: built-in examples and the extension point for new processes
|
|
@@ -4,7 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "koode-taskgraph"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
|
+
readme = "README.md"
|
|
8
9
|
description = "An extensible process node graph built with QtPy and PySide6"
|
|
9
10
|
requires-python = ">=3.10"
|
|
10
11
|
dependencies = [
|
koode_taskgraph-0.3.0/PKG-INFO
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: koode-taskgraph
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: An extensible process node graph built with QtPy and PySide6
|
|
5
|
-
Requires-Python: >=3.10
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Requires-Dist: PySide6>=6.7
|
|
8
|
-
Requires-Dist: QtPy>=2.4
|
|
9
|
-
Dynamic: license-file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: koode-taskgraph
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: An extensible process node graph built with QtPy and PySide6
|
|
5
|
-
Requires-Python: >=3.10
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Requires-Dist: PySide6>=6.7
|
|
8
|
-
Requires-Dist: QtPy>=2.4
|
|
9
|
-
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
{koode_taskgraph-0.3.0 → koode_taskgraph-0.3.1}/koode_taskgraph.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|