setParser

Provide utilities to parse and read properties from set files.

lvpyioTools.setParser.read_property(key: str, value: str)[source]

Read a property from the set file and convert it to the appropriate type and property key.

Parameters:
  • key (str) – The property key from the set file.

  • value (str) – The property value from the set file.

Returns:

A tuple containing the property key as a SetProperty enum member (or None if unknown) and the converted property value (or None if conversion failed).

Return type:

tuple[SetProperty | None, Any]

lvpyioTools.setParser.read(file: Path) → dict[SetProperty, Any][source]

Read the contents of a set file and extract its properties.

Parameters:

file (Path) – The path to the file to read.

Returns:

A dictionary containing the set properties and their values.

Return type:

dict[SetProperty, Any]