Class YamlProfile

The YamlProfile class is the base class for loading YAML files and it’s basically used to get options from the file.

To see some usage examples you can look at the page Usage examples.

Constructor

class YamlProfile(filename: str)

Arguments

  • filename: YAML filename to load the specifications.

Usage example

import mumailer

yaml = mumailer.YamlProfile(filename='myfile.yaml')

Method get_option

YamlProfile.get_option(option: str, default: Any = None) -> Any:

The method get_option can be used to get an option from the YAML file by the option name and giving optionally a default value if the option is missing.

Arguments

  • option: option name
  • default: default value for missing option

Returns

  • The method returns the data from the YAML file