Parse Abc
hexa.parse_abc
Summary
Parse an ABC Python module into a hexa PortNode tree.
ABC classes become port nodes. A nested-struct attribute is expressed as a
@dataclass annotation on an ABC port (e.g. source: ExtractionSource
where ExtractionSource is a @dataclass); the dataclass's fields are
expanded into a nested attributes entry.
Notes
- Accepts a file path, a module import string, or an already-loaded module.
Classes
Functions
parse_abc
Parse an ABC Python module into a :class:PortNode tree.
ABC classes become port nodes. A nested-struct attribute is expressed as a
@dataclass annotation on an ABC port (e.g. source: ExtractionSource
where ExtractionSource is a @dataclass); the dataclass's fields are
expanded into a nested attributes entry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module_or_path |
str | Path | Any
|
A file path to a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PortNode |
PortNode
|
The root node of the tree. |