silo.low_code_steps.standard.arg_parser module

class silo.low_code_steps.standard.arg_parser.YAMLArgParser(subs, rc)

Bases: ArgParser

SUPPORTED_VERSION = {'1.0': <function process_v1_0>, '2.0': <function process_v2_0>}
call(snippet_arg)

Convert a YAML snippet argument into a consumable format for the framework

The YAML object should contain a root element, low_code, and no other root elements. The sub-section, network, is required to have a usable format. The sub-section, processing, is optional. Each section defines steps in the following format:

  • Key / Value: The section contains one step

  • List: The section contains multiple steps

A step definition has the following requirements:

  • String: There is no configuration for the step [csv]

  • Key / Value (string) - The key is the step and the value is the action arg

    [csv: type=dict]

  • Dictionary - There are multiple configuration options. The action argument will be

    specified in the key “arg”, but is optional. Any other configuration will be specified by any other key / value pair.

An example would be as follows:

low_code:
  id: collect_id
  network:
      static_value:
        arg: '{"data": "value"},{"data2": "value2"},{"data3": "value3"}'
  processing:
      - csv
      - simple_key: 0
      - simple_key: 1
      - json
      - simple_key:
          cool: "beans"
          arg: "data2"
Parameters

snippet_arg (str) – Snippet arguments after substitution

Returns

Dictionary that instructs the framework on the order of steps to execute.

Return type

dict

static get_desc()
static get_name()