Sayori is a tiny library for composing pure functions using pipeline notation. If f and g are functions then f | g is a function such that (f | g)(x) = g(f(x)).
pip install sayoriSayori exports a simple decorator called Composable which implements the pipe operator. It can be used as follows:
from sayori import ComposableCreate two composable functions...
f = Composable(lambda x: x + 1)
g = Composable(lambda x: x * 2)Compose them...
h = f | gApply the composite...
h(2) # returns 6