tdfw 0.1.0__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.
- tdfw-0.1.0/LICENSE +21 -0
- tdfw-0.1.0/PKG-INFO +41 -0
- tdfw-0.1.0/README.md +26 -0
- tdfw-0.1.0/pyproject.toml +41 -0
- tdfw-0.1.0/setup.cfg +4 -0
- tdfw-0.1.0/tdfw/__init__.py +0 -0
- tdfw-0.1.0/tdfw/cli.py +62 -0
- tdfw-0.1.0/tdfw.egg-info/PKG-INFO +41 -0
- tdfw-0.1.0/tdfw.egg-info/SOURCES.txt +12 -0
- tdfw-0.1.0/tdfw.egg-info/dependency_links.txt +1 -0
- tdfw-0.1.0/tdfw.egg-info/entry_points.txt +2 -0
- tdfw-0.1.0/tdfw.egg-info/requires.txt +1 -0
- tdfw-0.1.0/tdfw.egg-info/top_level.txt +1 -0
- tdfw-0.1.0/tests/test_cli.py +53 -0
tdfw-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MichaelKramerGuitar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tdfw-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tdfw
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: TouchDesigner Framework CLI scaffold tool for opinionated State Driven Command and Control/Code Driven project architecture
|
|
5
|
+
Author-email: Michael Kramer <michael.kramer.guitar@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/MichaelKramerGuitar/tdfw
|
|
8
|
+
Project-URL: Repository, https://github.com/MichaelKramerGuitar/tdfw
|
|
9
|
+
Project-URL: Issues, https://github.com/MichaelKramerGuitar/tdfw/issues
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: click
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
 [](./LICENSE)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# tdfw
