Python Pipe Operator
Project description
# HellP: Python Hell Pipe Helper
`pip install HellP` then:
Instead of `f(x)` Write `x | p(f)`
Instead of `p(lambda x: x.attr[item])` Write `px.attr[item]`
Instead of
```python
from pathlib import Path
print(' '.join(list(map(str, filter((lambda x: x.is_dir()), Path('/etc').glob('*'))))))
```
Write:
```
from pathlib import Path
from thep import p, px
Path('/etc') | p.filter(px.is_dir) | p.map(str) | p(list) | p(' '.join) | p(print)
```
`pip install HellP` then:
Instead of `f(x)` Write `x | p(f)`
Instead of `p(lambda x: x.attr[item])` Write `px.attr[item]`
Instead of
```python
from pathlib import Path
print(' '.join(list(map(str, filter((lambda x: x.is_dir()), Path('/etc').glob('*'))))))
```
Write:
```
from pathlib import Path
from thep import p, px
Path('/etc') | 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
hellp-0.0.1.tar.gz
(2.6 kB
view hashes)