Configuration Module#

SPDX-FileCopyrightText: 2024 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2

exception core.configuration.ConfigError#

Bases: Exception

Exception class for general issues with the configuration.

class core.configuration.Configuration(config: dict[str, Any] | None = None)#

Bases: object

Class to track configuration variables and requests.

get_applied() dict[str, Any]#

Return a dictionary of all used configuration items.

get_dict() dict[str, Any]#

Returns the dictionary held by the configuration.

get_json() str#

Return JSON-encoded configuration data.

get_keys() list[str]#

Return list of keys in configuration.

get_unused_keys() set[str]#

Return all unused configuration keys

has_unused_values() bool#

Check if any unused configuration keys exist.

setdefault(key: str, default: Any = None) Any#

Return value from requested key in configuration with default value if specified. Mark key as requested in configuration.

update(config: dict[str, Any], unused_keys: set[str]) None#

Update the configuration with a new dict.

core.configuration.flatten_config(config: dict[str, Any], sat_class: str, sat_name: str | None = None) dict[str, Any]#

Get configuration of satellite. Specify category to only get part of configuration.

core.configuration.load_config(path: str) dict[str, Any]#

Load a TOML configuration from file.

core.configuration.make_lowercase(obj: dict[str, Any]) dict[str, Any]#

Recursively lower-case all keys of a nested dictionary.