msticpy.data.core.data_query_reader module

Data query definition reader.

msticpy.data.core.data_query_reader.find_yaml_files(source_path: str, recursive: bool = True) Iterable[Path]

Return iterable of yaml files found in source_path.

Parameters:
  • source_path (str) – The source path to search in.

  • recursive (bool, optional) – Whether to recurse through subfolders. By default False

Returns:

File paths of yaml files found.

Return type:

Iterable[str]

msticpy.data.core.data_query_reader.read_query_def_file(query_file: str) Tuple[Dict, Dict, Dict]

Read a yaml data query definition file.

Parameters:

query_file (str) – Path to yaml query definition file

Returns:

Tuple of dictionaries. sources - dictionary of query definitions defaults - the default parameters from the file metadata - the global metadata from the file

Return type:

Tuple[Dict, Dict, Dict]

msticpy.data.core.data_query_reader.validate_query_defs(query_def_dict: Dict[str, Any]) bool

Validate content of query definition.

Parameters:

query_def_dict (dict) – Dictionary of query definition yaml file contents.

Returns:

True if validation succeeds.

Return type:

bool

Raises:

ValueError – The validation failure reason is returned in the exception message (arg[0])