spines.config.config

Primary configuration interface

spines.config.config.get_config(setting: str = _MISSING, default: Any = _MISSING) → spines.config.core.Config[source]

Get the global spines configuration

Parameters
  • setting (str, optional) – Setting(s) to get from the global configuration.

  • default (optional) – Value to return if setting is not set (if not given an error will occur if accessing a non-existant setting).

Returns

The global configuration settings for the current spines project or the values for the settings given.

Return type

Config or dict

Raises

ValueError – If the given setting(s) doesn’t exist and no default value is provided.

spines.config.config.load_config(*path, update: bool = False) → None[source]

Loads the global spines configuration

Parameters
  • path (str (or multiple), optional) – File(s) to load the configuration from (defaults to the correct spines hierarchy for configuration files).

  • update (bool, optional) – Update the current configuration as opposed to replacing it with the newly loaded on (default is False, replace it).

spines.config.config.set_config(section: Optional[str] = None, **settings) → None[source]

Sets global configuration setting(s)

Parameters
  • section (str, optional) – Configuration section to set settings in.

  • settings – The setting(s) in the global configuration to update.

spines.config.config.temp_config(section: str = None, **settings) → None[source]

Temporary configuration context manager

Parameters
  • section (str, optional) – Configuration section to set settings in.

  • settings – Setting(s) to change within the managed context on the global configuration.