command line pipe style for python
Project description
code like this: pipe(1) | float | str | list | done !
Install
pip install pipeto
API
- pipe(arg)generate a pipable object pipe to next function.@param : arg {mixed}
- done(arg)get the actural value out of pipable object
- compose(fn)Compose functions. Can be used as a decorator.@alias : composable@param : fn {callable}
example
from pipeto import *
import operator as op
inc = lambda x: x + 1
double = lambda x: x + x
# pipe
pipe(1) | float | str | list | done # == ['1', '.', '0']
pipe(2) | inc | done # == 3
pipe(2) | inc | double | done # == 6
pipe([1,2,3]) | sum | done # == 6
# compose
newfn = compose(inc) | double
newfn(2) # == double(inc(2))
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
pipeto-0.2.1.tar.gz
(2.3 kB
view details)
File details
Details for the file pipeto-0.2.1.tar.gz
.
File metadata
- Download URL: pipeto-0.2.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b5fcb914b8346dd0466d53c3def773a7483b39bc4faabd771c51d712c954b907
|
|
MD5 |
56d5e02a6f9614a2ba6b5ad400705261
|
|
BLAKE2b-256 |
d150235cd11653a5ed0dbae42a97d383e772ee1b87564db56da11dcbc058e2c8
|