pharmaship.core.config

Core configuration functions.

pharmaship.core.config.load_config(content, schema)

Load the configuration from a YAML file.

Parameters
  • content (str) – string containing YAML data (from a config file)

  • schema (str) – schema filename, not path for validating the content

Returns

validated config dictionary or False

Return type

dict or bool

Example

>>> load_config(my_content, "config.json")
pharmaship.core.config.read_config()

Read Pharmaship configuration file.

Read the configuration from yaml source file, validate it against a schema and then convert it to Munch instance.

Returns

validated config Munch instance or False

Return type

Munch or bool

Example

>>> read_config()
pharmaship.core.config.write_config(data)

Write Pharmaship configuration file.

Parameters

data (Munch instance) – Data to write into the configuration file.

Returns

True is written with success.

Return type

bool

Example

>>> write_config(my_data)