flambe.utils.config

Module Contents

flambe.utils.config.generate_config_from_template(template_path: str, config_path: str, remove_comments: bool = False, **template_kwargs: Dict[str, str])[source]
Parameters:
  • template_path (str) – The path to the config template
  • config_path (str) – The path to which the rendered config should be written
  • remove_comments (bool) – If True, removes comments from the rendered config before writing it to disk
  • template_kwargs – Keyword arguments to pass to your template, e.g. path=’config.yaml’, foo=’bar’
  • config (Example) –
  • ```yaml
  • !Experiment
  • foo (pickles) – baz: {{ skittles }}
  • ```
  • saved as config.yaml.template, then invoking (If) –
  • ```python
  • generate_config_from_template('config.yaml.template', – ‘config.yaml’, bar=’pickles’, skittles=’yum’)
  • ```
  • following config will be written to 'config.yaml' (the) –
  • ```yaml
  • !Experiment
  • foo – baz: yum
  • ```