Initial DumasNodes seed

This commit is contained in:
2026-07-21 10:43:24 +00:00
commit aa0fe4fa3d
7 changed files with 137 additions and 0 deletions

32
dumas_json_nodes.py Normal file
View File

@@ -0,0 +1,32 @@
import json
class DumasJSONStringToObjectNode:
CATEGORY = "Dumas/JSON"
RETURN_TYPES = ("JSON",)
FUNCTION = "convert_string_to_json"
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"json_string": ("STRING", {"multiline": True}),
}
}
def convert_string_to_json(self, json_string):
try:
json_object = json.loads(json_string)
return (json_object,)
except json.JSONDecodeError as exc:
print(f"[DumasNodes] Error decoding JSON: {exc}")
return (None,)
NODE_CLASS_MAPPINGS = {
"DumasJSONStringToObject": DumasJSONStringToObjectNode,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"DumasJSONStringToObject": "Dumas JSON String to Object",
}