{ "module": "hexa.generate_yaml", "content": { "path": "hexa.generate_yaml", "docstring": "Generate YAML spec (nested mapping form) from a hexa PortNode tree.", "objects": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.generate_yaml.annotations", "signature": "", "docstring": null }, "io": { "name": "io", "kind": "alias", "path": "hexa.generate_yaml.io", "signature": "", "docstring": null }, "Path": { "name": "Path", "kind": "alias", "path": "hexa.generate_yaml.Path", "signature": "", "docstring": null }, "Any": { "name": "Any", "kind": "alias", "path": "hexa.generate_yaml.Any", "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", "path": "hexa.generate_yaml.yaml", "signature": "", "docstring": null }, "MethodSpec": { "name": "MethodSpec", "kind": "class", "path": "hexa.generate_yaml.MethodSpec", "signature": "", "docstring": "Specification of a single abstract method.", "members": { "name": { "name": "name", "kind": "attribute", "path": "hexa.generate_yaml.MethodSpec.name", "signature": "", "docstring": null }, "args": { "name": "args", "kind": "attribute", "path": "hexa.generate_yaml.MethodSpec.args", "signature": "", "docstring": null }, "kwargs": { "name": "kwargs", "kind": "attribute", "path": "hexa.generate_yaml.MethodSpec.kwargs", "signature": "", "docstring": null } } }, "NestedConfig": { "name": "NestedConfig", "kind": "attribute", "path": "hexa.generate_yaml.NestedConfig", "signature": "", "docstring": null }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.generate_yaml.PortNode", "signature": "", "docstring": "A node in the hexa port tree.\n\nParameters\n----------\nname : str\n Slot name, e.g. ``\"parser\"``, ``\"amount_balance\"``.\nkind : str\n One of ``\"leaf\"``, ``\"port\"``, or ``\"parent\"``.\n - ``\"leaf\"``: no children (e.g. ``NumberPort``)\n - ``\"port\"``: has children (e.g. ``TransactionParserPort``)\n - ``\"parent\"``: the root of the tree (e.g. ``ExtractionPipeline``)\nport_cls : str\n ABC class name that gives this port its shape, e.g.\n ``\"TransactionParserPort\"``. Every port has a concrete typed shape.\nattributes : dict[str, ConfigValue]\n Annotated attributes: ``name -> type_expr`` for scalars, or a nested\n ``dict`` of sub-attributes (a struct) for grouped/structured values.\nchildren : list[PortNode]\n Nested port slots.\nmethods : dict[str, MethodSpec]\n Abstract methods keyed by method name.", "members": { "name": { "name": "name", "kind": "attribute", "path": "hexa.generate_yaml.PortNode.name", "signature": "", "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.generate_yaml.PortNode.port_cls", "signature": "", "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.generate_yaml.PortNode.kind", "signature": "", "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.generate_yaml.PortNode.attributes", "signature": "", "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.generate_yaml.PortNode.children", "signature": "", "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.generate_yaml.PortNode.methods", "signature": "", "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.generate_yaml.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.generate_yaml.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.generate_yaml.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } }, "generate_yaml": { "name": "generate_yaml", "kind": "function", "path": "hexa.generate_yaml.generate_yaml", "signature": "", "docstring": "Generate YAML source from a :class:`PortNode` tree.\n\nParameters\n----------\nnode : PortNode\n The root of the tree.\nout_path : str | Path | None\n Optional file path to write the generated source to.\n\nReturns\n-------\nstr\n The generated YAML source." } } } }