Let your pipe lines flow thru the Python code in xonsh.
BSD-2-CLAUSE License
plx
Published by anki-code over 3 years ago
ppl
command for Macppl
command on MacPublished by anki-code about 4 years ago
Compiled python.
Published by anki-code about 4 years ago
PyPi package maintenance.
Published by anki-code about 4 years ago
New experimental feature - syntax highlighting using xonsh prompt:
If you're using xonsh prompt and want to use pipeliner with syntax highlighting instead of string there is experimental
feature that catch pl @(<python>)
calls and uses the expression from the xonsh python substitution as pipeliner argument.
Example:
echo echo | pl @(line + '!')
# In the xonsh prompt it's equals to:
echo echo | pl "line + '!'"
Published by anki-code about 4 years ago
Now you can begin the pipe from Python head:
pl "'\\n'.join(list('ABCDEFG'))" | pl "line + ('!' if num%2 else '?')" | grep '!'
B!
D!
F!
Published by anki-code about 4 years ago
Package maintenance
Published by anki-code about 4 years ago
Docs improvement.
Published by anki-code about 4 years ago
Added plx
and pplx
commands to run execx(f"{plx_command}")
most shorter way.
For example when you want to rename files you can do it Pythonic way:
$ mkdir -p /tmp/plx-test && cd /tmp/plx-test
$ touch 111 222 333 && ls
111 222 333
$ ls | plx "mv {line} prefix-{line}"
mv 111 prefix-111
mv 222 prefix-222
mv 333 prefix-333
$ ls
prefix-111 prefix-222 prefix-333
Echo example:
$ ls | plx 'echo {line} # {num}'
echo prefix-111 # 0
prefix-111
echo prefix-222 # 1
prefix-222
echo prefix-333 # 2
prefix-333
Published by anki-code about 4 years ago
None
(NoneType
). It also makes the output of pl "execx(...)"
more clear.Published by anki-code about 4 years ago
Bump package update
Published by anki-code about 4 years ago
Added catching trivial errors
Published by anki-code about 4 years ago
Fix dependency
Published by anki-code about 4 years ago
Github Actions bump
Published by anki-code about 4 years ago
Fix dependency
Published by anki-code about 4 years ago
Added exception processing in ppl
Published by anki-code about 4 years ago
Added showing the line that rises exception to pl
:
$ echo "1;2\n3;4\nqwe" > test.txt
$ cat test.txt
1;2
3;4
qwe
$ cat test.txt | pl "line.split(';')[1]"
IndexError: list index out of range
2
4
Error line 3: qwe
Published by anki-code over 4 years ago
Fixed multicore context
Published by anki-code over 4 years ago
ppl
commandPublished by anki-code over 4 years ago