pypyr.parser.dict
create a dict from key=value pair string
Takes a key=value pair string and returns a dictionary (aka a map) where each
pair becomes a dictionary element inside a dict with name argDict
.
Escape literal spaces with single or double quotes.
example
$ pypyr pipelinename param1=value1 param2="value 2" param3=value3
This will create a context dictionary like this:
{'argDict': {'param1': 'value1',
'param2': 'value 2',
'param3': 'value3'}}
Or to put in in yaml terms:
argDict:
param1: value1
param2: value 2
param3: value3
You can access the dict you create this way with formatting expressions:
context_parser: pypyr.parser.dict
steps:
- name: pypyr.steps.echo
in:
echoMe: param2 value is {argDict[param2]}