If Funcy and Pipe had a baby. Decorates all Funcy methods with Pipe superpowers.
Project description
Funcy with pipeline-based operators
If Funcy and Pipe had a baby. Deal with data transformation in python in a sane way.
Examples
import funcy_pipe as f
entities_from_sql_alchemy
| f.lmap(lambda r: r.to_dict())
| f.lmap(lambda r: r | f.omit(["id", "created_at", "updated_at"]))
| f.to_list
Extras
- to_list
- log
- bp
- sort
- exactly_one
- reduce
Module Alias
Create a module alias for funcy-pipe
to make things clean (import *
always irks me):
# fp.py
from funcy_pipe import *
# code py
import fp
Inspiration
- Elixir's pipe operator.
array |> map(fn) |> filter(fn)
- Ruby's enumerable library.
array.map(&:fn).filter(&:fn)
- https://pypi.org/project/funcy-chain
- https://github.com/JulienPalard/Pipe
TODO
- tests
- relax python version
- fix typing threading
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
funcy_pipe-0.4.0.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file funcy_pipe-0.4.0.tar.gz
.
File metadata
- Download URL: funcy_pipe-0.4.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.11.6 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9352c49e016d81fb6993878b93589c185f75bb6025c33ffd2586dacecd5eca87 |
|
MD5 | 26961041dbf196af6adfe54c11ffdbe1 |
|
BLAKE2b-256 | 22fbb93b6bdb8f5d1775e6b59107cede46d90950af93b69224a6c594b47f4140 |
File details
Details for the file funcy_pipe-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: funcy_pipe-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.11.6 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b517acc62c5198496861d85e408ba93da87db5756698a842a121dc6b3614d6da |
|
MD5 | 4757b19d06d48416fbd52e0ee854bd6c |
|
BLAKE2b-256 | b9036f180e2ca0a77b926d0d32d0f648add54cf50304fa2e1ba8f5adb21b7bf7 |