speasy.config package
speasy.config
Configuration module for SPEASY, it reads or sets config entries first from ENV then from config file.
- class speasy.config.ConfigEntry(key1: str, key2: str, default: Any = '', type_ctor=None, description: str = '')[source]
Bases:
object
Configuration entry class. Used to set and get configuration values.
- Attributes:
- key1: str
Module or category name
- key2: str
Entry name
- default: str
Default value
- type_ctor: Any
function called to get value from string repr
- env_var_name: str
Environment variable name to use to set this entry
Methods
get:
Get entry current value
set:
Set entry value (could be env or file)
- speasy.config.remove_entry(entry: ConfigEntry)[source]
Deletes entry from config file and its section if it was the last entry
- Parameters:
- entry: ConfigEntry
the entry to delete
- Returns:
- None