Stupid Simple Pipe
Project description
Stupid Simple Pipe
pip install sspipe
then:
x | p(f)
is equal tof(x)
x | p(f).attr[item](arg) + 2 | p(g)
is equal tog( f(x).attr[item](arg) + 2 )
(x | p(f)) | p(g)
is equal tox | (p(f) | p(g))
px
is equal top(lambda x: x)
Now, instead of
from pathlib import Path
print(' '.join(list(map(str, filter((lambda x: x.is_dir()), Path('/etc').glob('*'))))))
Write:
from sspipe import p, px
from pathlib import Path
Path('/etc').glob('*') | p.filter(px.is_dir()) | p.map(str) | p(list) | p(' '.join) | p(print)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sspipe-0.0.8.tar.gz
(3.9 kB
view hashes)
Built Distribution
sspipe-0.0.8-py3-none-any.whl
(4.2 kB
view hashes)