loader
attribute
logger= logging.getLogger(__name__)
func
load_specs_from_directoryload_specs_from_directory(directory, /, registry, *, recursive=True, strict=False, patterns=None) -> list[Component[Any]]
Traverse directory recursively and load YAML files, creating corresponding components based on kind.
Args: directory: Directory path to traverse registry: Registry instance for node creation recursive: Whether to traverse subdirectories strict: Whether to enforce strict validation patterns: File patterns to match (default: [".yaml", ".yml"])
Returns: List of loaded components
Raises: YamlLoaderError: When there's an error loading YAML files FileNotFoundError: When directory doesn't exist
param
directorystr | Path
param
registryRegistry
param
recursivebool
= True
param
strictbool
= False
param
patternslist[str] | None
= None
Returns
list[Component[Any]]
func
_find_yaml_files_find_yaml_files(directory, /, recursive, patterns) -> list[Path]
Find YAML files in directory using multiple patterns.
param
directoryPath
param
recursivebool
param
patternslist[str]
Returns
list[Path]
func
_load_nodes_from_yaml_load_nodes_from_yaml(yaml_file, /, registry, strict) -> list[Component[Any]]
Load nodes from a YAML file that may contain single or multiple documents.
param
yaml_filePath
param
registryRegistry
param
strictbool
Returns
list[Component[Any]]
func
_create_node_from_yaml_data_create_node_from_yaml_data(yaml_data, /, yaml_file, registry, strict) -> Component[Any] | None
Create a node from YAML data.
param
yaml_dataAny
param
yaml_filePath
param
registryRegistry
param
strictbool
Returns
Component[Any] | None
Last updated on