Skip to content

Releases: anki-code/xontrib-pipeliner

0.5.0

05 Jun 14:36
37aa82f
Compare
Choose a tag to compare

Presets update.

Usage: <command> | <command> | ... | pl "<Python code or preset name>"
Example: echo "123" | pl "line[::-1]"
Example: echo " 123 " | pl strip
Presets:
  drop: Drop empty lines.
  len: 'len(line)'
  strip: 'line.strip()'
  lstrip: 'line.lstrip()'
  rstrip: 'line.rstrip()'
  split: func
  fromlist: Read python list representation and return the element by index.
  lower: 'line.lower()'
  upper: 'line.upper()'
  title: 'line.title()'
  startswith: func
  endswith: func

0.4.5

02 May 22:33
38772e9
Compare
Choose a tag to compare

Remove traceback

0.4.4

02 May 22:13
f954247
Compare
Choose a tag to compare

Print repr line.

0.4.3

03 Apr 11:29
ec4893a
Compare
Choose a tag to compare

Better help:

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

21 Feb 08:53
9963492
Compare
Choose a tag to compare

New preset list:

_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

14 Feb 12:17
fcde7ff
Compare
Choose a tag to compare

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

0.3.4

07 Apr 05:15
0650b18
Compare
Choose a tag to compare

plx

  • Print command to stderr instead of stdout.

0.3.3

03 Apr 05:55
Compare
Choose a tag to compare
  • Fix ppl command for Mac
  • Added "Known issues" for ppl command on Mac

0.3.2

18 Oct 20:19
Compare
Choose a tag to compare

Compiled python.

0.3.1

17 Oct 07:03
Compare
Choose a tag to compare

PyPi package maintenance.