{ "module": "hexa", "content": { "path": "hexa", "docstring": "Hexa: Type-declared dependency injection for Python.", "objects": { "check_matches": { "name": "check_matches", "kind": "module", "path": "hexa.check_matches", "signature": null, "docstring": "Verify that two hexa representations agree.", "members": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.check_matches.annotations", "signature": "", "docstring": null }, "Path": { "name": "Path", "kind": "alias", "path": "hexa.check_matches.Path", "signature": "", "docstring": null }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.check_matches.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.check_matches.PortNode.name", "signature": "", "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.check_matches.PortNode.port_cls", "signature": "", "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.check_matches.PortNode.kind", "signature": "", "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.check_matches.PortNode.attributes", "signature": "", "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.check_matches.PortNode.children", "signature": "", "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.check_matches.PortNode.methods", "signature": "", "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.check_matches.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.check_matches.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.check_matches.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } }, "parse_abc": { "name": "parse_abc", "kind": "function", "path": "hexa.check_matches.parse_abc", "signature": "", "docstring": "Parse an ABC Python module into a :class:`PortNode` tree.\n\nABC classes become port nodes. A nested-struct attribute is expressed as a\n``@dataclass`` annotation on an ABC port (e.g. ``source: ExtractionSource``\nwhere ``ExtractionSource`` is a ``@dataclass``); the dataclass's fields are\nexpanded into a nested ``attributes`` entry.\n\nParameters\n----------\nmodule_or_path : str | Path | Any\n A file path to a ``.py`` file, a module import string, or a loaded module.\n\nReturns\n-------\nPortNode\n The root node of the tree." }, "parse_yaml": { "name": "parse_yaml", "kind": "function", "path": "hexa.check_matches.parse_yaml", "signature": "", "docstring": "Parse a hexa YAML spec file into a :class:`PortNode` tree.\n\nParameters\n----------\npath : str | Path\n Path to the ``.yaml`` file.\n\nReturns\n-------\nPortNode\n The root node of the parsed tree.\n\nRaises\n------\nValueError\n On structural errors in the YAML." }, "check_matches": { "name": "check_matches", "kind": "function", "path": "hexa.check_matches.check_matches", "signature": "", "docstring": "Verify two representations agree.\n\nParameters\n----------\npath_a : str | Path\n Path to a .yaml or .py file.\npath_b : str | Path\n Path to a .yaml or .py file.\n\nReturns\n-------\nbool | list[str]\n True if they match exactly, otherwise a list of difference strings." } } }, "build": { "name": "build", "kind": "function", "path": "hexa.build", "signature": "", "docstring": "Recursively instantiate the port tree from annotations.\n\nParameters\n----------\ncls : type\n The root class to build (e.g. ``AxisExtractionPipeline``).\ninstances : dict, optional\n ``{slot_name: object}`` injected verbatim into every node whose\n annotations contain that name (runtime values — repos, handlers,\n clients — that must not be re-constructed). Applied to the whole\n tree by name.\nconfig : dict, optional\n ``{field_name: value}`` propagated by name to every node's annotated\n config fields (non-port attributes), replacing the default ``None``.\n\nReturns\n-------\ninstance\n A fully wired instance of ``cls`` and all its nested ports." }, "generate_abc": { "name": "generate_abc", "kind": "module", "path": "hexa.generate_abc", "signature": null, "docstring": "Generate _abc.py source from a hexa PortNode tree.", "members": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.generate_abc.annotations", "signature": "", "docstring": null }, "io": { "name": "io", "kind": "alias", "path": "hexa.generate_abc.io", "signature": "", "docstring": null }, "re": { "name": "re", "kind": "alias", "path": "hexa.generate_abc.re", "signature": "", "docstring": null }, "Path": { "name": "Path", "kind": "alias", "path": "hexa.generate_abc.Path", "signature": "", "docstring": null }, "NestedConfig": { "name": "NestedConfig", "kind": "attribute", "path": "hexa.generate_abc.NestedConfig", "signature": "", "docstring": null }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.generate_abc.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_abc.PortNode.name", "signature": "", "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.generate_abc.PortNode.port_cls", "signature": "", "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.generate_abc.PortNode.kind", "signature": "", "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.generate_abc.PortNode.attributes", "signature": "", "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.generate_abc.PortNode.children", "signature": "", "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.generate_abc.PortNode.methods", "signature": "", "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.generate_abc.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.generate_abc.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.generate_abc.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } }, "generate_abc": { "name": "generate_abc", "kind": "function", "path": "hexa.generate_abc.generate_abc", "signature": "", "docstring": "Generate ABC Python source from a :class:`PortNode` tree.\n\nParameters\n----------\nnode : PortNode\n The root of the parsed YAML (or generated) tree.\nout_path : str | Path | None\n Optional file path to write the generated source to.\n\nReturns\n-------\nstr\n The generated Python source code." } } }, "generate_yaml": { "name": "generate_yaml", "kind": "module", "path": "hexa.generate_yaml", "signature": null, "docstring": "Generate YAML spec (nested mapping form) from a hexa PortNode tree.", "members": { "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." } } }, "MethodSpec": { "name": "MethodSpec", "kind": "class", "path": "hexa.MethodSpec", "signature": "", "docstring": "Specification of a single abstract method.", "members": { "name": { "name": "name", "kind": "attribute", "path": "hexa.MethodSpec.name", "signature": "", "docstring": null }, "args": { "name": "args", "kind": "attribute", "path": "hexa.MethodSpec.args", "signature": "", "docstring": null }, "kwargs": { "name": "kwargs", "kind": "attribute", "path": "hexa.MethodSpec.kwargs", "signature": "", "docstring": null } } }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.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.PortNode.name", "signature": "", "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.PortNode.port_cls", "signature": "", "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.PortNode.kind", "signature": "", "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.PortNode.attributes", "signature": "", "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.PortNode.children", "signature": "", "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.PortNode.methods", "signature": "", "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } }, "parse_abc": { "name": "parse_abc", "kind": "module", "path": "hexa.parse_abc", "signature": null, "docstring": "Parse an ABC Python module into a hexa PortNode tree.", "members": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.parse_abc.annotations", "signature": "", "docstring": null }, "dataclasses": { "name": "dataclasses", "kind": "alias", "path": "hexa.parse_abc.dataclasses", "signature": "", "docstring": null }, "importlib": { "name": "importlib", "kind": "alias", "path": "hexa.parse_abc.importlib", "signature": "", "docstring": null }, "inspect": { "name": "inspect", "kind": "alias", "path": "hexa.parse_abc.inspect", "signature": "", "docstring": null }, "sys": { "name": "sys", "kind": "alias", "path": "hexa.parse_abc.sys", "signature": "", "docstring": null }, "ABC": { "name": "ABC", "kind": "alias", "path": "hexa.parse_abc.ABC", "signature": "", "docstring": null }, "Path": { "name": "Path", "kind": "alias", "path": "hexa.parse_abc.Path", "signature": "", "docstring": null }, "Any": { "name": "Any", "kind": "alias", "path": "hexa.parse_abc.Any", "signature": "", "docstring": null }, "ConfigValue": { "name": "ConfigValue", "kind": "attribute", "path": "hexa.parse_abc.ConfigValue", "signature": "", "docstring": null }, "MethodSpec": { "name": "MethodSpec", "kind": "class", "path": "hexa.parse_abc.MethodSpec", "signature": "", "docstring": "Specification of a single abstract method.", "members": { "name": { "name": "name", "kind": "attribute", "path": "hexa.parse_abc.MethodSpec.name", "signature": "", "docstring": null }, "args": { "name": "args", "kind": "attribute", "path": "hexa.parse_abc.MethodSpec.args", "signature": "", "docstring": null }, "kwargs": { "name": "kwargs", "kind": "attribute", "path": "hexa.parse_abc.MethodSpec.kwargs", "signature": "", "docstring": null } } }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.parse_abc.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.parse_abc.PortNode.name", "signature": "", "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.parse_abc.PortNode.port_cls", "signature": "", "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.parse_abc.PortNode.kind", "signature": "", "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.parse_abc.PortNode.attributes", "signature": "", "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.parse_abc.PortNode.children", "signature": "", "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.parse_abc.PortNode.methods", "signature": "", "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.parse_abc.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.parse_abc.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.parse_abc.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } }, "parse_abc": { "name": "parse_abc", "kind": "function", "path": "hexa.parse_abc.parse_abc", "signature": "", "docstring": "Parse an ABC Python module into a :class:`PortNode` tree.\n\nABC classes become port nodes. A nested-struct attribute is expressed as a\n``@dataclass`` annotation on an ABC port (e.g. ``source: ExtractionSource``\nwhere ``ExtractionSource`` is a ``@dataclass``); the dataclass's fields are\nexpanded into a nested ``attributes`` entry.\n\nParameters\n----------\nmodule_or_path : str | Path | Any\n A file path to a ``.py`` file, a module import string, or a loaded module.\n\nReturns\n-------\nPortNode\n The root node of the tree." } } }, "parse_yaml": { "name": "parse_yaml", "kind": "module", "path": "hexa.parse_yaml", "signature": null, "docstring": "Parse a hexa YAML spec into a :class:`PortNode` tree.\n\nThe YAML grammar uses a nested mapping format built from three member kinds:\n\n- **attribute**: a ``name: type`` scalar (e.g. ``source_type: str``)\n- **nested struct**: a ``name:`` mapping of sub-attributes (e.g. ``source:``)\n- **port**: a ``name:`` mapping whose single key is a class whose value is a\n body, or a class key with a ``...`` body. A port carries a class shape.\n\nExample::\n\n RootClassName:\n attr: type # scalar attribute\n source: # nested struct (all scalar sub-attributes)\n source_type: str\n bank: str\n methods: # reserved block of functions\n run:\n args: [a, b]\n ingest: # port (single non-scalar class key)\n IngestPort:\n source_type: str\n methods: {Method: ...}\n\nDisambiguation of a mapping value:\n A mapping with exactly one key whose value is a non-scalar body (a mapping,\n ``...``, or a list) is a **port**. Any other mapping (multiple keys, or all\n scalar-typed values) is a **nested struct** of attributes.\n\nSee ``samples/minimal/sample.yaml`` and\n``samples/extraction_pipeline/extraction_pipeline.yaml`` for examples.", "members": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.parse_yaml.annotations", "signature": "", "docstring": null }, "Path": { "name": "Path", "kind": "alias", "path": "hexa.parse_yaml.Path", "signature": "", "docstring": null }, "Any": { "name": "Any", "kind": "alias", "path": "hexa.parse_yaml.Any", "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", "path": "hexa.parse_yaml.yaml", "signature": "", "docstring": null }, "ConfigValue": { "name": "ConfigValue", "kind": "attribute", "path": "hexa.parse_yaml.ConfigValue", "signature": "", "docstring": null }, "MethodSpec": { "name": "MethodSpec", "kind": "class", "path": "hexa.parse_yaml.MethodSpec", "signature": "", "docstring": "Specification of a single abstract method.", "members": { "name": { "name": "name", "kind": "attribute", "path": "hexa.parse_yaml.MethodSpec.name", "signature": "", "docstring": null }, "args": { "name": "args", "kind": "attribute", "path": "hexa.parse_yaml.MethodSpec.args", "signature": "", "docstring": null }, "kwargs": { "name": "kwargs", "kind": "attribute", "path": "hexa.parse_yaml.MethodSpec.kwargs", "signature": "", "docstring": null } } }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.parse_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.parse_yaml.PortNode.name", "signature": "", "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.parse_yaml.PortNode.port_cls", "signature": "", "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.parse_yaml.PortNode.kind", "signature": "", "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.parse_yaml.PortNode.attributes", "signature": "", "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.parse_yaml.PortNode.children", "signature": "", "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.parse_yaml.PortNode.methods", "signature": "", "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.parse_yaml.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.parse_yaml.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.parse_yaml.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } }, "parse_yaml": { "name": "parse_yaml", "kind": "function", "path": "hexa.parse_yaml.parse_yaml", "signature": "", "docstring": "Parse a hexa YAML spec file into a :class:`PortNode` tree.\n\nParameters\n----------\npath : str | Path\n Path to the ``.yaml`` file.\n\nReturns\n-------\nPortNode\n The root node of the parsed tree.\n\nRaises\n------\nValueError\n On structural errors in the YAML." } } }, "cli": { "name": "cli", "kind": "module", "path": "hexa.cli", "signature": null, "docstring": "Command-line interface for hexa utilities.", "members": { "argparse": { "name": "argparse", "kind": "alias", "path": "hexa.cli.argparse", "signature": "", "docstring": null }, "sys": { "name": "sys", "kind": "alias", "path": "hexa.cli.sys", "signature": "", "docstring": null }, "Path": { "name": "Path", "kind": "alias", "path": "hexa.cli.Path", "signature": "", "docstring": null }, "pprint": { "name": "pprint", "kind": "alias", "path": "hexa.cli.pprint", "signature": "", "docstring": null }, "check_matches": { "name": "check_matches", "kind": "function", "path": "hexa.cli.check_matches", "signature": "", "docstring": "Verify two representations agree.\n\nParameters\n----------\npath_a : str | Path\n Path to a .yaml or .py file.\npath_b : str | Path\n Path to a .yaml or .py file.\n\nReturns\n-------\nbool | list[str]\n True if they match exactly, otherwise a list of difference strings." }, "generate_abc": { "name": "generate_abc", "kind": "function", "path": "hexa.cli.generate_abc", "signature": "", "docstring": "Generate ABC Python source from a :class:`PortNode` tree.\n\nParameters\n----------\nnode : PortNode\n The root of the parsed YAML (or generated) tree.\nout_path : str | Path | None\n Optional file path to write the generated source to.\n\nReturns\n-------\nstr\n The generated Python source code." }, "generate_yaml": { "name": "generate_yaml", "kind": "function", "path": "hexa.cli.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." }, "parse_abc": { "name": "parse_abc", "kind": "function", "path": "hexa.cli.parse_abc", "signature": "", "docstring": "Parse an ABC Python module into a :class:`PortNode` tree.\n\nABC classes become port nodes. A nested-struct attribute is expressed as a\n``@dataclass`` annotation on an ABC port (e.g. ``source: ExtractionSource``\nwhere ``ExtractionSource`` is a ``@dataclass``); the dataclass's fields are\nexpanded into a nested ``attributes`` entry.\n\nParameters\n----------\nmodule_or_path : str | Path | Any\n A file path to a ``.py`` file, a module import string, or a loaded module.\n\nReturns\n-------\nPortNode\n The root node of the tree." }, "parse_yaml": { "name": "parse_yaml", "kind": "function", "path": "hexa.cli.parse_yaml", "signature": "", "docstring": "Parse a hexa YAML spec file into a :class:`PortNode` tree.\n\nParameters\n----------\npath : str | Path\n Path to the ``.yaml`` file.\n\nReturns\n-------\nPortNode\n The root node of the parsed tree.\n\nRaises\n------\nValueError\n On structural errors in the YAML." }, "main": { "name": "main", "kind": "function", "path": "hexa.cli.main", "signature": "", "docstring": null } } }, "container": { "name": "container", "kind": "module", "path": "hexa.container", "signature": null, "docstring": "Container to build a wired hexa pipeline from annotations.", "members": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.container.annotations", "signature": "", "docstring": null }, "inspect": { "name": "inspect", "kind": "alias", "path": "hexa.container.inspect", "signature": "", "docstring": null }, "UnionType": { "name": "UnionType", "kind": "alias", "path": "hexa.container.UnionType", "signature": "", "docstring": null }, "Any": { "name": "Any", "kind": "alias", "path": "hexa.container.Any", "signature": "", "docstring": null }, "TypeVar": { "name": "TypeVar", "kind": "alias", "path": "hexa.container.TypeVar", "signature": "", "docstring": null }, "T": { "name": "T", "kind": "attribute", "path": "hexa.container.T", "signature": null, "docstring": null }, "build": { "name": "build", "kind": "function", "path": "hexa.container.build", "signature": "", "docstring": "Recursively instantiate the port tree from annotations.\n\nParameters\n----------\ncls : type\n The root class to build (e.g. ``AxisExtractionPipeline``).\ninstances : dict, optional\n ``{slot_name: object}`` injected verbatim into every node whose\n annotations contain that name (runtime values — repos, handlers,\n clients — that must not be re-constructed). Applied to the whole\n tree by name.\nconfig : dict, optional\n ``{field_name: value}`` propagated by name to every node's annotated\n config fields (non-port attributes), replacing the default ``None``.\n\nReturns\n-------\ninstance\n A fully wired instance of ``cls`` and all its nested ports." } } }, "model": { "name": "model", "kind": "module", "path": "hexa.model", "signature": null, "docstring": "Shared neutral model for hexa port trees.\n\nAll utilities (``parse_yaml``, ``generate_abc``, ``parse_abc``,\n``generate_yaml``, ``check_matches``) serialize through this single model.\nIt is NOT tied to any sample — any port tree fits.", "members": { "annotations": { "name": "annotations", "kind": "alias", "path": "hexa.model.annotations", "signature": "", "docstring": null }, "dataclass": { "name": "dataclass", "kind": "alias", "path": "hexa.model.dataclass", "signature": "", "docstring": null }, "field": { "name": "field", "kind": "alias", "path": "hexa.model.field", "signature": "", "docstring": null }, "NestedConfig": { "name": "NestedConfig", "kind": "attribute", "path": "hexa.model.NestedConfig", "signature": null, "docstring": null }, "ConfigValue": { "name": "ConfigValue", "kind": "attribute", "path": "hexa.model.ConfigValue", "signature": null, "docstring": null }, "MethodSpec": { "name": "MethodSpec", "kind": "class", "path": "hexa.model.MethodSpec", "signature": "", "docstring": "Specification of a single abstract method.", "members": { "name": { "name": "name", "kind": "attribute", "path": "hexa.model.MethodSpec.name", "signature": null, "docstring": null }, "args": { "name": "args", "kind": "attribute", "path": "hexa.model.MethodSpec.args", "signature": null, "docstring": null }, "kwargs": { "name": "kwargs", "kind": "attribute", "path": "hexa.model.MethodSpec.kwargs", "signature": null, "docstring": null } } }, "PortNode": { "name": "PortNode", "kind": "class", "path": "hexa.model.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.model.PortNode.name", "signature": null, "docstring": null }, "port_cls": { "name": "port_cls", "kind": "attribute", "path": "hexa.model.PortNode.port_cls", "signature": null, "docstring": null }, "kind": { "name": "kind", "kind": "attribute", "path": "hexa.model.PortNode.kind", "signature": null, "docstring": null }, "attributes": { "name": "attributes", "kind": "attribute", "path": "hexa.model.PortNode.attributes", "signature": null, "docstring": null }, "children": { "name": "children", "kind": "attribute", "path": "hexa.model.PortNode.children", "signature": null, "docstring": null }, "methods": { "name": "methods", "kind": "attribute", "path": "hexa.model.PortNode.methods", "signature": null, "docstring": null }, "find": { "name": "find", "kind": "function", "path": "hexa.model.PortNode.find", "signature": "", "docstring": "Find a direct child by slot name." }, "walk": { "name": "walk", "kind": "function", "path": "hexa.model.PortNode.walk", "signature": "", "docstring": "Return all nodes in depth-first order (self first)." }, "diff": { "name": "diff", "kind": "function", "path": "hexa.model.PortNode.diff", "signature": "", "docstring": "Return a list of human-readable difference strings.\n\nAn empty list means the trees are equal." } } } } } } } }