Xontrib-pipeliner

Latest version: v0.4.3

Safety actively analyzes 621706 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.4.3

Better help:
xsh
pl
Error: Python code not found
Usage: <command> | <command> | ... | pl "<Python code>"
Example: echo "123" | pl "line[::-1]"
Example: echo " 123 " | pl strip
Presets:
len: 'len(line)'
strip: 'line.strip()'
lstrip: 'line.lstrip()'
rstrip: 'line.rstrip()'
split: func
list: func
lower: 'line.lower()'
upper: 'line.upper()'
title: 'line.title()'
startswith: func
endswith: func

0.4.2

New preset list:
xsh
_default_presets = {
"len": "len(line)",
"strip": "line.strip()",
"lstrip": "line.lstrip()",
"rstrip": "line.rstrip()",
"split": lambda args: f"line.split({repr(args[0])})",
"list": lambda args: f"eval(line)[int({repr(args[0])})]",
"lower": "line.lower()",
"upper": "line.upper()",
"title": "line.title()",
"startswith": lambda args: f"line.startswith({repr(args[0])})",
"endswith": lambda args: f"line.endswith({repr(args[0])})",
}

0.4.1

Added presets.

Presets

There are default presets:
xsh
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:
xsh
$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

0.3.4

**plx**
* Print command to stderr instead of stdout.

0.3.3

* Fix `ppl` command for Mac
* Added "Known issues" for `ppl` command on Mac

0.3.2

Compiled python.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.