auto / specs /python_fundamentals.json
rsnarsna
feat(alli-backend): Wave-1 standardization, standalone sys.env node & vault crypto, and DEC-014 security hardening
8628c98
Raw History Blame Contribute Delete
94 kB
{ "version": "1.0.0", "name": "Python Fundamentals Specification", "description": "Centralized schema and argument metadata for core Python language constructs in ALLI Studio", "constructs": [ { "id": "alli.primitive.print", "name": "Print Statement", "category": "Input & Output", "syntax": "print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)", "description": "Prints objects to the text stream file, separated by sep and followed by end. sep, end, file, and flush, if present, must be given as keyword arguments.", "doc_url": "https://docs.python.org/3/library/functions.html#print", "icon": "Terminal", "icon_bg": "bg-cyan-600", "border_color": "border-cyan-500/40", "inputs": [ { "id": "value", "name": "Value (*objects)", "type": "Any", "color": "blue", "description": "Object or variable value to print to stdout / stderr" } ], "outputs": [ { "id": "out", "name": "Pass-Through", "type": "Any", "color": "emerald", "description": "Passes the input value through for subsequent node operations in DAG" } ], "default_config": { "prefix": "Result:", "sep": " ", "end": "\\n", "file_stream": "stdout", "flush": false, "format_style": "standard" }, "arguments": [ { "name": "prefix", "type": "string", "label": "Prefix / Message Label", "description": "Optional leading label or title message to output before values", "default": "Result:", "presets": [ "", "Result:", "Output:", "[DEBUG]", "[INFO]", "User:" ] }, { "name": "sep", "type": "string", "label": "Separator (sep=' ')", "description": "String inserted between values when printing multiple objects (default space)", "default": " ", "presets": [ " ", ", ", " - ", " | ", "\t", "\n", "" ] }, { "name": "end", "type": "string", "label": "End String (end='\\n')", "description": "String appended after the last value (default newline)", "default": "\\n", "presets": [ "\\n", "", " ", "\t", "\\n\\n" ] }, { "name": "file_stream", "type": "select", "label": "Output Stream (file=)", "description": "Stream destination: sys.stdout (default console) or sys.stderr (error logging)", "default": "stdout", "options": [ { "value": "stdout", "label": "sys.stdout (Console)" }, { "value": "stderr", "label": "sys.stderr (Error / Diagnostic)" } ] }, { "name": "flush", "type": "boolean", "label": "Buffer Flush (flush=)", "description": "Whether to forcibly flush the stream buffer immediately (real-time stream)", "default": false, "options": [ { "value": false, "label": "False (Buffered)" }, { "value": true, "label": "True (Instant Flush)" } ] }, { "name": "format_style", "type": "select", "label": "Formatting Style", "description": "Rendering style: standard print(*args), f-string template, or pprint pretty printing", "default": "standard", "options": [ { "value": "standard", "label": "Standard print(*args)" }, { "value": "fstring", "label": "f-String print(f\"...\")" }, { "value": "pprint", "label": "pprint (Pretty-Print)" } ] } ], "parent_category": "Input & Output", "subcategory": "Streams & Consoles", "group_id": "io", "tags": [ "print", "output", "stream" ] }, { "id": "alli.primitive.variable", "name": "Variable", "category": "Variables & Types", "syntax": "<identifier>: <type_hint> = <value>", "description": "Declares and assigns a named Python variable with static type hint.", "doc_url": "https://docs.python.org/3/reference/simple_stmts.html#assignment-statements", "icon": "Variable", "icon_bg": "bg-blue-600", "border_color": "border-blue-500/40", "inputs": [ { "id": "in", "name": "Set / In", "type": "Any", "color": "blue", "description": "Incoming expression, value, or runtime mutation to assign to this variable" } ], "outputs": [ { "id": "out", "name": "Value", "type": "Any", "color": "emerald", "description": "The assigned variable reference" }, { "id": "value", "name": "Value", "type": "Any", "color": "emerald", "description": "The assigned variable reference (alias)" } ], "default_config": { "var_name": "var_1", "value": "hello", "type_hint": "str" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Variable Identifier", "description": "Valid Python variable name (PEP 8 snake_case)", "default": "var_1" }, { "name": "type_hint", "type": "select", "label": "Data Type Hint", "description": "Python static type annotation", "default": "str", "options": [ { "value": "str", "label": "str (String)" }, { "value": "int", "label": "int (Integer)" }, { "value": "float", "label": "float (Float)" }, { "value": "bool", "label": "bool (Boolean)" }, { "value": "list", "label": "list (List)" }, { "value": "dict", "label": "dict (Dictionary)" }, { "value": "Any", "label": "Any (Dynamic)" } ] }, { "name": "value", "type": "string", "label": "Assigned Value", "description": "Initial literal value assigned to the variable", "default": "hello" } ], "parent_category": "Variables & Data", "subcategory": "Primitives & Scalars", "group_id": "variables_data", "tags": [ "variable", "constant", "data", "primitives" ] }, { "id": "alli.primitive.binary_op", "name": "Binary Operation", "category": "Arithmetic & Math", "syntax": "result = a <operator> b", "description": "Applies an arithmetic or binary operator between operands A and B.", "doc_url": "https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations", "icon": "Binary", "icon_bg": "bg-emerald-600", "border_color": "border-emerald-500/40", "inputs": [ { "id": "a", "name": "A", "type": "float | int", "color": "blue" }, { "id": "b", "name": "B", "type": "float | int", "color": "cyan" } ], "outputs": [ { "id": "result", "name": "Result", "type": "float | int", "color": "emerald" } ], "default_config": { "operator": "+" }, "arguments": [ { "name": "operator", "type": "select", "label": "Operator", "description": "Arithmetic operation to apply", "default": "+", "presets": [ "+", "-", "*", "/", "//", "%", "**" ] } ], "parent_category": "Operators & Logic", "subcategory": "Arithmetic & Comparison", "group_id": "operators_logic", "tags": [ "math", "logic", "binary", "compare" ] }, { "id": "alli.primitive.compare", "name": "Comparison", "category": "Control Flow", "syntax": "is_valid = (a <operator> b)", "description": "Evaluates boolean relationship between values A and B.", "doc_url": "https://docs.python.org/3/reference/expressions.html#comparisons", "icon": "Scale", "icon_bg": "bg-purple-600", "border_color": "border-purple-500/40", "inputs": [ { "id": "a", "name": "Left Operand", "type": "Any", "color": "blue" }, { "id": "b", "name": "Right Operand", "type": "Any", "color": "cyan" } ], "outputs": [ { "id": "result", "name": "Boolean", "type": "bool", "color": "emerald" } ], "default_config": { "operator": "==" }, "arguments": [ { "name": "operator", "type": "select", "label": "Comparison Operator", "description": "Relational comparison condition", "default": "==", "presets": [ "==", "!=", ">", "<", ">=", "<=" ] } ], "parent_category": "Operators & Logic", "subcategory": "Arithmetic & Comparison", "group_id": "operators_logic", "tags": [ "math", "logic", "binary", "compare" ] }, { "id": "alli.primitive.if_condition", "name": "If / Else Condition", "category": "Control Flow", "syntax": "if <condition>:\\n true_branch()\\nelse:\\n false_branch()", "description": "Branches execution flow based on a boolean expression evaluation.", "doc_url": "https://docs.python.org/3/reference/compound_stmts.html#the-if-statement", "icon": "GitBranch", "icon_bg": "bg-purple-600", "border_color": "border-purple-500/40", "inputs": [ { "id": "condition", "name": "Condition", "type": "bool", "color": "purple" }, { "id": "then_val", "name": "If True", "type": "Any", "color": "emerald" }, { "id": "else_val", "name": "If False", "type": "Any", "color": "rose" } ], "outputs": [ { "id": "result", "name": "Result", "type": "Any", "color": "emerald" }, { "id": "true", "name": "True Branch", "type": "bool", "color": "emerald" }, { "id": "false", "name": "False Branch", "type": "bool", "color": "rose" } ], "default_config": { "condition": "True" }, "arguments": [ { "name": "condition", "type": "expression", "label": "Condition Expression", "description": "Python expression evaluated as a boolean predicate", "default": "True", "presets": [ "True", "False", "x > 0", "a == b", "val >= 18" ] } ], "parent_category": "Control Flow", "subcategory": "Conditionals", "group_id": "control_flow", "tags": [ "condition", "branch", "if", "else" ] }, { "id": "alli.primitive.constant", "name": "Constant", "category": "Variables & Types", "syntax": "<IDENTIFIER>: Final[<type_hint>] = <value>", "description": "Declares an immutable constant value according to PEP 591 typing conventions.", "doc_url": "https://peps.python.org/pep-0591/", "icon": "Lock", "icon_bg": "bg-cyan-600", "border_color": "border-cyan-500/40", "inputs": [], "outputs": [ { "id": "value", "name": "Constant Value", "type": "Any", "color": "cyan", "description": "Immutable constant output" } ], "default_config": { "var_name": "PI", "value": "3.14159", "type_hint": "float" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Constant Name", "description": "UPPER_SNAKE_CASE constant identifier", "default": "PI", "presets": [ "PI", "MAX_RETRIES", "TIMEOUT", "BASE_URL", "DEBUG" ] }, { "name": "type_hint", "type": "select", "label": "Constant Type", "description": "Data type hint", "default": "float", "options": [ { "value": "float", "label": "float (Float)" }, { "value": "int", "label": "int (Integer)" }, { "value": "str", "label": "str (String)" }, { "value": "bool", "label": "bool (Boolean)" } ] }, { "name": "value", "type": "string", "label": "Immutable Value", "description": "Static constant value", "default": "3.14159" } ], "parent_category": "Variables & Data", "subcategory": "Primitives & Scalars", "group_id": "variables_data", "tags": [ "variable", "constant", "data", "primitives" ] }, { "id": "alli.primitive.input", "name": "Input Prompt", "category": "Input & Output", "syntax": "user_val = input('<prompt>')", "description": "Reads a string line from standard console input with custom prompt message.", "doc_url": "https://docs.python.org/3/library/functions.html#input", "icon": "TextCursorInput", "icon_bg": "bg-emerald-600", "border_color": "border-emerald-500/40", "inputs": [], "outputs": [ { "id": "value", "name": "User Input String", "type": "str", "color": "emerald", "description": "Captured user input line" } ], "default_config": { "prompt": "Enter value: ", "cast_type": "str" }, "arguments": [ { "name": "prompt", "type": "string", "label": "Prompt Message", "description": "Message string displayed to user on stdin", "default": "Enter value: ", "presets": [ "Enter value: ", "Enter your name: ", "Input number: ", "Select option: " ] }, { "name": "cast_type", "type": "select", "label": "Type Casting", "description": "Automatically cast input to desired type", "default": "str", "options": [ { "value": "str", "label": "str (Raw String)" }, { "value": "int", "label": "int (Integer: int(...))" }, { "value": "float", "label": "float (Float: float(...))" } ] } ], "parent_category": "Variables & Data", "subcategory": "Primitives & Scalars", "group_id": "variables_data", "tags": [ "variable", "constant", "data", "primitives" ] }, { "id": "alli.primitive.loop", "name": "For Loop / Iterator", "category": "Control Flow", "syntax": "for <item> in range(<count>):\\n body()", "description": "Repeats execution sequence across an iterable sequence or range.", "doc_url": "https://docs.python.org/3/reference/compound_stmts.html#the-for-statement", "icon": "Repeat", "icon_bg": "bg-amber-600", "border_color": "border-amber-500/40", "inputs": [ { "id": "iterable", "name": "Iterable / Range", "type": "iterable", "color": "blue" } ], "outputs": [ { "id": "item", "name": "Current Item", "type": "Any", "color": "amber" }, { "id": "done", "name": "Loop Complete", "type": "bool", "color": "emerald" } ], "default_config": { "iterator_var": "item", "range_count": 5 }, "arguments": [ { "name": "iterator_var", "type": "string", "label": "Iterator Variable", "description": "Loop variable bound to each iteration item", "default": "item", "presets": [ "item", "i", "idx", "element", "num" ] }, { "name": "range_count", "type": "string", "label": "Range Count or Sequence", "description": "Iteration count range(N) or iterable variable expression", "default": "5", "presets": [ "5", "10", "100", "items", "data" ] } ], "parent_category": "Loops & Iteration", "subcategory": "Iterators", "group_id": "loops", "tags": [ "loop", "for", "iteration" ] }, { "id": "alli.primitive.math", "name": "Math Functions (math)", "category": "Standard Library", "syntax": "import math\nresult = math.sqrt(x)", "description": "Access standard mathematical functions including sqrt, pow, floor, ceil, pi, factorial, sin, cos, and gcd.", "doc_url": "https://docs.python.org/3/library/math.html", "icon": "Calculator", "icon_bg": "bg-emerald-600", "border_color": "border-emerald-500/40", "inputs": [ { "id": "x", "name": "Operand X", "type": "float", "color": "blue", "description": "Primary numeric operand" }, { "id": "y", "name": "Operand Y", "type": "float", "color": "blue", "description": "Secondary operand (for pow, gcd)" } ], "outputs": [ { "id": "result", "name": "Math Result", "type": "float", "color": "emerald", "description": "Calculated mathematical result" } ], "default_config": { "func": "sqrt", "x": "16", "y": "2" }, "arguments": [ { "name": "func", "type": "select", "label": "Math Operation", "description": "Mathematical function to compute", "default": "sqrt", "options": [ { "value": "sqrt", "label": "math.sqrt(x) - Square Root" }, { "value": "pow", "label": "math.pow(x, y) - Power (x^y)" }, { "value": "floor", "label": "math.floor(x) - Floor Integer" }, { "value": "ceil", "label": "math.ceil(x) - Ceiling Integer" }, { "value": "pi", "label": "math.pi - Constant Pi" }, { "value": "factorial", "label": "math.factorial(x) - Factorial" }, { "value": "sin", "label": "math.sin(x) - Sine (radians)" }, { "value": "cos", "label": "math.cos(x) - Cosine (radians)" }, { "value": "gcd", "label": "math.gcd(x, y) - Greatest Common Divisor" } ] }, { "name": "x", "type": "string", "label": "Operand X", "description": "Primary numeric value or input variable", "default": "16", "presets": [ "16", "25", "100", "3.14159", "0" ] }, { "name": "y", "type": "string", "label": "Operand Y (for pow/gcd)", "description": "Secondary numeric operand for 2-parameter functions", "default": "2", "presets": [ "2", "3", "10", "4" ] } ], "parent_category": "Standard Library", "subcategory": "Utilities", "group_id": "stdlib", "tags": [ "module", "stdlib" ] }, { "id": "alli.primitive.datetime", "name": "Date & Time (datetime)", "category": "Standard Library", "syntax": "from datetime import datetime\nnow_str = datetime.now().strftime(format)", "description": "Date and time manipulation functions: datetime.now(), date.today(), strftime, and timestamp.", "doc_url": "https://docs.python.org/3/library/datetime.html", "icon": "Calendar", "icon_bg": "bg-cyan-600", "border_color": "border-cyan-500/40", "inputs": [ { "id": "format", "name": "Format Pattern", "type": "str", "color": "blue", "description": "strftime pattern string" } ], "outputs": [ { "id": "result", "name": "Date/Time Value", "type": "str", "color": "cyan", "description": "Formatted date/time string or timestamp" } ], "default_config": { "operation": "strftime", "format_pattern": "%Y-%m-%d %H:%M:%S" }, "arguments": [ { "name": "operation", "type": "select", "label": "Datetime Operation", "description": "Datetime function or format", "default": "strftime", "options": [ { "value": "strftime", "label": "datetime.now().strftime(pattern) - Formatted String" }, { "value": "now", "label": "datetime.now() - Current Datetime" }, { "value": "today", "label": "date.today() - Current Calendar Date" }, { "value": "timestamp", "label": "datetime.now().timestamp() - Epoch Float" }, { "value": "isoformat", "label": "datetime.now().isoformat() - ISO 8601 String" } ] }, { "name": "format_pattern", "type": "string", "label": "Format Pattern", "description": "strftime date/time pattern string", "default": "%Y-%m-%d %H:%M:%S", "presets": [ "%Y-%m-%d %H:%M:%S", "%Y-%m-%d", "%H:%M:%S", "%A, %B %d, %Y" ] } ], "parent_category": "Standard Library", "subcategory": "Utilities", "group_id": "stdlib", "tags": [ "module", "stdlib" ] }, { "id": "alli.primitive.random", "name": "Random Generator (random)", "category": "Standard Library", "syntax": "import random\nval = random.randint(min, max)", "description": "Generates pseudo-random numbers and items: randint(a, b), random(), uniform(a, b), choice(seq).", "doc_url": "https://docs.python.org/3/library/random.html", "icon": "Dices", "icon_bg": "bg-purple-600", "border_color": "border-purple-500/40", "inputs": [ { "id": "min_val", "name": "Min Bound", "type": "int", "color": "blue", "description": "Minimum integer value" }, { "id": "max_val", "name": "Max Bound", "type": "int", "color": "blue", "description": "Maximum integer value" } ], "outputs": [ { "id": "result", "name": "Random Result", "type": "int", "color": "purple", "description": "Generated random value" } ], "default_config": { "func": "randint", "min_val": "1", "max_val": "100" }, "arguments": [ { "name": "func", "type": "select", "label": "Random Function", "description": "Random distribution method", "default": "randint", "options": [ { "value": "randint", "label": "random.randint(a, b) - Random Integer [a, b]" }, { "value": "random", "label": "random.random() - Random Float [0.0, 1.0)" }, { "value": "uniform", "label": "random.uniform(a, b) - Random Float in [a, b]" }, { "value": "choice", "label": "random.choice(seq) - Random Item from List" } ] }, { "name": "min_val", "type": "string", "label": "Min Bound (a)", "description": "Lower bound integer or sequence", "default": "1", "presets": [ "1", "0", "10", "100" ] }, { "name": "max_val", "type": "string", "label": "Max Bound (b)", "description": "Upper bound integer", "default": "100", "presets": [ "10", "50", "100", "1000" ] } ], "parent_category": "Standard Library", "subcategory": "Utilities", "group_id": "stdlib", "tags": [ "module", "stdlib" ] }, { "id": "alli.primitive.json", "name": "JSON Serialization (json)", "category": "Standard Library", "syntax": "import json\noutput = json.dumps(data, indent=2)", "description": "JSON encoder and decoder: json.dumps(obj) and json.loads(string).", "doc_url": "https://docs.python.org/3/library/json.html", "icon": "FileJson", "icon_bg": "bg-rose-600", "border_color": "border-rose-500/40", "inputs": [ { "id": "data", "name": "Input Data", "type": "Any", "color": "blue", "description": "Python object or JSON string" } ], "outputs": [ { "id": "result", "name": "JSON Result", "type": "str", "color": "rose", "description": "Serialized JSON string or parsed dict" } ], "default_config": { "func": "dumps", "indent": 2 }, "arguments": [ { "name": "func", "type": "select", "label": "JSON Operation", "description": "Serialize to string or parse from string", "default": "dumps", "options": [ { "value": "dumps", "label": "json.dumps(obj) - Serialize Object to JSON" }, { "value": "loads", "label": "json.loads(str) - Parse JSON String to Object" } ] }, { "name": "indent", "type": "select", "label": "Indentation (indent=)", "description": "Indentation spacing for pretty-printing JSON", "default": 2, "options": [ { "value": 0, "label": "Compact (indent=0)" }, { "value": 2, "label": "2 Spaces (Standard)" }, { "value": 4, "label": "4 Spaces (Readable)" } ] } ], "parent_category": "Standard Library", "subcategory": "Utilities", "group_id": "stdlib", "tags": [ "module", "stdlib" ] }, { "id": "alli.primitive.time", "name": "Time & Clocks (time)", "category": "Standard Library", "syntax": "import time\ncurrent = time.ctime()", "description": "Provides time-related functions: time.time(), time.ctime(), and time.sleep().", "doc_url": "https://docs.python.org/3/library/time.html", "icon": "Clock", "icon_bg": "bg-amber-600", "border_color": "border-amber-500/40", "inputs": [], "outputs": [ { "id": "result", "name": "Time Output", "type": "str", "color": "amber", "description": "Epoch float or formatted time string" } ], "default_config": { "func": "ctime" }, "arguments": [ { "name": "func", "type": "select", "label": "Time Function", "description": "Clock or sleep function", "default": "ctime", "options": [ { "value": "ctime", "label": "time.ctime() - Human Readable Time" }, { "value": "time", "label": "time.time() - Seconds Since Epoch" }, { "value": "sleep", "label": "time.sleep(1) - Pause Execution 1s" } ] } ], "parent_category": "Standard Library", "subcategory": "Utilities", "group_id": "stdlib", "tags": [ "module", "stdlib" ] }, { "id": "alli.ds.list", "name": "List / Sequence", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Collections & Sequences", "group_id": "data_structures", "tags": [ "list", "array", "sequence", "collections", "data_structures" ], "syntax": "my_list = [items]\nmy_list.append(x)\nitem = my_list[idx]", "description": "Ordered mutable sequence. Supports creation, indexing, slicing, appending, and popping.", "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#more-on-lists", "icon": "ListOrdered", "icon_bg": "bg-emerald-600", "border_color": "border-emerald-500/40", "inputs": [ { "id": "items", "name": "Elements (*items)", "type": "Any", "color": "emerald", "description": "Element(s) to pack into list or append" }, { "id": "index", "name": "Index / Slice", "type": "int", "color": "blue", "description": "Optional index or slice bound for extraction" } ], "outputs": [ { "id": "out", "name": "List [T]", "type": "list", "color": "emerald", "description": "Resulting Python list" }, { "id": "item", "name": "Extracted Item", "type": "Any", "color": "cyan", "description": "Extracted element if indexing" } ], "default_config": { "var_name": "items_list", "operation": "create", "initial_items": "[10, 20, 30, 40]" }, "arguments": [ { "name": "operation", "type": "select", "label": "List Operation", "description": "Choose creation, append, slice, or pop", "default": "create", "options": [ { "value": "create", "label": "Create [elements]" }, { "value": "append", "label": ".append(item)" }, { "value": "slice", "label": "Slice [start:stop]" }, { "value": "pop", "label": ".pop(index)" } ] }, { "name": "var_name", "type": "string", "label": "List Variable Name", "description": "Variable name for the list", "default": "items_list" }, { "name": "initial_items", "type": "string", "label": "Initial Elements / Literal", "description": "Literal list representation", "default": "[10, 20, 30, 40]" } ] }, { "id": "alli.ds.dict", "name": "Dictionary / Map", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Key-Value Mappings", "group_id": "data_structures", "tags": [ "dict", "map", "json", "hashmap", "collections", "data_structures" ], "syntax": "user = {'id': 101, 'name': 'Alice'}\nval = user.get('key', default)", "description": "Key-value hash table mapping. Supports safe lookups, key assignment, and view extraction.", "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#dictionaries", "icon": "Braces", "icon_bg": "bg-rose-600", "border_color": "border-rose-500/40", "inputs": [ { "id": "key", "name": "Key", "type": "str", "color": "rose", "description": "Key identifier to insert or look up" }, { "id": "value", "name": "Value", "type": "Any", "color": "blue", "description": "Value to assign to key" }, { "id": "default", "name": "Default Fallback", "type": "Any", "color": "amber", "description": "Fallback value for safe .get() lookup" } ], "outputs": [ { "id": "out", "name": "Dict [K, V]", "type": "dict", "color": "rose", "description": "The dictionary object" }, { "id": "val_out", "name": "Retrieved Value", "type": "Any", "color": "cyan", "description": "Value returned from key query" }, { "id": "keys", "name": "Keys List", "type": "list", "color": "purple", "description": "list(dict.keys())" } ], "default_config": { "var_name": "config_map", "operation": "create", "query_key": "status", "initial_dict": "{\"status\": \"active\", \"code\": 200, \"region\": \"us-east\"}" }, "arguments": [ { "name": "operation", "type": "select", "label": "Dictionary Action", "description": "Choose creation, get query, or set key", "default": "create", "options": [ { "value": "create", "label": "Create {key: value}" }, { "value": "get", "label": "Safe .get(key, default)" }, { "value": "set", "label": "Set dict[key] = value" }, { "value": "keys", "label": "Get Keys list(d.keys())" } ] }, { "name": "var_name", "type": "string", "label": "Dict Variable Name", "description": "Identifier name", "default": "config_map" }, { "name": "query_key", "type": "string", "label": "Target Key", "description": "Key name for queries or updates", "default": "status" } ] }, { "id": "alli.ds.tuple", "name": "Tuple / Record", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Collections & Sequences", "group_id": "data_structures", "tags": [ "tuple", "record", "immutable", "unpack", "data_structures" ], "syntax": "coords = (10, 20)\nx, y = coords", "description": "Immutable ordered sequence. Supports creation and multi-variable parallel unpacking.", "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences", "icon": "Layers", "icon_bg": "bg-indigo-600", "border_color": "border-indigo-500/40", "inputs": [ { "id": "a", "name": "Item A", "type": "Any", "color": "blue", "description": "First element" }, { "id": "b", "name": "Item B", "type": "Any", "color": "purple", "description": "Second element" } ], "outputs": [ { "id": "out", "name": "Tuple", "type": "tuple", "color": "indigo", "description": "The packed tuple record" }, { "id": "unpacked_a", "name": "Unpacked A", "type": "Any", "color": "blue", "description": "Unpacked first element" }, { "id": "unpacked_b", "name": "Unpacked B", "type": "Any", "color": "purple", "description": "Unpacked second element" } ], "default_config": { "var_name": "point_record", "val_a": "100", "val_b": "200" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Tuple Variable Name", "description": "Name for the tuple", "default": "point_record" } ] }, { "id": "alli.ds.set", "name": "Set / Unique", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Sets & Uniques", "group_id": "data_structures", "tags": [ "set", "unique", "union", "intersection", "data_structures" ], "syntax": "tags = {'python', 'ai'}\ntags.add('cloud')\ns1 | s2", "description": "Unordered collection of unique items. Supports deduplication and mathematical set algebra.", "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#sets", "icon": "Boxes", "icon_bg": "bg-teal-600", "border_color": "border-teal-500/40", "inputs": [ { "id": "item", "name": "Element", "type": "Any", "color": "teal", "description": "Item to add or test membership" }, { "id": "other_set", "name": "Second Set", "type": "set", "color": "teal", "description": "Set for union or intersection" } ], "outputs": [ { "id": "out", "name": "Set [T]", "type": "set", "color": "teal", "description": "Resulting set" }, { "id": "is_member", "name": "In Set (bool)", "type": "bool", "color": "cyan", "description": "True if element exists in set" } ], "default_config": { "var_name": "unique_tags", "operation": "create", "initial_set": "{\"alpha\", \"beta\", \"gamma\"}" }, "arguments": [ { "name": "operation", "type": "select", "label": "Set Operation", "description": "Action to perform", "default": "create", "options": [ { "value": "create", "label": "Create {unique items}" }, { "value": "add", "label": "Add element: .add(x)" }, { "value": "union", "label": "Union: s1 | s2" }, { "value": "intersection", "label": "Intersection: s1 & s2" } ] }, { "name": "var_name", "type": "string", "label": "Set Variable Name", "description": "Variable name", "default": "unique_tags" } ] }, { "id": "alli.ds.comprehension", "name": "Comprehension", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Comprehensions", "group_id": "data_structures", "tags": [ "comprehension", "vectorize", "map", "filter", "data_structures" ], "syntax": "doubles = [x * 2 for x in numbers if x > 0]", "description": "High-performance Pythonic sequence transformation and filtering.", "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions", "icon": "Sparkles", "icon_bg": "bg-violet-600", "border_color": "border-violet-500/40", "inputs": [ { "id": "iterable", "name": "Source Iterable", "type": "Iterable", "color": "emerald", "description": "Input collection to iterate across" } ], "outputs": [ { "id": "out", "name": "Transformed List", "type": "list", "color": "violet", "description": "Generated list after comprehension" } ], "default_config": { "var_name": "transformed_list", "expr": "x * 2", "iterator": "x", "condition": "x > 0" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Result Variable", "description": "Target variable name", "default": "transformed_list" }, { "name": "expr", "type": "string", "label": "Transform Expression", "description": "Expression applied to each item", "default": "x * 2" }, { "name": "iterator", "type": "string", "label": "Loop Item Name", "description": "Iteration variable", "default": "x" }, { "name": "condition", "type": "string", "label": "Filter Condition (if)", "description": "Optional condition to keep item", "default": "x > 0" } ] }, { "id": "alli.ds.stack_queue", "name": "Stack / Queue", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Abstract Structures", "group_id": "data_structures", "tags": [ "stack", "queue", "deque", "lifo", "fifo", "data_structures" ], "syntax": "stack.append(x); val = stack.pop()\nfrom collections import deque\nq = deque(); q.append(x); val = q.popleft()", "description": "Abstract linear data structures: Stack (LIFO) and Queue (FIFO).", "doc_url": "https://docs.python.org/3/library/collections.html#collections.deque", "icon": "Stack", "icon_bg": "bg-cyan-600", "border_color": "border-cyan-500/40", "inputs": [ { "id": "item", "name": "Item (Push/Enqueue)", "type": "Any", "color": "cyan", "description": "Element to push or enqueue" } ], "outputs": [ { "id": "out", "name": "Collection", "type": "Any", "color": "cyan", "description": "Stack list or deque instance" }, { "id": "popped", "name": "Popped Item", "type": "Any", "color": "emerald", "description": "Element extracted from front or top" } ], "default_config": { "mode": "stack", "var_name": "data_buffer" }, "arguments": [ { "name": "mode", "type": "select", "label": "Structure Type", "description": "Stack (LIFO) or Queue (FIFO)", "default": "stack", "options": [ { "value": "stack", "label": "Stack (LIFO - append/pop)" }, { "value": "queue", "label": "Queue (FIFO - append/popleft)" } ] }, { "name": "var_name", "type": "string", "label": "Buffer Variable", "description": "Name for buffer", "default": "data_buffer" } ] }, { "id": "alli.ds.sort_search", "name": "Sort & Reduction", "category": "Data Structures", "parent_category": "Variables & Data", "subcategory": "Algorithms & Reductions", "group_id": "data_structures", "tags": [ "sort", "search", "len", "min", "max", "sum", "data_structures" ], "syntax": "sorted_items = sorted(data, reverse=False)\ncount = len(data)", "description": "Standard sorting and aggregation reductions across any collection.", "doc_url": "https://docs.python.org/3/library/functions.html#sorted", "icon": "ArrowUpDown", "icon_bg": "bg-amber-600", "border_color": "border-amber-500/40", "inputs": [ { "id": "collection", "name": "Collection", "type": "Iterable", "color": "amber", "description": "Collection to sort or reduce" } ], "outputs": [ { "id": "out", "name": "Result", "type": "Any", "color": "amber", "description": "Sorted list or aggregated scalar" }, { "id": "length", "name": "Length (len)", "type": "int", "color": "blue", "description": "Number of elements in collection" } ], "default_config": { "algo": "sorted", "reverse": false, "var_name": "sorted_result" }, "arguments": [ { "name": "algo", "type": "select", "label": "Algorithm / Reduction", "description": "Choose sorting or aggregation function", "default": "sorted", "options": [ { "value": "sorted", "label": "sorted(collection)" }, { "value": "min", "label": "min(collection)" }, { "value": "max", "label": "max(collection)" }, { "value": "sum", "label": "sum(collection)" }, { "value": "len", "label": "len(collection)" } ] }, { "name": "reverse", "type": "boolean", "label": "Reverse Order", "description": "Sort descending if True", "default": false } ] }, { "id": "alli.func.def", "name": "Function Definition", "category": "Functions & Scope", "parent_category": "Functions & Scope", "subcategory": "Definitions", "group_id": "functions", "tags": [ "def", "function", "parameters", "return", "scope" ], "syntax": "def {name}({params}) -> {return_type}:\n \"\"\"{docstring}\"\"\"\n return {result}", "description": "Defines a reusable, parameterized Python function with type hints and docstring.", "doc_url": "https://docs.python.org/3/tutorial/controlflow.html#defining-functions", "icon": "Code2", "icon_bg": "bg-yellow-600", "border_color": "border-yellow-500/40", "inputs": [ { "id": "arg1", "name": "Argument 1", "type": "Any", "color": "blue", "description": "First positional parameter" }, { "id": "arg2", "name": "Argument 2", "type": "Any", "color": "blue", "description": "Second parameter (optional)" } ], "outputs": [ { "id": "out", "name": "Function Result", "type": "Any", "color": "emerald", "description": "Evaluated return value" }, { "id": "func_ref", "name": "Callable Reference", "type": "Callable", "color": "amber", "description": "First-class reference to the defined function" } ], "default_config": { "func_name": "compute_metric", "params": "x, factor=2.5", "return_type": "float", "docstring": "Computes weighted metrics." }, "arguments": [ { "name": "func_name", "type": "string", "label": "Function Name", "description": "Identifier for def statement (valid snake_case)", "default": "compute_metric" }, { "name": "params", "type": "string", "label": "Parameters Signature", "description": "Comma-separated parameters (e.g. x, factor=2.5)", "default": "x, factor=2.5" }, { "name": "return_type", "type": "string", "label": "Return Type Hint", "description": "PEP 484 type hint (float, int, str, Any, etc.)", "default": "float" }, { "name": "docstring", "type": "string", "label": "Docstring", "description": "Function documentation string", "default": "Computes weighted metrics." } ] }, { "id": "alli.func.call", "name": "Function Call", "category": "Functions & Scope", "parent_category": "Functions & Scope", "subcategory": "Execution", "group_id": "functions", "tags": [ "call", "invoke", "execute", "args" ], "syntax": "{target_var} = {func_name}({args})", "description": "Invokes a callable function or lambda passing positional and keyword arguments.", "doc_url": "https://docs.python.org/3/tutorial/controlflow.html#calling-functions", "icon": "PlayCircle", "icon_bg": "bg-amber-600", "border_color": "border-amber-500/40", "inputs": [ { "id": "func_in", "name": "Function Ref", "type": "Callable", "color": "amber", "description": "Optional function reference handle" }, { "id": "arg", "name": "Argument Value", "type": "Any", "color": "blue", "description": "Value to pass as argument" } ], "outputs": [ { "id": "out", "name": "Return Value", "type": "Any", "color": "emerald", "description": "Result returned by the called function" } ], "default_config": { "func_name": "compute_metric", "args": "50, factor=3.0", "target_var": "calc_result" }, "arguments": [ { "name": "func_name", "type": "string", "label": "Function Name to Call", "description": "Name of target function", "default": "compute_metric" }, { "name": "args", "type": "string", "label": "Arguments (*args, **kwargs)", "description": "Comma-separated arguments", "default": "50, factor=3.0" }, { "name": "target_var", "type": "string", "label": "Assign Result To", "description": "Variable identifier storing return value", "default": "calc_result" } ] }, { "id": "alli.func.lambda", "name": "Lambda Expression", "category": "Functions & Scope", "parent_category": "Functions & Scope", "subcategory": "Anonymous", "group_id": "functions", "tags": [ "lambda", "anonymous", "expression" ], "syntax": "{var_name} = lambda {params}: {expression}", "description": "Creates an inline anonymous function expression.", "doc_url": "https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions", "icon": "Zap", "icon_bg": "bg-yellow-500", "border_color": "border-yellow-400/40", "inputs": [ { "id": "in", "name": "Input Feed", "type": "Any", "color": "blue", "description": "Optional argument feed" } ], "outputs": [ { "id": "func_ref", "name": "Lambda Callable", "type": "Callable", "color": "amber", "description": "The compiled lambda function" } ], "default_config": { "var_name": "double_fn", "params": "x", "expression": "x * 2" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Lambda Variable", "description": "Variable identifier", "default": "double_fn" }, { "name": "params", "type": "string", "label": "Parameters", "description": "Input parameters", "default": "x" }, { "name": "expression", "type": "string", "label": "Return Expression", "description": "Single-line Python expression", "default": "x * 2" } ] }, { "id": "alli.func.yield", "name": "Generator Yield", "category": "Functions & Scope", "parent_category": "Functions & Scope", "subcategory": "Generators", "group_id": "functions", "tags": [ "yield", "generator", "stream", "iteration" ], "syntax": "yield {value}", "description": "Yields an incremental value, transforming the enclosing function into a generator.", "doc_url": "https://docs.python.org/3/reference/expressions.html#yield-expressions", "icon": "IterationCw", "icon_bg": "bg-amber-700", "border_color": "border-amber-600/40", "inputs": [ { "id": "value", "name": "Yield Value", "type": "Any", "color": "blue", "description": "Value to produce" } ], "outputs": [ { "id": "out", "name": "Generator Stream", "type": "Iterator", "color": "emerald", "description": "Stream output handle" } ], "default_config": { "yield_value": "item", "is_from": false }, "arguments": [ { "name": "yield_value", "type": "string", "label": "Yield Expression", "description": "Value or expression to yield", "default": "item" }, { "name": "is_from", "type": "boolean", "label": "yield from (Sub-generator)", "description": "Delegates to a sub-iterable if True", "default": false } ] }, { "id": "alli.func.recursion_guard", "name": "Recursion Guard", "category": "Functions & Scope", "parent_category": "Functions & Scope", "subcategory": "Safety", "group_id": "functions", "tags": [ "recursion", "guard", "depth", "limit" ], "syntax": "if _recursion_depth > {max_depth}: raise RecursionError('Guard depth exceeded')", "description": "Protects recursive workflows from unbounded stack overflow exceptions.", "doc_url": "https://docs.python.org/3/library/sys.html#sys.setrecursionlimit", "icon": "ShieldCheck", "icon_bg": "bg-emerald-600", "border_color": "border-emerald-500/40", "inputs": [ { "id": "depth_in", "name": "Current Depth", "type": "int", "color": "blue", "description": "Current recursive depth integer" } ], "outputs": [ { "id": "depth_out", "name": "Safe Depth (+1)", "type": "int", "color": "emerald", "description": "Incremented depth verified within bounds" } ], "default_config": { "max_depth": 50 }, "arguments": [ { "name": "max_depth", "type": "number", "label": "Max Recursion Depth", "description": "Maximum allowed recursive step before aborting", "default": 50 } ] }, { "id": "alli.oop.class_def", "name": "Class Definition", "category": "OOP & Classes", "parent_category": "OOP & Classes", "subcategory": "Definitions", "group_id": "oop", "tags": [ "class", "oop", "inheritance", "object" ], "syntax": "class {class_name}({bases}):\n \"\"\"{docstring}\"\"\"\n pass", "description": "Declares an object-oriented class with optional inheritance and docstring.", "doc_url": "https://docs.python.org/3/tutorial/classes.html", "icon": "Layers", "icon_bg": "bg-indigo-600", "border_color": "border-indigo-500/40", "inputs": [], "outputs": [ { "id": "class_ref", "name": "Class Type", "type": "Type", "color": "indigo", "description": "Reference to the defined class" } ], "default_config": { "class_name": "DataPipeline", "bases": "", "docstring": "Orchestrates end-to-end data processing." }, "arguments": [ { "name": "class_name", "type": "string", "label": "Class Name (PascalCase)", "description": "Class identifier", "default": "DataPipeline" }, { "name": "bases", "type": "string", "label": "Base Classes (Inheritance)", "description": "Comma-separated base classes (e.g. object, BaseModel)", "default": "" }, { "name": "docstring", "type": "string", "label": "Class Docstring", "description": "Class level documentation", "default": "Orchestrates end-to-end data processing." } ] }, { "id": "alli.oop.constructor", "name": "Constructor (__init__)", "category": "OOP & Classes", "parent_category": "OOP & Classes", "subcategory": "Methods", "group_id": "oop", "tags": [ "__init__", "constructor", "self", "instance" ], "syntax": "def __init__(self, {params}):\n {init_body}", "description": "Initializes object instance attributes on creation.", "doc_url": "https://docs.python.org/3/reference/datamodel.html#object.__init__", "icon": "Wrench", "icon_bg": "bg-indigo-700", "border_color": "border-indigo-600/40", "inputs": [ { "id": "init_arg1", "name": "Initial Value", "type": "Any", "color": "blue", "description": "Argument passed to constructor" } ], "outputs": [ { "id": "self_out", "name": "self", "type": "Object", "color": "indigo", "description": "Initialized instance reference" } ], "default_config": { "params": "name, buffer_size=1024", "init_attrs": "self.name = name\nself.buffer_size = buffer_size" }, "arguments": [ { "name": "params", "type": "string", "label": "Parameters Signature", "description": "Parameters following self (e.g. name, buffer_size=1024)", "default": "name, buffer_size=1024" }, { "name": "init_attrs", "type": "string", "label": "Attribute Assignments", "description": "self.attr = value lines", "default": "self.name = name\nself.buffer_size = buffer_size" } ] }, { "id": "alli.oop.method", "name": "Instance Method / Property", "category": "OOP & Classes", "parent_category": "OOP & Classes", "subcategory": "Methods", "group_id": "oop", "tags": [ "method", "property", "self", "oop" ], "syntax": "def {method_name}(self, {params}) -> {return_type}:\n return {return_expr}", "description": "Defines an instance method or @property getter bound to self.", "doc_url": "https://docs.python.org/3/tutorial/classes.html#method-objects", "icon": "Workflow", "icon_bg": "bg-purple-600", "border_color": "border-purple-500/40", "inputs": [ { "id": "self", "name": "self", "type": "Object", "color": "indigo", "description": "Instance self binding" } ], "outputs": [ { "id": "out", "name": "Method Return", "type": "Any", "color": "emerald", "description": "Result returned by the method" } ], "default_config": { "method_name": "execute", "params": "payload", "is_property": false, "return_expr": "f'{self.name} processed: {payload}'" }, "arguments": [ { "name": "method_name", "type": "string", "label": "Method Name", "description": "Identifier for the method", "default": "execute" }, { "name": "params", "type": "string", "label": "Parameters (after self)", "description": "Positional and keyword parameters", "default": "payload" }, { "name": "is_property", "type": "boolean", "label": "Decorate with @property", "description": "Creates a managed getter property", "default": false }, { "name": "return_expr", "type": "string", "label": "Return Expression", "description": "Expression returned by method", "default": "f'{self.name} processed: {payload}'" } ] }, { "id": "alli.oop.instantiate", "name": "Instantiate Object", "category": "OOP & Classes", "parent_category": "OOP & Classes", "subcategory": "Instances", "group_id": "oop", "tags": [ "new", "instance", "object", "create" ], "syntax": "{var_name} = {class_name}({args})", "description": "Creates a new class instance object and binds it to a variable.", "doc_url": "https://docs.python.org/3/tutorial/classes.html#class-instantiation", "icon": "Box", "icon_bg": "bg-violet-600", "border_color": "border-violet-500/40", "inputs": [ { "id": "arg", "name": "Constructor Arg", "type": "Any", "color": "blue", "description": "Argument passed to __init__" } ], "outputs": [ { "id": "instance", "name": "Instance Object", "type": "Object", "color": "indigo", "description": "Instantiated class object" } ], "default_config": { "var_name": "pipeline", "class_name": "DataPipeline", "args": "'Primary', buffer_size=2048" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Instance Variable", "description": "Variable identifier storing object", "default": "pipeline" }, { "name": "class_name", "type": "string", "label": "Target Class Name", "description": "Class identifier to instantiate", "default": "DataPipeline" }, { "name": "args", "type": "string", "label": "Constructor Arguments", "description": "Arguments passed to __init__", "default": "'Primary', buffer_size=2048" } ] }, { "id": "alli.exc.try", "name": "Try Block", "category": "Exception Handling", "parent_category": "Exception Handling", "subcategory": "Protected Blocks", "group_id": "exceptions", "tags": [ "try", "exception", "guard", "error" ], "syntax": "try:\n {try_body}", "description": "Encapsulates statements protected from fatal runtime exceptions.", "doc_url": "https://docs.python.org/3/tutorial/errors.html#handling-exceptions", "icon": "ShieldAlert", "icon_bg": "bg-rose-600", "border_color": "border-rose-500/40", "inputs": [ { "id": "in", "name": "Flow Trigger", "type": "Any", "color": "blue", "description": "Incoming execution trigger" } ], "outputs": [ { "id": "protected", "name": "Protected Body", "type": "Block", "color": "emerald", "description": "Body executed inside try block" } ], "default_config": { "description": "Protected operations" }, "arguments": [ { "name": "description", "type": "string", "label": "Block Description", "description": "Comment documenting the guarded logic", "default": "Protected operations" } ] }, { "id": "alli.exc.except", "name": "Except Handler", "category": "Exception Handling", "parent_category": "Exception Handling", "subcategory": "Handlers", "group_id": "exceptions", "tags": [ "except", "catch", "handler", "error" ], "syntax": "except {exception_class} as {as_var}:\n {handler_body}", "description": "Catches specific exceptions and executes recovery or fallback logic.", "doc_url": "https://docs.python.org/3/tutorial/errors.html#handling-exceptions", "icon": "AlertTriangle", "icon_bg": "bg-amber-600", "border_color": "border-amber-500/40", "inputs": [ { "id": "try_in", "name": "From Try Block", "type": "Block", "color": "rose", "description": "Connection from preceding Try node" } ], "outputs": [ { "id": "error_obj", "name": "Caught Error", "type": "Exception", "color": "rose", "description": "The caught exception instance" }, { "id": "fallback", "name": "Recovery Output", "type": "Any", "color": "amber", "description": "Fallback value produced" } ], "default_config": { "exception_class": "Exception", "as_var": "err", "fallback_value": "None" }, "arguments": [ { "name": "exception_class", "type": "select", "label": "Target Exception Class", "description": "Exception type to catch", "default": "Exception", "options": [ { "value": "Exception", "label": "Exception (General Catch)" }, { "value": "ValueError", "label": "ValueError" }, { "value": "TypeError", "label": "TypeError" }, { "value": "KeyError", "label": "KeyError" }, { "value": "IndexError", "label": "IndexError" }, { "value": "ZeroDivisionError", "label": "ZeroDivisionError" }, { "value": "FileNotFoundError", "label": "FileNotFoundError" }, { "value": "TimeoutError", "label": "TimeoutError" } ] }, { "name": "as_var", "type": "string", "label": "Error Variable Name", "description": "Variable bound to exception instance", "default": "err" }, { "name": "fallback_value", "type": "string", "label": "Fallback Result", "description": "Default return if exception is caught", "default": "None" } ] }, { "id": "alli.exc.finally", "name": "Finally Block", "category": "Exception Handling", "parent_category": "Exception Handling", "subcategory": "Cleanup", "group_id": "exceptions", "tags": [ "finally", "cleanup", "resource" ], "syntax": "finally:\n {cleanup_body}", "description": "Executes cleanup statements guaranteed to run regardless of exceptions.", "doc_url": "https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions", "icon": "CheckCircle2", "icon_bg": "bg-slate-700", "border_color": "border-slate-600/40", "inputs": [ { "id": "in", "name": "Block In", "type": "Block", "color": "blue", "description": "Incoming block stream" } ], "outputs": [ { "id": "out", "name": "Completed", "type": "Any", "color": "emerald", "description": "Continuation trigger" } ], "default_config": { "cleanup_comment": "Guaranteed cleanup" }, "arguments": [ { "name": "cleanup_comment", "type": "string", "label": "Cleanup Description", "description": "Description of cleanup actions performed", "default": "Guaranteed cleanup" } ] }, { "id": "alli.exc.raise", "name": "Raise Exception", "category": "Exception Handling", "parent_category": "Exception Handling", "subcategory": "Signaling", "group_id": "exceptions", "tags": [ "raise", "throw", "error", "bail" ], "syntax": "raise {exception_class}({message})", "description": "Explicitly raises a runtime exception with a custom message.", "doc_url": "https://docs.python.org/3/tutorial/errors.html#raising-exceptions", "icon": "Flame", "icon_bg": "bg-red-600", "border_color": "border-red-500/40", "inputs": [ { "id": "trigger", "name": "Trigger (bool)", "type": "bool", "color": "rose", "description": "Optional condition triggering raise" } ], "outputs": [], "default_config": { "exception_class": "ValueError", "message": "Invalid parameter configuration supplied" }, "arguments": [ { "name": "exception_class", "type": "string", "label": "Exception Type", "description": "Exception class to raise", "default": "ValueError" }, { "name": "message", "type": "string", "label": "Error Message", "description": "Human-readable diagnostic message", "default": "Invalid parameter configuration supplied" } ] }, { "id": "alli.exc.assert", "name": "Assertion", "category": "Exception Handling", "parent_category": "Exception Handling", "subcategory": "Contracts", "group_id": "exceptions", "tags": [ "assert", "invariant", "contract", "test" ], "syntax": "assert {condition}, {message}", "description": "Tests an invariant condition; raises AssertionError if False.", "doc_url": "https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement", "icon": "AlertOctagon", "icon_bg": "bg-rose-700", "border_color": "border-rose-600/40", "inputs": [ { "id": "condition", "name": "Condition (bool)", "type": "bool", "color": "blue", "description": "Boolean test expression" } ], "outputs": [ { "id": "out", "name": "Passed Value", "type": "Any", "color": "emerald", "description": "Pass-through if assertion holds" } ], "default_config": { "condition": "len(items) > 0", "message": "Items collection must not be empty" }, "arguments": [ { "name": "condition", "type": "string", "label": "Assertion Condition", "description": "Expression that must evaluate to True", "default": "len(items) > 0" }, { "name": "message", "type": "string", "label": "Failure Message", "description": "AssertionError description", "default": "Items collection must not be empty" } ] }, { "id": "alli.sys.import", "name": "Import Statement", "category": "System & Libraries", "parent_category": "System & Libraries", "subcategory": "Modules", "group_id": "system", "tags": [ "import", "module", "library", "package" ], "syntax": "import {module_name} as {alias}", "description": "Imports standard library modules or third-party packages.", "doc_url": "https://docs.python.org/3/reference/simple_stmts.html#the-import-statement", "icon": "Package", "icon_bg": "bg-cyan-700", "border_color": "border-cyan-600/40", "inputs": [], "outputs": [ { "id": "module", "name": "Module Ref", "type": "Module", "color": "cyan", "description": "Loaded module reference" } ], "default_config": { "module_name": "math", "alias": "math", "imported_items": "" }, "arguments": [ { "name": "module_name", "type": "string", "label": "Module Name", "description": "Module identifier to import", "default": "math" }, { "name": "alias", "type": "string", "label": "Import Alias (as)", "description": "Optional alias identifier", "default": "math" }, { "name": "imported_items", "type": "string", "label": "from module import items", "description": "Optional comma-separated items for from import", "default": "" } ] }, { "id": "alli.sys.file", "name": "File Operations", "category": "System & Libraries", "parent_category": "System & Libraries", "subcategory": "I/O", "group_id": "system", "tags": [ "file", "open", "read", "write", "io" ], "syntax": "with open('{path}', '{mode}', encoding='{encoding}') as f:\n {var_name} = f.{operation}()", "description": "Performs safe context-managed file reading and writing.", "doc_url": "https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files", "icon": "FileText", "icon_bg": "bg-emerald-600", "border_color": "border-emerald-500/40", "inputs": [ { "id": "content", "name": "Write Content", "type": "str", "color": "blue", "description": "Text to write when in write mode" } ], "outputs": [ { "id": "out", "name": "File Content", "type": "str", "color": "emerald", "description": "Read content or status" } ], "default_config": { "var_name": "file_data", "path": "data.txt", "mode": "r", "operation": "read", "encoding": "utf-8" }, "arguments": [ { "name": "path", "type": "string", "label": "File Path", "description": "Path to target file", "default": "data.txt" }, { "name": "mode", "type": "select", "label": "Open Mode", "description": "File open mode", "default": "r", "options": [ { "value": "r", "label": "Read Text ('r')" }, { "value": "w", "label": "Write Text ('w')" }, { "value": "a", "label": "Append Text ('a')" }, { "value": "rb", "label": "Read Binary ('rb')" }, { "value": "wb", "label": "Write Binary ('wb')" } ] }, { "name": "operation", "type": "select", "label": "Method", "description": "File method to call", "default": "read", "options": [ { "value": "read", "label": "f.read() (Entire content)" }, { "value": "readlines", "label": "f.readlines() (Lines list)" }, { "value": "write", "label": "f.write(content)" } ] }, { "name": "encoding", "type": "string", "label": "Encoding", "description": "Text encoding character set", "default": "utf-8" } ] }, { "id": "alli.sys.env", "name": ".env Environment", "category": "System & Libraries", "parent_category": "System & Libraries", "subcategory": "OS", "group_id": "system", "tags": [ "env", "os", "getenv", "secret" ], "syntax": "env_value = os.getenv('APP_MODE', 'sandbox')", "description": "Retrieves configuration or secret tokens from system environment variables.", "doc_url": "https://docs.python.org/3/library/os.html#os.getenv", "icon": "KeyRound", "icon_bg": "bg-slate-800", "border_color": "border-slate-700/40", "inputs": [], "outputs": [ { "id": "out", "name": "Env Value", "type": "str", "color": "cyan", "description": "Retrieved environment string" } ], "default_config": { "mode": "get", "key": "APP_MODE", "default_val": "sandbox", "value": "", "var_name": "env_value", "is_secret": false }, "arguments": [ { "name": "mode", "type": "select", "label": "Operation Mode", "options": [ "get", "set" ], "description": "Read a workspace .env variable (get) or assign an in-run env key (set)", "default": "get" }, { "name": "var_name", "type": "string", "label": "Variable Name", "description": "Target variable identifier", "default": "api_key" }, { "name": "key", "type": "string", "label": "Env Key Name", "description": "Environment variable key", "default": "OPENAI_API_KEY" }, { "name": "default_val", "type": "string", "label": "Default Fallback", "description": "Fallback value if key is not set", "default": "default_key_mock" }, { "name": "is_secret", "type": "boolean", "label": "Mask as Secret in UI", "description": "Hides value in canvas inspect previews", "default": true }, { "name": "value", "type": "string", "label": "Value (when mode = set)", "description": "Value to assign when mode is set", "default": "" } ] }, { "id": "alli.sys.logging", "name": "Logging Service", "category": "System & Libraries", "parent_category": "System & Libraries", "subcategory": "Observability", "group_id": "system", "tags": [ "log", "logging", "info", "warn", "error" ], "syntax": "logging.{level.lower()}('{message}')", "description": "Emits structured diagnostic logs through Python's standard logging facility.", "doc_url": "https://docs.python.org/3/library/logging.html", "icon": "Activity", "icon_bg": "bg-blue-600", "border_color": "border-blue-500/40", "inputs": [ { "id": "msg_in", "name": "Log Message / Data", "type": "Any", "color": "blue", "description": "Dynamic value to format into log" } ], "outputs": [ { "id": "out", "name": "Pass-Through", "type": "Any", "color": "emerald", "description": "Passes incoming data downstream" } ], "default_config": { "level": "INFO", "message": "Processing pipeline step initiated" }, "arguments": [ { "name": "level", "type": "select", "label": "Log Level", "description": "Severity level", "default": "INFO", "options": [ { "value": "DEBUG", "label": "DEBUG" }, { "value": "INFO", "label": "INFO" }, { "value": "WARNING", "label": "WARNING" }, { "value": "ERROR", "label": "ERROR" }, { "value": "CRITICAL", "label": "CRITICAL" } ] }, { "name": "message", "type": "string", "label": "Log Message Pattern", "description": "Text message format", "default": "Processing pipeline step initiated" } ] }, { "id": "alli.async.def", "name": "Async Function (async def)", "category": "Advanced Execution", "parent_category": "Advanced Execution", "subcategory": "Coroutines", "group_id": "async", "tags": [ "async", "await", "coroutine", "asyncio" ], "syntax": "async def {func_name}({params}):\n \"\"\"{docstring}\"\"\"\n {body}", "description": "Defines an asynchronous coroutine function compatible with asyncio event loops.", "doc_url": "https://docs.python.org/3/library/asyncio-task.html#coroutines", "icon": "Radio", "icon_bg": "bg-cyan-600", "border_color": "border-cyan-500/40", "inputs": [ { "id": "arg", "name": "Parameter", "type": "Any", "color": "blue", "description": "Argument passed to coroutine" } ], "outputs": [ { "id": "coro", "name": "Coroutine Ref", "type": "Coroutine", "color": "cyan", "description": "Awaitable coroutine object" } ], "default_config": { "func_name": "fetch_async_resource", "params": "endpoint", "docstring": "Asynchronously fetches remote resource." }, "arguments": [ { "name": "func_name", "type": "string", "label": "Async Function Name", "description": "Identifier for async def statement", "default": "fetch_async_resource" }, { "name": "params", "type": "string", "label": "Parameters", "description": "Comma-separated coroutine parameters", "default": "endpoint" }, { "name": "docstring", "type": "string", "label": "Docstring", "description": "Coroutine documentation", "default": "Asynchronously fetches remote resource." } ] }, { "id": "alli.async.await", "name": "Await Expression", "category": "Advanced Execution", "parent_category": "Advanced Execution", "subcategory": "Coroutines", "group_id": "async", "tags": [ "await", "coroutine", "asyncio", "result" ], "syntax": "{target_var} = await {coroutine_expr}", "description": "Suspends coroutine execution until the awaitable promise resolves.", "doc_url": "https://docs.python.org/3/reference/expressions.html#await", "icon": "Timer", "icon_bg": "bg-cyan-700", "border_color": "border-cyan-600/40", "inputs": [ { "id": "coro_in", "name": "Awaitable Input", "type": "Coroutine", "color": "cyan", "description": "Coroutine or Task to await" } ], "outputs": [ { "id": "out", "name": "Resolved Value", "type": "Any", "color": "emerald", "description": "Resolved asynchronous result" } ], "default_config": { "coroutine_expr": "fetch_async_resource('/api/v1/data')", "target_var": "async_result" }, "arguments": [ { "name": "coroutine_expr", "type": "string", "label": "Awaitable Expression", "description": "Expression returning a coroutine, Task, or Future", "default": "fetch_async_resource('/api/v1/data')" }, { "name": "target_var", "type": "string", "label": "Target Variable", "description": "Variable identifier storing resolved result", "default": "async_result" } ] }, { "id": "alli.async.task", "name": "Async Task Creation", "category": "Advanced Execution", "parent_category": "Advanced Execution", "subcategory": "Concurrency", "group_id": "async", "tags": [ "task", "create_task", "asyncio", "background" ], "syntax": "{task_var} = asyncio.create_task({coroutine_expr}, name='{task_name}')", "description": "Schedules a coroutine to run concurrently on the asyncio event loop.", "doc_url": "https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task", "icon": "Sparkles", "icon_bg": "bg-indigo-600", "border_color": "border-indigo-500/40", "inputs": [ { "id": "coro", "name": "Coroutine Feed", "type": "Coroutine", "color": "cyan", "description": "Coroutine to wrap into task" } ], "outputs": [ { "id": "task", "name": "Task Handle", "type": "Task", "color": "indigo", "description": "Running asyncio Task object" } ], "default_config": { "task_var": "bg_task", "task_name": "worker_pipeline", "coroutine_expr": "fetch_async_resource('/stream')" }, "arguments": [ { "name": "task_var", "type": "string", "label": "Task Variable", "description": "Variable identifier for Task handle", "default": "bg_task" }, { "name": "task_name", "type": "string", "label": "Task Name", "description": "Human-readable task label", "default": "worker_pipeline" }, { "name": "coroutine_expr", "type": "string", "label": "Coroutine Call", "description": "Coroutine to spawn as task", "default": "fetch_async_resource('/stream')" } ] }, { "id": "alli.async.context", "name": "Async Context (async with / for)", "category": "Advanced Execution", "parent_category": "Advanced Execution", "subcategory": "Context", "group_id": "async", "tags": [ "async with", "async for", "context", "iterator" ], "syntax": "{statement_type} {expr} as {var_name}:\n {body}", "description": "Asynchronous context management or asynchronous iterator streaming.", "doc_url": "https://docs.python.org/3/reference/compound_stmts.html#async-with", "icon": "Workflow", "icon_bg": "bg-teal-600", "border_color": "border-teal-500/40", "inputs": [ { "id": "ctx_in", "name": "Async Target", "type": "Any", "color": "cyan", "description": "Async context manager or iterator" } ], "outputs": [ { "id": "item", "name": "Bound Item", "type": "Any", "color": "emerald", "description": "Target variable bound inside async block" } ], "default_config": { "statement_type": "async with", "expr": "httpx.AsyncClient()", "var_name": "client" }, "arguments": [ { "name": "statement_type", "type": "select", "label": "Syntax Construct", "description": "Choose async with or async for", "default": "async with", "options": [ { "value": "async with", "label": "async with expr as target:" }, { "value": "async for", "label": "async for item in iterable:" } ] }, { "name": "expr", "type": "string", "label": "Async Expression", "description": "Context manager or async iterable expression", "default": "httpx.AsyncClient()" }, { "name": "var_name", "type": "string", "label": "Bound Variable (as)", "description": "Target identifier", "default": "client" } ] } ], "categories": [ { "id": "advanced_execution", "name": "Advanced Execution", "description": "Standard Advanced Execution visual language constructs." }, { "id": "arithmetic_and_math", "name": "Arithmetic & Math", "description": "Standard Arithmetic & Math visual language constructs." }, { "id": "control_flow", "name": "Control Flow", "description": "Standard Control Flow visual language constructs." }, { "id": "data_structures", "name": "Data Structures", "description": "Standard Data Structures visual language constructs." }, { "id": "exception_handling", "name": "Exception Handling", "description": "Standard Exception Handling visual language constructs." }, { "id": "functions_and_scope", "name": "Functions & Scope", "description": "Standard Functions & Scope visual language constructs." }, { "id": "input_and_output", "name": "Input & Output", "description": "Standard Input & Output visual language constructs." }, { "id": "oop_and_classes", "name": "OOP & Classes", "description": "Standard OOP & Classes visual language constructs." }, { "id": "standard_library", "name": "Standard Library", "description": "Standard Standard Library visual language constructs." }, { "id": "system_and_libraries", "name": "System & Libraries", "description": "Standard System & Libraries visual language constructs." }, { "id": "variables_and_types", "name": "Variables & Types", "description": "Standard Variables & Types visual language constructs." } ] }
{
"version": "1.0.0",
"name": "Python Fundamentals Specification",
"description": "Centralized schema and argument metadata for core Python language constructs in ALLI Studio",
"constructs": [
{
"id": "alli.primitive.print",
"name": "Print Statement",
"category": "Input & Output",
"syntax": "print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)",
"description": "Prints objects to the text stream file, separated by sep and followed by end. sep, end, file, and flush, if present, must be given as keyword arguments.",
"doc_url": "https://docs.python.org/3/library/functions.html#print",
"icon": "Terminal",
"icon_bg": "bg-cyan-600",
"border_color": "border-cyan-500/40",
"inputs": [
{
"id": "value",
"name": "Value (*objects)",
"type": "Any",
"color": "blue",
"description": "Object or variable value to print to stdout / stderr"
}
],
"outputs": [
{
"id": "out",
"name": "Pass-Through",
"type": "Any",
"color": "emerald",
"description": "Passes the input value through for subsequent node operations in DAG"
}
],
"default_config": {
"prefix": "Result:",
"sep": " ",
"end": "\\n",
"file_stream": "stdout",
"flush": false,
"format_style": "standard"
},
"arguments": [
{
"name": "prefix",
"type": "string",
"label": "Prefix / Message Label",
"description": "Optional leading label or title message to output before values",
"default": "Result:",
"presets": [
"",
"Result:",
"Output:",
"[DEBUG]",
"[INFO]",
"User:"
]
},
{
"name": "sep",
"type": "string",
"label": "Separator (sep=' ')",
"description": "String inserted between values when printing multiple objects (default space)",
"default": " ",
"presets": [
" ",
", ",
" - ",
" | ",
"\t",
"\n",
""
]
},
{
"name": "end",
"type": "string",
"label": "End String (end='\\n')",
"description": "String appended after the last value (default newline)",
"default": "\\n",
"presets": [
"\\n",
"",
" ",
"\t",
"\\n\\n"
]
},
{
"name": "file_stream",
"type": "select",
"label": "Output Stream (file=)",
"description": "Stream destination: sys.stdout (default console) or sys.stderr (error logging)",
"default": "stdout",
"options": [
{
"value": "stdout",
"label": "sys.stdout (Console)"
},
{
"value": "stderr",