flexmeasures.api.v3_0.sources

Functions

flexmeasures.api.v3_0.sources.data_generator_source_filter(name: str)

Match the sources computed by the named data generator, or by a subclass of it (see installed_data_generator_models).

Which data generator made a source is told by its model, as its type follows the data (see AggregatorReporter.source_type). The name itself is matched, too, so the sources of a data generator whose plugin is no longer installed are still found by its own name. The type still has to be a kind of data generator, as a source of another type (e.g. a script) can carry such a model name, too.

flexmeasures.api.v3_0.sources.installed_data_generator_models(name: str) → set[str]

List the models of the installed data generators of the named class or of a subclass of it, lowercased, as sources record them.

The name is matched case-insensitively against each registered data generator and the classes it inherits from, so reporter names the base class Reporter, and with it every reporter.

flexmeasures.api.v3_0.sources.source_search_term_filter(term: str)

Match a search term against what identifies a source: its name, its model and its id.

Classes

class flexmeasures.api.v3_0.sources.SourceAPI
get(id: int)

Get one data source, including its attributes.

index(only_latest: bool = True, filter: list[str] | None = None, type: str | None = None, model: str | None = None, data_generator: str | None = None, limit: int | None = None)

List accessible data sources and defined source types.

class flexmeasures.api.v3_0.sources.SourceQuerySchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
validate_data_generator(name: str, **kwargs)

Refuse a name that is neither an installed data generator nor the model of a source the user can list, such as a typo.

An uninstalled data generator’s sources are still found by its name, and an installed one without sources lists none.