queenbee.base.parser module

Parse workflow files from JSON / YAML files with support for import_from key.

queenbee.base.parser.parse_double_quote_workflow_vars(input: str) list[source]

Parse values between {{workflow.*}}

Parameters:

from (input {str} -- A string to parse doubled quoted vars) –

Returns:

list – A list of matched substrings (empty list if None)

queenbee.base.parser.parse_double_quotes_vars(input: str) list[source]

Parse values between {{ }}

Parameters:

from (input {str} -- A string to parse doubled quoted vars) –

Returns:

list – A list of matched substrings (empty list if None)

queenbee.base.parser.parse_file(input_file: str) dict[source]

Parse queenbee objects from an input JSON or YAML file.

This method will replace ‘import_from’ keys with the content from files recursively.

Parameters:

file. (input_file {str} -- A YAML or JSON input) –

Returns:

dict – The content of the input file as a dictionary.

queenbee.base.parser.replace_double_quote_vars(text: str, key: str, replace: str) str[source]

Take an input string with template keys and replace them

Parameters:
  • from (text {str} -- The string to replace values) –

  • replace (key {str} -- The key to match and) –

  • with (replace {str} -- The value to replace the matched key) –

Returns:

str – A string with replaced substrings