ReaderDispatcher

class pyprophet.io.dispatcher.ReaderDispatcher[source]

Bases: object

Dispatcher class to route I/O configuration to the appropriate reader implementation.

Based on the file_type and optionally the config context, this class instantiates and returns the correct reader (e.g., OSWReader, ParquetReader, SplitParquetReader).

Supported file types: - “osw” - “parquet” - “parquet_split” - “parquet_split_multi” - “tsv” (Note: only supported for scoring)

__weakref__

list of weak references to the object (if defined)

static get_reader(config)[source]

Return the appropriate reader instance based on the config’s file_type and context.

Parameters:

config (BaseIOConfig) – Configuration object with file_type, level, and context.

Returns:

An instance of a subclass of BaseReader suitable for the given input type.

Return type:

BaseReader

Raises:

ValueError – If an unsupported file type is provided.