msticpy.common.pkg_config module
Package configuration reader.
Reads default configuration from package file msticpyconfig.yaml. Optionally reads custom configuration from file specified in environment variable MSTICPYCONFIG. If this is not defined the package will look for a file msticpyconfig.yaml in the current directory.
Default settings are accessible as an attribute default_settings. Custom settings are accessible as an attribute custom_settings. Consolidated settings are accessible as an attribute settings.
- msticpy.common.pkg_config.current_config_path() Optional[str]
Return the path of the current config file, if any.
- Returns
path of the current config file
- Return type
Optional[str]
- msticpy.common.pkg_config.get_config(setting_path: str) Any
Return setting item for path.
- Parameters
setting_path (str) – Path to setting item expressed as dot-separated string
- Returns
The item at the path location.
- Return type
Any
- msticpy.common.pkg_config.get_http_timeout(**kwargs) Timeout
Return timeout from settings or overridden in kwargs.
- msticpy.common.pkg_config.refresh_config()
Re-read the config settings.
- msticpy.common.pkg_config.set_config(setting_path: str, value: Any)
Set setting value for path.
- Parameters
setting_path (str) – Path to setting item expressed as dot-separated string
value (Any) – The value to set.
- msticpy.common.pkg_config.validate_config(mp_config: Optional[Dict[str, Any]] = None, config_file: Optional[str] = None)
Validate msticpy config settings.
- Parameters
mp_config (Dict[str, Any], optional) – The settings dictionary, by default it will check the currently loaded settings.
config_file (str) – path to config file to check, by default None