recipe.definition.json package

Submodules

recipe.definition.json.definition_v1 module

Defines the class for managing a recipe definition

class recipe.definition.json.definition_v1.RecipeDefinitionV1(definition=None, do_validate=False)

Bases: object

Represents a v1 recipe definition JSON

get_dict()

Returns the internal dictionary that represents this recipe definition

Returns:The internal dictionary
Return type:dict
recipe.definition.json.definition_v1.convert_job_to_v1_json(node)

Returns the v1 JSON dict for the given job node

Parameters:node (recipe.definition.node.JobNodeDefinition) – The job node
Returns:The v1 JSON dict for the node
Return type:dict
recipe.definition.json.definition_v1.convert_recipe_definition_to_v1_json(definition)

Returns the v1 recipe definition JSON for the given recipe definition

Parameters:definition (recipe.definition.definition.RecipeDefinition) – The recipe definition
Returns:The v1 recipe definition JSON
Return type:recipe.definition.json.definition_v1.RecipeDefinitionV1

recipe.definition.json.definition_v6 module

Manages the v6 recipe definition schema

class recipe.definition.json.definition_v6.RecipeDefinitionV6(definition=None, do_validate=False)

Bases: object

Represents a v6 recipe definition JSON

get_definition()

Returns the recipe definition represented by this JSON

Returns:The recipe definition
Return type:recipe.definition.definition.RecipeDefinition:
get_dict()

Returns the internal dictionary

Returns:The internal dictionary
Return type:dict
recipe.definition.json.definition_v6.convert_node_to_v6_json(node)

Returns the v6 JSON dict for the given node

Parameters:node (recipe.definition.node.NodeDefinition) – The node
Returns:The v6 JSON dict for the node
Return type:dict
recipe.definition.json.definition_v6.convert_recipe_definition_to_v6_json(definition)

Returns the v6 recipe definition JSON for the given recipe definition

Parameters:definition (recipe.definition.definition.RecipeDefinition) – The recipe definition
Returns:The v6 recipe definition JSON
Return type:recipe.definition.json.definition_v6.RecipeDefinitionV6
recipe.definition.json.definition_v6.filter_out_us(string)

Returns a string where all of the unicode ‘u’s have been removed. Used to remove the Us from strings that were converted from unicode to ascii. Needs to properly parse strings such as: * ‘var: u”test u’ u” test”.’ * ‘var: u”test u’ test’.’ * “var: u’teust’.”

Parameters:string (str) – The string to filter the ‘u’s out of.
Returns:The filtered string.
Return type:str

Module contents