ogd.core.generators package

Subpackages

Submodules

ogd.core.generators.Generator module

class ogd.core.generators.Generator.Generator(params: GeneratorParameters)[source]

Bases: ABC

static AvailableModes() List[ExtractionMode][source]

List of ExtractionMode supported by the Extractor

Base function to give a list of which ExtractionModes an extractor will handle. :return: _description_ :rtype: List[ExtractionMode]

property CountIndex: int | None[source]
property Description: str[source]
classmethod EventFilter(mode: ExtractionMode) List[str][source]
property ExtractionMode: ExtractionMode[source]
classmethod FeatureFilter(mode: ExtractionMode) List[str][source]
static MaxVersion() str | None[source]
Base function to get the maximum log version the feature can handle.

A value of None will set no maximum, so all levels are accepted (unless a min is set). Typically default to None, unless the feature is not compatible with new data and is only kept for legacy purposes. The versions of data accepted by a feature are a responsibility of the Feature’s developer, so this is a required part of interface instead of a config item in the schema.

Returns:

[description]

Return type:

Optional[str]

static MinVersion() str | None[source]
Base function to get the minimum log version the feature can handle.

A value of None will set no minimum, so all levels are accepted (unless a max is set). Typically default to None, unless there is a required element of the event data that was not added until a certain version. The versions of data accepted by a feature are a responsibility of the Feature’s developer, so this is a required part of interface instead of a config item in the schema.

Returns:

[description]

Return type:

Optional[str]

property Name: str[source]
UpdateFromEvent(event: Event)[source]
static WarningMessage(message: str)[source]

Simple wrapper for the Logger in utils, makes it easier for subclasses to print warning messages without extra imports.

Parameters:

message (str) – The warning message to print

class ogd.core.generators.Generator.GeneratorParameters(name: str, description: str, mode: ExtractionMode, count_index: int | None)[source]

Bases: object

Dumb struct to hold the data that should be available to every Generator. This just makes it easier to add/manage any new params, so that we don’t need to change the param list for hundreds of individual extractor subclasses every time something changes.

ogd.core.generators.GeneratorLoader module

class ogd.core.generators.GeneratorLoader.GeneratorLoader(player_id: str, session_id: str, game_schema: GameSchema, mode: ExtractionMode, feature_overrides: List[str] | None)[source]

Bases: ABC

GetBuiltinFeatureClass(feature_type: str) Type[BuiltinExtractor] | None[source]
GetFeatureClass(feature_type: str) Type[Extractor] | None[source]
LoadDetector(detector_type: str, name: str, schema_args: Dict[str, Any], trigger_callback: Callable[[Event], None], count_index: int | None = None) Detector | None[source]
LoadFeature(feature_type: str, name: str, schema_args: Dict[str, Any], count_index: int | None = None) Extractor | None[source]

Module contents