Python with pipes, utils, and pipe utils
Project description
Pipe Utils
Python with pipes, utils, and pipe utils.
Install
pip install pipe-utils
Docs
Example
from pipe_utils import *
words = "I just think pipes are neat"
result = (
Pipe(words)
| str.lower
| str.split
| group_by(len)
| sorted_dict
).get()
print(result)
# {1: ['i'], 3: ['are'], 4: ['just', 'neat'], 5: ['think', 'pipes']}
And, if you're feeling dangerous, override builtin functions
like filter
, map
, and all
by importing from pipe-utils.override
:
from pipe_utils.override import *
data = [[1, -3, 4], [1, 2, 3], [2, 3, 4], [5, -1, 4]]
result = (
Pipe(data)
| filter(all(it >= 0))
| map(sum_by(it * it))
| list
).get()
print(result) # [14, 29]
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
pipe-utils-0.2.2.tar.gz
(21.4 kB
view hashes)
Built Distribution
pipe_utils-0.2.2-py3-none-any.whl
(14.7 kB
view hashes)
Close
Hashes for pipe_utils-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ac17bd64c2f81a00c880fe61fc61cc21e3ba12dfe59316629aeb958298463e |
|
MD5 | 83a3dddb93d330355ebaac6811fe4014 |
|
BLAKE2b-256 | a236e58ae1eeb243261c2e9da30e27fa88b44b99c27addaf576a4d42b4069d61 |