dpyverification.datasources.base#

Module with the base class that all datasources should inherit from.

Classes

BaseDatasource(config)

Class to inherit from, defines the required methods and attributes.

BaseDatasourceConfig(*, import_adapter, ...)

Base config for a datasource config.

class dpyverification.datasources.base.BaseDatasource(config)[source]#

Class to inherit from, defines the required methods and attributes.

Parameters:

config (BaseDatasourceConfig)

kind: str = ''#
config_class#

alias of BaseDatasourceConfig

supported_data_types: ClassVar[set[DataType]] = {}#
property data_type: str#

Whether the instance represents sim or obs data.

abstractmethod fetch_data()[source]#

Fetch data from datasource.

Return type:

Self

get_data()[source]#

Get cached data, or fetch and cache.

Return type:

Self

class dpyverification.datasources.base.BaseDatasourceConfig(*, import_adapter, source, data_type, general, id_mapping=None, **extra_data)[source]#

Base config for a datasource config.

Specific config definitions should inherit from this base class.

Parameters:
  • import_adapter (str)

  • source (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_]*$), MinLen(min_length=1)])

  • data_type (DataType)

  • general (Annotated[GeneralInfoConfig, SkipJsonSchema()])

  • id_mapping (Annotated[IdMappingConfig, SkipJsonSchema()] | None)

  • extra_data (Any)

import_adapter: str#
source: ", metadata=[MinLen(min_length=1)])]#
data_type: DataType#
general: Annotated[GeneralInfoConfig, SkipJsonSchema()]#
id_mapping: Annotated[IdMappingConfig, SkipJsonSchema()] | None#
property forecast_periods: ForecastPeriods#
property verification_period: TimePeriod#
property verification_period_on_frt: TimePeriod#
property verification_period_on_time: TimePeriod#