solidipes.scanners.scanner module
- class solidipes.scanners.scanner.DictTree(*args, **kwargs)[source]
Bases:
dict- filter(value_filter: ~typing.Callable = <function DictTree.<lambda>>, keys_join_func: ~typing.Callable[[list[str]], str] = <function DictTree.<lambda>>, joined_keys_filter: ~typing.Callable = <function DictTree.<lambda>>, keep_empty_dicts: bool = False, keys: list[str] = []) DictTree[source]
Filter the tree based on the values and keys. Both filters must be satisfied.
- flatten(value_func: ~typing.Callable = <function DictTree.<lambda>>, keys_join_func: ~typing.Callable[[list[str]], str] = <function DictTree.<lambda>>, add_dicts: bool = False, dict_func: ~typing.Callable = <function DictTree.<lambda>>, keys: list[str] = []) dict[source]
Flatten the tree into a flat dictionary.
- class solidipes.scanners.scanner.ExportScanner(root_path: str = '.')[source]
Bases:
ScannerA scanner that keeps the .solidipes directory. Individual paths inside .solidipes can still be excluded.
- class solidipes.scanners.scanner.ProgressBar(*args, **kwargs)[source]
Bases:
Protocol- _abc_impl = <_abc._abc_data object>
- _is_protocol = True
- total: float
- class solidipes.scanners.scanner.Scanner(root_path: str = '.')[source]
Bases:
objectA class to scan a directory to load files and groups.
All paths are given relative to the scanner’s root path.
- get_filtered_loader_dict(dirs: list[str] = [], recursive: bool = True) dict[str, File | Group][source]
Get a dictionary mapping paths (potentially grouped) to loaders.
- get_filtered_loader_tree(dirs: list[str] = [], recursive: bool = True) DictTree[source]
Get a tree of loaders for the given directories.
- class solidipes.scanners.scanner.StreamlitProgressBar(text, container=None)[source]
Bases:
ProgressBar- _abc_impl = <_abc._abc_data object>
- _is_protocol = False
- solidipes.scanners.scanner.cached_scan(func: Callable) Callable[source]
Decorator to cache the result of the scan.
Adds a “force_rescan” parameter to the decorated function. Assumes that the result of the scan only depends on root_path and excluded_patterns.
- solidipes.scanners.scanner.convert_filepath_tree_to_loader_tree(tree: DictTree, root_path: str, progress_bar: ProgressBar | None = None) DictTree[source]
Convert a tree of filepaths to a tree of loaders, while detecting file groups.