rsnarsna commited on
Commit ·
5051049
1
Parent(s): 121cfed
feat(specs): extend python fundamentals catalog to 42 constructs across all 11 categories
Browse filesFiles changed (3)
- database/mongo.py+542-78
- main.py+14
- specs/python_fundamentals.jsonAdded+3283
3 unmodified lines45678966 unmodified lines767778798081825 unmodified lines888990919293946 unmodified lines1011021031041051061071081091101111121131141151161171181191201211221231241251261271281 unmodified line1301311321331341351361371381391401411421431441451461471481491501511521531541551561571 unmodified line1591601611621631641651661671681691701711721731741751761771781791801811821831841851865 unmodified lines1921931941951961971981992002012022032042052062072082092102112122132142151 unmodified line2172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712723 unmodified lines276277278279280281325 unmodified lines6076086096106116126136146153 unmodified lines"""import osimport uuidfrom datetime import datetime, timezonefrom typing import Dict, Any, List, Optional66 unmodified lines"label": "Variable","sublabel": "Variable (int/str/bool)","category": "Variables & Types","icon": "Box","iconColor": "text-blue-400","iconBg": "bg-blue-600","borderColor": "border-blue-500/40",5 unmodified lines"label": "Constant","sublabel": "Immutable Value","category": "Variables & Types","icon": "Box","iconColor": "text-cyan-400","iconBg": "bg-cyan-600","borderColor": "border-cyan-500/40",6 unmodified lines"name": "Input & Output","items": [{"id": "input_prompt","label": "Input Prompt","sublabel": "input(prompt)","category": "Input & Output","icon": "Terminal","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.primitive.input","defaultData": {"prompt": "Enter value: "},},{"id": "print_output","label": "Print / Output","sublabel": "print(*args)","category": "Input & Output","icon": "FileText","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.primitive.print","defaultData": {"message": "Execution finished"},},],},1 unmodified line"name": "Control Flow","items": [{"id": "if_condition","label": "If Condition","sublabel": "if condition:","category": "Control Flow","icon": "GitBranch","iconColor": "text-indigo-400","iconBg": "bg-indigo-600","borderColor": "border-indigo-500/40","nodeType": "alli.flow.if","defaultData": {"condition": "x > 0"},},{"id": "if_else","label": "If-Else Branch","sublabel": "if ... else:","category": "Control Flow","icon": "GitFork","iconColor": "text-indigo-400","iconBg": "bg-indigo-600","borderColor": "border-indigo-500/40","nodeType": "alli.flow.if_else","defaultData": {"condition": "score >= 50", "true_val": "pass", "false_val": "fail"},},],},1 unmodified line"name": "Loops & Iteration","items": [{"id": "for_loop","label": "For Loop","sublabel": "for item in iterable:","category": "Loops & Iteration","icon": "Repeat","iconColor": "text-purple-400","iconBg": "bg-purple-600","borderColor": "border-purple-500/40","nodeType": "alli.loop.for","defaultData": {"iterable": "range(10)", "iterator_var": "i"},},{"id": "while_loop","label": "While Loop","sublabel": "while condition:","category": "Loops & Iteration","icon": "RotateCw","iconColor": "text-purple-400","iconBg": "bg-purple-600","borderColor": "border-purple-500/40","nodeType": "alli.loop.while","defaultData": {"condition": "count < 5"},},],},5 unmodified lines"label": "Function Def","sublabel": "def func(*args):","category": "Functions & Scope","icon": "Cpu","iconColor": "text-yellow-400","iconBg": "bg-yellow-600","borderColor": "border-yellow-500/40","nodeType": "alli.function.def","defaultData": {"fn_name": "calculate_total", "args": "items, tax_rate=0.05"},},{"id": "return_val","label": "Return Value","sublabel": "return result","category": "Functions & Scope","icon": "CornerDownRight","iconColor": "text-yellow-400","iconBg": "bg-yellow-600","borderColor": "border-yellow-500/40","nodeType": "alli.function.return","defaultData": {"expression": "result"},},],},1 unmodified line"name": "Data Structures","items": [{"id": "list_array","label": "List / Array","sublabel": "list[T]","category": "Data Structures","icon": "List","iconColor": "text-rose-400","iconBg": "bg-rose-600","borderColor": "border-rose-500/40","nodeType": "alli.data.list","defaultData": {"items": "[1, 2, 3, 4, 5]"},},{"id": "dict_json","label": "Dict / JSON","sublabel": "dict[K, V]","category": "Data Structures","icon": "Braces","iconColor": "text-rose-400","iconBg": "bg-rose-600","borderColor": "border-rose-500/40","nodeType": "alli.data.json","defaultData": {"schema": '{"status": "ok", "code": 200}'},},],},{"name": "Error Handling","items": [{"id": "try_except","label": "Try-Except","sublabel": "try: ... except:","category": "Error Handling","icon": "ShieldAlert","iconColor": "text-amber-400","iconBg": "bg-amber-600","borderColor": "border-amber-500/40","nodeType": "alli.flow.try_except","defaultData": {"try_block": "result = 100 / divisor", "exception_type": "ZeroDivisionError", "fallback": "0"},},],},{"name": "Services & APIs","items": [{"id": "http_request","label": "HTTP Request","sublabel": "Call REST API Service","category": "Services & APIs","icon": "Globe","iconColor": "text-cyan-400","iconBg": "bg-slate-800",3 unmodified lines},],},]DEFAULT_STARTER_TEMPLATES = [325 unmodified lines{"$set": {"key": "python_core_categories", "categories": categories, "updated_at": get_utc_now()}},upsert=True)return Trueexcept Exception as e:print(f"[ALLI MongoDB] Core specs save error: {e}")# ─── TEMPLATES CATALOG (MONGODB ATLAS) ───────────────────────────────────def save_template(self, template_data: Dict[str, Any]) -> str:3 unmodified lines4567891066 unmodified lines777879808182835 unmodified lines899091929394956 unmodified lines1021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771 unmodified line1791801811821831841851861871881891901911921931941951961971981992002012022032042052061 unmodified line2082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462475 unmodified lines2532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643651 unmodified line3673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775783 unmodified lines582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705325 unmodified lines10311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810793 unmodified lines"""import osimport jsonimport uuidfrom datetime import datetime, timezonefrom typing import Dict, Any, List, Optional66 unmodified lines"label": "Variable","sublabel": "Variable (int/str/bool)","category": "Variables & Types","icon": "Variable","iconColor": "text-blue-400","iconBg": "bg-blue-600","borderColor": "border-blue-500/40",5 unmodified lines"label": "Constant","sublabel": "Immutable Value","category": "Variables & Types","icon": "Lock","iconColor": "text-cyan-400","iconBg": "bg-cyan-600","borderColor": "border-cyan-500/40",6 unmodified lines"name": "Input & Output","items": [{"id": "user_input","label": "User Input","sublabel": "input(prompt)","category": "Input & Output","icon": "TextCursorInput","iconColor": "text-indigo-400","iconBg": "bg-indigo-600","borderColor": "border-indigo-500/40","nodeType": "alli.primitive.input","defaultData": {"var_name": "text_prompt", "value": "Explain quantum computing in simple words.", "type_hint": "str"},},{"id": "file_input","label": "File Input / Output","sublabel": "open(file, mode)","category": "Input & Output","icon": "FileText","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.primitive.file","defaultData": {"filename": "data.csv", "mode": "r"},},{"id": "print_output","label": "Print Output","sublabel": "print(*objects, sep, end, file, flush)","category": "Input & Output","icon": "Terminal","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.primitive.print","defaultData": {"prefix": "Result:","sep": " ","end": "\\n","file_stream": "stdout","flush": False,"format_style": "standard",},},],},{"name": "Operators & Logic","items": [{"id": "binary_op","label": "Binary Operation","sublabel": "result = a + b","category": "Operators & Logic","icon": "Binary","iconColor": "text-violet-400","iconBg": "bg-violet-600","borderColor": "border-violet-500/40","nodeType": "alli.primitive.binary_op","defaultData": {"operator": "+", "a": "10", "b": "5"},},{"id": "compare","label": "Comparison","sublabel": "is_valid = (a == b)","category": "Operators & Logic","icon": "Scale","iconColor": "text-amber-400","iconBg": "bg-amber-600","borderColor": "border-amber-500/40","nodeType": "alli.primitive.compare","defaultData": {"operator": "==", "a": "10", "b": "10"},},],},1 unmodified line"name": "Control Flow","items": [{"id": "if_else","label": "If-Else","sublabel": "Condition (True/False)","category": "Control Flow","icon": "GitBranch","iconColor": "text-purple-400","iconBg": "bg-purple-600","borderColor": "border-purple-500/40","nodeType": "alli.flow.condition","defaultData": {"condition": "user_id >= 18"},},{"id": "match_case","label": "Match-Case","sublabel": "Pattern Match","category": "Control Flow","icon": "GitBranch","iconColor": "text-violet-400","iconBg": "bg-violet-600","borderColor": "border-violet-500/40","nodeType": "alli.flow.match","defaultData": {"match_var": "status", "cases": ["200", "404", "_"]},},],},1 unmodified line"name": "Loops & Iteration","items": [{"id": "loop_for","label": "For Loop","sublabel": "for item in iterable","category": "Loops & Iteration","icon": "Repeat","iconColor": "text-cyan-400","iconBg": "bg-cyan-600","borderColor": "border-cyan-500/40","nodeType": "alli.flow.for_loop","defaultData": {"loop_var": "item", "iterable": "range(5)"},},{"id": "loop_while","label": "While Loop","sublabel": "while condition:","category": "Loops & Iteration","icon": "Repeat","iconColor": "text-teal-400","iconBg": "bg-teal-600","borderColor": "border-teal-500/40","nodeType": "alli.flow.while_loop","defaultData": {"condition": "count < 10"},},{"id": "recursion","label": "Recursion","sublabel": "factorial(n)","category": "Loops & Iteration","icon": "ArrowLeftRight","iconColor": "text-violet-400","iconBg": "bg-violet-600","borderColor": "border-violet-500/40","nodeType": "alli.flow.recursion","defaultData": {"function_name": "factorial", "base_case": "n <= 1", "recursive_call": "n * factorial(n - 1)"},},],},5 unmodified lines"label": "Function Def","sublabel": "def func(*args):","category": "Functions & Scope","icon": "Code2","iconColor": "text-yellow-400","iconBg": "bg-yellow-600","borderColor": "border-yellow-500/40","nodeType": "alli.func.def","defaultData": {"func_name": "compute_metric", "params": "x, factor=2.5", "return_type": "float", "docstring": "Computes weighted metrics."},},{"id": "call_function","label": "Function Call","sublabel": "result = func(*args)","category": "Functions & Scope","icon": "PlayCircle","iconColor": "text-amber-400","iconBg": "bg-amber-600","borderColor": "border-amber-500/40","nodeType": "alli.func.call","defaultData": {"func_name": "compute_metric", "args": "50, factor=3.0", "target_var": "calc_result"},},{"id": "lambda_func","label": "Lambda Expr","sublabel": "lambda x: expr","category": "Functions & Scope","icon": "Zap","iconColor": "text-yellow-300","iconBg": "bg-yellow-500","borderColor": "border-yellow-400/40","nodeType": "alli.func.lambda","defaultData": {"var_name": "double_fn", "params": "x", "expression": "x * 2"},},{"id": "generator_yield","label": "Generator Yield","sublabel": "yield item","category": "Functions & Scope","icon": "IterationCw","iconColor": "text-amber-500","iconBg": "bg-amber-700","borderColor": "border-amber-600/40","nodeType": "alli.func.yield","defaultData": {"yield_value": "item", "is_from": False},},{"id": "recursion_guard","label": "Recursion Guard","sublabel": "max_depth protection","category": "Functions & Scope","icon": "ShieldCheck","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.func.recursion_guard","defaultData": {"max_depth": 50},},],},{"name": "OOP & Classes","items": [{"id": "class_def","label": "Class Definition","sublabel": "class Name(Bases):","category": "OOP & Classes","icon": "Layers","iconColor": "text-indigo-400","iconBg": "bg-indigo-600","borderColor": "border-indigo-500/40","nodeType": "alli.oop.class_def","defaultData": {"class_name": "DataPipeline", "bases": "", "docstring": "Orchestrates end-to-end data processing."},},{"id": "constructor_init","label": "Constructor (__init__)","sublabel": "def __init__(self, ...):","category": "OOP & Classes","icon": "Wrench","iconColor": "text-indigo-300","iconBg": "bg-indigo-700","borderColor": "border-indigo-600/40","nodeType": "alli.oop.constructor","defaultData": {"params": "name, buffer_size=1024", "init_attrs": "self.name = name\nself.buffer_size = buffer_size"},},{"id": "instance_method","label": "Instance Method","sublabel": "def method(self, ...):","category": "OOP & Classes","icon": "Workflow","iconColor": "text-purple-400","iconBg": "bg-purple-600","borderColor": "border-purple-500/40","nodeType": "alli.oop.method","defaultData": {"method_name": "execute", "params": "payload", "is_property": False, "return_expr": "f'{self.name} processed: {payload}'"},},{"id": "instantiate_obj","label": "Instantiate Object","sublabel": "obj = Class(*args)","category": "OOP & Classes","icon": "Box","iconColor": "text-violet-400","iconBg": "bg-violet-600","borderColor": "border-violet-500/40","nodeType": "alli.oop.instantiate","defaultData": {"var_name": "pipeline", "class_name": "DataPipeline", "args": "'Primary', buffer_size=2048"},},],},1 unmodified line"name": "Data Structures","items": [{"id": "list_struct","label": "List / Sequence","sublabel": "list[T] (Ordered & Dynamic)","category": "Data Structures","icon": "ListOrdered","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.ds.list","defaultData": {"var_name": "items_list", "operation": "create", "initial_items": "[10, 20, 30, 40]"},},{"id": "dict_struct","label": "Dictionary / Map","sublabel": "dict[K, V] (Hash Map)","category": "Data Structures","icon": "Braces","iconColor": "text-rose-400","iconBg": "bg-rose-600","borderColor": "border-rose-500/40","nodeType": "alli.ds.dict","defaultData": {"var_name": "config_map", "operation": "create", "initial_dict": '{"status": "active", "code": 200}'},},{"id": "tuple_struct","label": "Tuple / Record","sublabel": "(a, b) (Immutable & Unpack)","category": "Data Structures","icon": "Layers","iconColor": "text-indigo-400","iconBg": "bg-indigo-600","borderColor": "border-indigo-500/40","nodeType": "alli.ds.tuple","defaultData": {"var_name": "point_record", "val_a": "100", "val_b": "200"},},{"id": "set_struct","label": "Set / Unique","sublabel": "set{T} (Unique & Algebra)","category": "Data Structures","icon": "Boxes","iconColor": "text-teal-400","iconBg": "bg-teal-600","borderColor": "border-teal-500/40","nodeType": "alli.ds.set","defaultData": {"var_name": "unique_tags", "operation": "create", "initial_set": '{"alpha", "beta", "gamma"}'},},{"id": "comp_struct","label": "Comprehension","sublabel": "[x * 2 for x in seq]","category": "Data Structures","icon": "Sparkles","iconColor": "text-violet-400","iconBg": "bg-violet-600","borderColor": "border-violet-500/40","nodeType": "alli.ds.comprehension","defaultData": {"var_name": "transformed_list", "expr": "x * 2", "iterator": "x", "condition": "x > 0"},},{"id": "stack_queue_struct","label": "Stack & Queue","sublabel": "LIFO / FIFO Buffer","category": "Data Structures","icon": "Layers","iconColor": "text-cyan-400","iconBg": "bg-cyan-600","borderColor": "border-cyan-500/40","nodeType": "alli.ds.stack_queue","defaultData": {"var_name": "data_buffer", "mode": "stack"},},{"id": "sort_search_struct","label": "Sort & Reduction","sublabel": "sorted(seq) / len / min / max","category": "Data Structures","icon": "ArrowUpDown","iconColor": "text-amber-400","iconBg": "bg-amber-600","borderColor": "border-amber-500/40","nodeType": "alli.ds.sort_search","defaultData": {"var_name": "sorted_result", "algo": "sorted", "reverse": False},},],},{"name": "Exception Handling","items": [{"id": "try_block","label": "Try Block","sublabel": "try: (Protected)","category": "Exception Handling","icon": "ShieldAlert","iconColor": "text-rose-400","iconBg": "bg-rose-600","borderColor": "border-rose-500/40","nodeType": "alli.exc.try","defaultData": {"description": "Protected operations"},},{"id": "except_handler","label": "Except Handler","sublabel": "except Exception as err:","category": "Exception Handling","icon": "AlertTriangle","iconColor": "text-amber-400","iconBg": "bg-amber-600","borderColor": "border-amber-500/40","nodeType": "alli.exc.except","defaultData": {"exception_class": "Exception", "as_var": "err", "fallback_value": "None"},},{"id": "finally_block","label": "Finally Block","sublabel": "finally: (Cleanup)","category": "Exception Handling","icon": "CheckCircle2","iconColor": "text-slate-400","iconBg": "bg-slate-700","borderColor": "border-slate-600/40","nodeType": "alli.exc.finally","defaultData": {"cleanup_comment": "Guaranteed cleanup"},},{"id": "raise_exc","label": "Raise Exception","sublabel": "raise ValueError(msg)","category": "Exception Handling","icon": "Flame","iconColor": "text-red-400","iconBg": "bg-red-600","borderColor": "border-red-500/40","nodeType": "alli.exc.raise","defaultData": {"exception_class": "ValueError", "message": "Invalid parameter configuration supplied"},},{"id": "assert_stmt","label": "Assertion","sublabel": "assert condition, msg","category": "Exception Handling","icon": "AlertOctagon","iconColor": "text-rose-400","iconBg": "bg-rose-700","borderColor": "border-rose-600/40","nodeType": "alli.exc.assert","defaultData": {"condition": "len(items) > 0", "message": "Items collection must not be empty"},},],},{"name": "System & Libraries","items": [{"id": "sys_import","label": "Import Module","sublabel": "import math as alias","category": "System & Libraries","icon": "Package","iconColor": "text-cyan-400","iconBg": "bg-cyan-700","borderColor": "border-cyan-600/40","nodeType": "alli.sys.import","defaultData": {"module_name": "math", "alias": "math", "imported_items": ""},},{"id": "file_ops","label": "File Operations","sublabel": "with open(path, mode):","category": "System & Libraries","icon": "FileText","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.sys.file","defaultData": {"var_name": "file_data", "path": "data.txt", "mode": "r", "operation": "read", "encoding": "utf-8"},},{"id": "env_vars","label": "Environment Variable","sublabel": "os.getenv(key, default)","category": "System & Libraries","icon": "KeyRound","iconColor": "text-slate-300","iconBg": "bg-slate-800","borderColor": "border-slate-700/40","nodeType": "alli.sys.env","defaultData": {"var_name": "api_key", "key": "OPENAI_API_KEY", "default_val": "default_key_mock", "is_secret": True},},{"id": "logging_svc","label": "Logging Service","sublabel": "logging.info(msg)","category": "System & Libraries","icon": "Activity","iconColor": "text-blue-400","iconBg": "bg-blue-600","borderColor": "border-blue-500/40","nodeType": "alli.sys.logging","defaultData": {"level": "INFO", "message": "Processing pipeline step initiated"},},{"id": "http_request","label": "HTTP Request","sublabel": "Call REST API Service","category": "System & Libraries","icon": "Globe","iconColor": "text-cyan-400","iconBg": "bg-slate-800",3 unmodified lines},],},{"name": "Advanced Execution","items": [{"id": "async_def","label": "Async Function","sublabel": "async def coroutine():","category": "Advanced Execution","icon": "Radio","iconColor": "text-cyan-400","iconBg": "bg-cyan-600","borderColor": "border-cyan-500/40","nodeType": "alli.async.def","defaultData": {"func_name": "fetch_async_resource", "params": "endpoint", "docstring": "Asynchronously fetches remote resource."},},{"id": "async_await","label": "Await Expression","sublabel": "res = await coro","category": "Advanced Execution","icon": "Timer","iconColor": "text-cyan-300","iconBg": "bg-cyan-700","borderColor": "border-cyan-600/40","nodeType": "alli.async.await","defaultData": {"coroutine_expr": "fetch_async_resource('/api/v1/data')", "target_var": "async_result"},},{"id": "async_task","label": "Async Task","sublabel": "asyncio.create_task()","category": "Advanced Execution","icon": "Sparkles","iconColor": "text-indigo-400","iconBg": "bg-indigo-600","borderColor": "border-indigo-500/40","nodeType": "alli.async.task","defaultData": {"task_var": "bg_task", "task_name": "worker_pipeline", "coroutine_expr": "fetch_async_resource('/stream')"},},{"id": "async_context","label": "Async Context","sublabel": "async with / async for","category": "Advanced Execution","icon": "Workflow","iconColor": "text-teal-400","iconBg": "bg-teal-600","borderColor": "border-teal-500/40","nodeType": "alli.async.context","defaultData": {"statement_type": "async with", "expr": "httpx.AsyncClient()", "var_name": "client"},},],},{"name": "Standard Modules & Libraries","items": [{"id": "module_math","label": "Math Library","sublabel": "math.sqrt, pow, pi, ceil","category": "Standard Modules & Libraries","icon": "Calculator","iconColor": "text-emerald-400","iconBg": "bg-emerald-600","borderColor": "border-emerald-500/40","nodeType": "alli.primitive.math","defaultData": {"func": "sqrt", "x": "16", "y": "2"},},{"id": "module_datetime","label": "Datetime Library","sublabel": "datetime.now, strftime","category": "Standard Modules & Libraries","icon": "Calendar","iconColor": "text-cyan-400","iconBg": "bg-cyan-600","borderColor": "border-cyan-500/40","nodeType": "alli.primitive.datetime","defaultData": {"operation": "strftime", "format_pattern": "%Y-%m-%d %H:%M:%S"},},{"id": "module_random","label": "Random Generator","sublabel": "random.randint, choice","category": "Standard Modules & Libraries","icon": "Dices","iconColor": "text-purple-400","iconBg": "bg-purple-600","borderColor": "border-purple-500/40","nodeType": "alli.primitive.random","defaultData": {"func": "randint", "min_val": "1", "max_val": "100"},},{"id": "module_json","label": "JSON Serialization","sublabel": "json.dumps, loads","category": "Standard Modules & Libraries","icon": "FileJson","iconColor": "text-rose-400","iconBg": "bg-rose-600","borderColor": "border-rose-500/40","nodeType": "alli.primitive.json","defaultData": {"func": "dumps", "indent": 2},},{"id": "module_time","label": "Time & Clock","sublabel": "time.ctime, time, sleep","category": "Standard Modules & Libraries","icon": "Clock","iconColor": "text-amber-400","iconBg": "bg-amber-600","borderColor": "border-amber-500/40","nodeType": "alli.primitive.time","defaultData": {"func": "ctime"},},],},]DEFAULT_STARTER_TEMPLATES = [325 unmodified lines{"$set": {"key": "python_core_categories", "categories": categories, "updated_at": get_utc_now()}},upsert=True)except Exception as e:print(f"[ALLI MongoDB] Core specs save error: {e}")return False# ─── PYTHON FUNDAMENTALS CATALOG (MONGODB ATLAS) ─────────────────────────def get_python_fundamentals(self) -> Dict[str, Any]:"""Fetches dynamic Python fundamentals schema from MongoDB Atlas collection 'python_fundamentals' or fallback specs file."""if self.is_connected and self.client is not None:try:col = self.client[self.db_name]["python_fundamentals"]doc = col.find_one({"key": "python_fundamentals_schema"}, {"_id": 0})if doc and "constructs" in doc:return docexcept Exception as e:print(f"[ALLI MongoDB] Python fundamentals fetch error: {e}")# Fallback to backend specs filespec_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "specs", "python_fundamentals.json")if os.path.exists(spec_path):try:with open(spec_path, "r", encoding="utf-8") as f:return json.load(f)except Exception as e:print(f"[ALLI Specs] Could not read python_fundamentals.json: {e}")return {"version": "1.0.0", "constructs": []}def save_python_fundamentals(self, data: Dict[str, Any]) -> bool:"""Persists Python fundamentals schema into MongoDB Atlas collection 'python_fundamentals'."""if self.is_connected and self.client is not None:try:col = self.client[self.db_name]["python_fundamentals"]col.update_one({"key": "python_fundamentals_schema"},{"$set": {**data, "key": "python_fundamentals_schema", "updated_at": get_utc_now()}},upsert=True)return Trueexcept Exception as e:print(f"[ALLI MongoDB] Python fundamentals save error: {e}")return False# ─── TEMPLATES CATALOG (MONGODB ATLAS) ───────────────────────────────────def save_template(self, template_data: Dict[str, Any]) -> str:
205 unmodified lines206207208209210211205 unmodified linesreturn {"success": success, "count": len(payload.categories)}@app.get("/packages")def list_packages():"""Returns extracted library blueprints from MongoDB Atlas + standard library packages."""205 unmodified lines206207208209210211212213214215216217218219220221222223224225205 unmodified linesreturn {"success": success, "count": len(payload.categories)}# 1c. Python Fundamentals Catalog (Dynamic Backend Schema)@app.get("/python-fundamentals")def get_python_fundamentals():"""Returns the complete specification of Python language fundamentals, syntax, and arguments."""return workflow_repo.get_python_fundamentals()@app.post("/python-fundamentals")def save_python_fundamentals(payload: Dict[str, Any]):"""Persists updated Python fundamentals schema into MongoDB Atlas."""success = workflow_repo.save_python_fundamentals(payload)return {"success": success}@app.get("/packages")def list_packages():"""Returns extracted library blueprints from MongoDB Atlas + standard library packages."""
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283{ "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": [], "outputs": [ { "id": "value", "name": "Value", "type": "Any", "color": "emerald", "description": "The assigned variable reference" } ], "default_config": { "var_name": "hi", "value": "hello", "type_hint": "str" }, "arguments": [ { "name": "var_name", "type": "string", "label": "Variable Identifier", "description": "Valid Python variable name (PEP 8 snake_case)", "default": "hi" }, { "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": "Environment Variable", "category": "System & Libraries", "parent_category": "System & Libraries", "subcategory": "OS", "group_id": "system", "tags": [ "env", "os", "getenv", "secret" ], "syntax": "{var_name} = os.getenv('{key}', {default_val})", "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": { "var_name": "api_key", "key": "OPENAI_API_KEY", "default_val": "default_key_mock", "is_secret": true }, "arguments": [ { "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 } ] }, { "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." } ]}database/mongo.py+542-78
main.py+14
specs/python_fundamentals.jsonAdded+3283