nirs4all.data.parsers.base module
Base parser interface for dataset configuration.
This module defines the abstract base class for configuration parsers. All parsers should inherit from BaseParser and implement the required methods.
- class nirs4all.data.parsers.base.BaseParser[source]
Bases:
ABCAbstract base class for configuration parsers.
Subclasses must implement: - can_parse(): Check if this parser can handle the input - parse(): Parse the input and return a ParserResult
- abstractmethod can_parse(input_data: Any) bool[source]
Check if this parser can handle the given input.
- Parameters:
input_data – The input to check.
- Returns:
True if this parser can handle the input, False otherwise.
- abstractmethod parse(input_data: Any) ParserResult[source]
Parse the input and return a configuration.
- Parameters:
input_data – The input to parse.
- Returns:
ParserResult with parsed configuration or errors.