|
|
20
|
+
TouchDesigner Framework CLI scaffold tool with an opinionated slant towards State Driven/Code Driven project architecture.
|
|
21
|
+
|
|
22
|
+
## About
|
|
23
|
+
|
|
24
|
+
Hi, I'm Michael. I play guitar and write code. I was introduced to TouchDesigner by my friend Andrew Zolty, who's also known as `BREAKFAST`. He's an incredible kinetic artist.
|
|
25
|
+
|
|
26
|
+
Getting started with TouchDesigner as a GUI never really happened for me. I started a few YouTube courses on it but didn't have the time to follow through and learn how to use the interface.
|
|
27
|
+
|
|
28
|
+
But the concept of a network of nodes and subnodes made sense to my programmer/software engineer brain. I thought "there must be a purely code driven way to architect these TouchDesinger apps". So I looked on YouTube and found [this](https://www.youtube.com/watch?v=nQT7EhYCVg0) video (read more about that in [BACKGROUND.md](./BACKGROUND.md)). I was thrilled and what has resulted is essentially this tool which abstracts out all the boilerplate he gives.
|
|
29
|
+
|
|
30
|
+
# How To Use
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Install
|
|
34
|
+
uv pip install tdfw
|
|
35
|
+
|
|
36
|
+
# Start a TouchDesigner App
|
|
37
|
+
tdfw start-app <MyFirstApp>
|
|
38
|
+
|
|
39
|
+
# Create a Python Extension stub (from your TouchDesigner Project Root i.e. the dir with the <MyFirstApp>.toe file)
|
|
40
|
+
tdfw create-ext <MyFirstExt>
|
|
41
|
+
```
|
tdfw-0.1.0/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
 [](./LICENSE)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# tdfw
|
|
5
|
+
TouchDesigner Framework CLI scaffold tool with an opinionated slant towards State Driven/Code Driven project architecture.
|
|
6
|
+
|
|
7
|
+
## About
|
|
8
|
+
|
|
9
|
+
Hi, I'm Michael. I play guitar and write code. I was introduced to TouchDesigner by my friend Andrew Zolty, who's also known as `BREAKFAST`. He's an incredible kinetic artist.
|
|
10
|
+
|
|
11
|
+
Getting started with TouchDesigner as a GUI never really happened for me. I started a few YouTube courses on it but didn't have the time to follow through and learn how to use the interface.
|
|
12
|
+
|
|
13
|
+
But the concept of a network of nodes and subnodes made sense to my programmer/software engineer brain. I thought "there must be a purely code driven way to architect these TouchDesinger apps". So I looked on YouTube and found [this](https://www.youtube.com/watch?v=nQT7EhYCVg0) video (read more about that in [BACKGROUND.md](./BACKGROUND.md)). I was thrilled and what has resulted is essentially this tool which abstracts out all the boilerplate he gives.
|
|
14
|
+
|
|
15
|
+
# How To Use
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install
|
|
19
|
+
uv pip install tdfw
|
|
20
|
+
|
|
21
|
+
# Start a TouchDesigner App
|
|
22
|
+
tdfw start-app <MyFirstApp>
|
|
23
|
+
|
|
24
|
+
# Create a Python Extension stub (from your TouchDesigner Project Root i.e. the dir with the <MyFirstApp>.toe file)
|
|
25
|
+
tdfw create-ext <MyFirstExt>
|
|
26
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tdfw"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "TouchDesigner Framework CLI scaffold tool for opinionated State Driven Command and Control/Code Driven project architecture"
|
|
5
|
+
authors = [{ name = "Michael Kramer", email = "michael.kramer.guitar@gmail.com" }]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
requires-python = ">=3.9"
|
|
9
|
+
dependencies = ["click"]
|
|
10
|
+
|
|
11
|
+
[dependency-groups]
|
|
12
|
+
dev = ["pytest", "pytest-cov", "twine"]
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Homepage = "https://github.com/MichaelKramerGuitar/tdfw"
|
|
16
|
+
Repository = "https://github.com/MichaelKramerGuitar/tdfw"
|
|
17
|
+
Issues = "https://github.com/MichaelKramerGuitar/tdfw/issues"
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
tdfw = "tdfw.cli:cli"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools]
|
|
23
|
+
packages = ["tdfw"]
|
|
24
|
+
|
|
25
|
+
[tool.uv]
|
|
26
|
+
default-groups = ["dev"]
|
|
27
|
+
|
|
28
|
+
[tool.pytest.ini_options]
|
|
29
|
+
addopts = "--cov=tdfw --cov-report=xml --cov-report=term-missing"
|
|
30
|
+
|
|
31
|
+
[tool.coverage.run]
|
|
32
|
+
branch = true
|
|
33
|
+
omit = [
|
|
34
|
+
"*/__init__.py",
|
|
35
|
+
"tests/*"
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[tool.coverage.report]
|
|
39
|
+
show_missing = true
|
|
40
|
+
skip_covered = true
|
|
41
|
+
|
tdfw-0.1.0/setup.cfg
ADDED
|
File without changes
|
tdfw-0.1.0/tdfw/cli.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import click
|
|
3
|
+
|
|
4
|
+
def ensure_dir(path):
|
|
5
|
+
if not os.path.exists(path):
|
|
6
|
+
os.makedirs(path)
|
|
7
|
+
|
|
8
|
+
@click.group()
|
|
9
|
+
def cli():
|
|
10
|
+
"""TouchDesigner Framework CLI (tdfw)"""
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
@click.command()
|
|
14
|
+
@click.argument("app_name")
|
|
15
|
+
def start_app(app_name):
|
|
16
|
+
"""Scaffold a new TouchDesigner app"""
|
|
17
|
+
base = os.path.abspath(app_name)
|
|
18
|
+
ensure_dir(base)
|
|
19
|
+
|
|
20
|
+
for folder in ["BAT", "DAT", "LOG"]:
|
|
21
|
+
ensure_dir(os.path.join(base, folder))
|
|
22
|
+
|
|
23
|
+
with open(os.path.join(base, "README.md"), "w") as f:
|
|
24
|
+
f.write(f"# {app_name}\nGenerated by tdfw\n")
|
|
25
|
+
|
|
26
|
+
with open(os.path.join(base, ".gitignore"), "w") as f:
|
|
27
|
+
f.write("*.toe\n*.log\n")
|
|
28
|
+
|
|
29
|
+
bat_path = os.path.join(base, "BAT", f"{os.path.basename(app_name)}.bat")
|
|
30
|
+
|
|
31
|
+
with open(bat_path, "w") as f:
|
|
32
|
+
f.write(f"""@echo off
|
|
33
|
+
set NODE=DEV
|
|
34
|
+
start "" "C:\\Program Files\\Derivative\\TouchDesigner\\bin\\TouchDesigner.exe" "{app_name}.toe"
|
|
35
|
+
""")
|
|
36
|
+
|
|
37
|
+
for ext in ["StartupExt", "SettingsExt", "StateExt"]:
|
|
38
|
+
ext_path = os.path.join(base, "DAT", f"{ext}.py")
|
|
39
|
+
with open(ext_path, "w") as f:
|
|
40
|
+
f.write(f"class {ext}:\n def __init__(self, ownerComp):\n self.ownerComp = ownerComp\n")
|
|
41
|
+
|
|
42
|
+
click.echo(f"✅ Created TouchDesigner app scaffold at {base}")
|
|
43
|
+
|
|
44
|
+
@click.command()
|
|
45
|
+
@click.argument("ext_name")
|
|
46
|
+
def create_ext(ext_name):
|
|
47
|
+
"""Create a new extension stub"""
|
|
48
|
+
path = os.path.join("DAT", f"{ext_name}.py")
|
|
49
|
+
if not os.path.exists("DAT"):
|
|
50
|
+
click.echo("❌ No DAT directory found. Run start-app first.")
|
|
51
|
+
return
|
|
52
|
+
|
|
53
|
+
with open(path, "w") as f:
|
|
54
|
+
f.write(f"""class {ext_name}:
|
|
55
|
+
\"\"\"{ext_name} description\"\"\"
|
|
56
|
+
def __init__(self, ownerComp):
|
|
57
|
+
self.ownerComp = ownerComp
|
|
58
|
+
""")
|
|
59
|
+
click.echo(f"✅ Created extension stub: {path}")
|
|
60
|
+
|
|
61
|
+
cli.add_command(start_app)
|
|
62
|
+
cli.add_command(create_ext)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tdfw
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: TouchDesigner Framework CLI scaffold tool for opinionated State Driven Command and Control/Code Driven project architecture
|
|
5
|
+
Author-email: Michael Kramer <michael.kramer.guitar@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/MichaelKramerGuitar/tdfw
|
|
8
|
+
Project-URL: Repository, https://github.com/MichaelKramerGuitar/tdfw
|
|
9
|
+
Project-URL: Issues, https://github.com/MichaelKramerGuitar/tdfw/issues
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: click
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
 [](./LICENSE)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# tdfw
|
|
20
|
+
TouchDesigner Framework CLI scaffold tool with an opinionated slant towards State Driven/Code Driven project architecture.
|
|
21
|
+
|
|
22
|
+
## About
|
|
23
|
+
|
|
24
|
+
Hi, I'm Michael. I play guitar and write code. I was introduced to TouchDesigner by my friend Andrew Zolty, who's also known as `BREAKFAST`. He's an incredible kinetic artist.
|
|
25
|
+
|
|
26
|
+
Getting started with TouchDesigner as a GUI never really happened for me. I started a few YouTube courses on it but didn't have the time to follow through and learn how to use the interface.
|
|
27
|
+
|
|
28
|
+
But the concept of a network of nodes and subnodes made sense to my programmer/software engineer brain. I thought "there must be a purely code driven way to architect these TouchDesinger apps". So I looked on YouTube and found [this](https://www.youtube.com/watch?v=nQT7EhYCVg0) video (read more about that in [BACKGROUND.md](./BACKGROUND.md)). I was thrilled and what has resulted is essentially this tool which abstracts out all the boilerplate he gives.
|
|
29
|
+
|
|
30
|
+
# How To Use
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Install
|
|
34
|
+
uv pip install tdfw
|
|
35
|
+
|
|
36
|
+
# Start a TouchDesigner App
|
|
37
|
+
tdfw start-app <MyFirstApp>
|
|
38
|
+
|
|
39
|
+
# Create a Python Extension stub (from your TouchDesigner Project Root i.e. the dir with the <MyFirstApp>.toe file)
|
|
40
|
+
tdfw create-ext <MyFirstExt>
|
|
41
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
tdfw/__init__.py
|
|
5
|
+
tdfw/cli.py
|
|
6
|
+
tdfw.egg-info/PKG-INFO
|
|
7
|
+
tdfw.egg-info/SOURCES.txt
|
|
8
|
+
tdfw.egg-info/dependency_links.txt
|
|
9
|
+
tdfw.egg-info/entry_points.txt
|
|
10
|
+
tdfw.egg-info/requires.txt
|
|
11
|
+
tdfw.egg-info/top_level.txt
|
|
12
|
+
tests/test_cli.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
click
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tdfw
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# tests/test_cli.py
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
import pytest
|
|
5
|
+
from click.testing import CliRunner
|
|
6
|
+
from tdfw import cli
|
|
7
|
+
|
|
8
|
+
@pytest.fixture
|
|
9
|
+
def runner():
|
|
10
|
+
return CliRunner()
|
|
11
|
+
|
|
12
|
+
@pytest.fixture
|
|
13
|
+
def temp_app(tmp_path):
|
|
14
|
+
"""Create a temporary app directory for testing."""
|
|
15
|
+
app_dir = tmp_path / "MyTestApp"
|
|
16
|
+
yield app_dir
|
|
17
|
+
if app_dir.exists():
|
|
18
|
+
shutil.rmtree(app_dir)
|
|
19
|
+
|
|
20
|
+
def test_start_app_creates_structure(runner, temp_app):
|
|
21
|
+
result = runner.invoke(cli.start_app, [str(temp_app)])
|
|
22
|
+
assert result.exit_code == 0
|
|
23
|
+
assert (temp_app / "BAT").exists()
|
|
24
|
+
assert (temp_app / "DAT").exists()
|
|
25
|
+
assert (temp_app / "LOG").exists()
|
|
26
|
+
assert (temp_app / "README.md").exists()
|
|
27
|
+
assert (temp_app / ".gitignore").exists()
|
|
28
|
+
assert (temp_app / "BAT" / "MyTestApp.bat").exists()
|
|
29
|
+
for ext in ["StartupExt.py", "SettingsExt.py", "StateExt.py"]:
|
|
30
|
+
assert (temp_app / "DAT" / ext).exists()
|
|
31
|
+
|
|
32
|
+
def test_start_app_echo_message(runner, temp_app):
|
|
33
|
+
result = runner.invoke(cli.start_app, [str(temp_app)])
|
|
34
|
+
assert "✅ Created TouchDesigner app scaffold" in result.output
|
|
35
|
+
|
|
36
|
+
def test_create_ext_adds_file(runner, temp_app):
|
|
37
|
+
# First scaffold the app
|
|
38
|
+
runner.invoke(cli.start_app, [str(temp_app)])
|
|
39
|
+
cwd = os.getcwd()
|
|
40
|
+
os.chdir(temp_app)
|
|
41
|
+
result = runner.invoke(cli.create_ext, ["CameraExt"])
|
|
42
|
+
os.chdir(cwd)
|
|
43
|
+
assert result.exit_code == 0
|
|
44
|
+
ext_file = temp_app / "DAT" / "CameraExt.py"
|
|
45
|
+
assert ext_file.exists()
|
|
46
|
+
content = ext_file.read_text()
|
|
47
|
+
assert "class CameraExt" in content
|
|
48
|
+
|
|
49
|
+
def test_create_ext_without_dat(runner, tmp_path):
|
|
50
|
+
os.chdir(tmp_path)
|
|
51
|
+
result = runner.invoke(cli.create_ext, ["FooExt"])
|
|
52
|
+
assert result.exit_code == 0
|
|
53
|
+
assert "❌ No DAT directory found" in result.output
|