pypyr.steps.echo
write dynamic values to console output stdout
Echo (i.e print) the context value echoMe to the output.
For example, if you had a pipeline like this:
# ./mypipeline.yaml
context_parser: pypyr.parser.keyvaluepairs
steps:
- name: pypyr.steps.echoYou can run:
$ pypyr mypipeline "echoMe=Ceci n'est pas une pipe"Alternatively, if you had a pipeline like this:
# ./look-ma-no-params.yaml
steps:
- name: pypyr.steps.echo
comment: Output echoMe
in:
echoMe: Ceci n'est pas une pipeYou can run:
$ pypyr look-ma-no-paramsSupports string substitutions.
write complex objects to output
echo will serialize complex objects like dict or list to stdout for you.
# ./echo-list.yaml
steps:
- name: pypyr.steps.set
in:
set:
obj:
- item1
- item2
- item3
- name: pypyr.steps.echo
in:
echoMe: "This is a list: {obj}"When you run this pipeline, the list will serialize to human-readable form:
$ pypyr echo-list
This is a list: ['item1', 'item2', 'item3']If you want to dump context to output for troubleshooting purposes, debug is useful for pretty printing with more human readable indented formatting.
suppress echo output
echo prints to the NOTIFY (25) log-level. This means you won’t see echo
output if you set log-level higher than 25.
For example, pypyr mypype --log 30 will only show WARNING and ERROR log
messages, not any echo output.