Skip to main content

Stupid Simple Pipe

Project description

# Stupid Simple Pipe

`pip install sspipe` then:

* `x | p(f)` is equal to `f(x)`
* `x | p(f).attr[item](arg) + 2 | p(g)` is equal to `g( f(x).attr[item](arg) + 2 )`
* `(x | p(f)) | p(g)` is equal to `x | (p(f) | p(g))`
* `px` is equal to `p(lambda x: x)`

Now, instead of

```python
from pathlib import Path

print(' '.join(list(map(str, filter((lambda x: x.is_dir()), Path('/etc').glob('*'))))))
```

Write:

```python
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


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.2.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

sspipe-0.0.2-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page