Skip to content

0.4.1

Compare
Choose a tag to compare
@anki-code anki-code released this 14 Feb 12:17
· 25 commits to master since this release
fcde7ff

Added presets.

Presets

There are default presets:

echo "  1" | pl strip
# 1

echo "1,2,3" | pl split ,
['1', '2', '3']

echo "a,b,c" | pl split , | pl list 0
# a

You can set your own presets:

$XONTRIB_PIPELINER_PRESETS = {
    "upper": "line.upper()",
    "repeat": lambda args: f"line*int({repr(args[0])})"
}

echo 'hello' | pl upper
# HELLO

echo 'hey \nhi ' | pl repeat 3
# hey hey hey
# hi hi hi