The pipe-operator to python |>

This page summarizes the projects mentioned and recommended in the original post on /r/Python

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • lisa

    Linux Integrated System Analysis

  • import builtins from operator import add import functools # These functions can be found at: # https://github.com/ARM-software/lisa/blob/master/lisa/utils.py#L147 # Note: my implementation of curry() seems to be broken wrt named parameters (or for parameters with defaults, haven't looked at the details) for some reason but for this example it does not matter from lisa.utils import compose, curry def even(x): return x % 2 == 0 # The builtin functions don't have a signature, which will upset curry() so we # redefine it here def map(f, iterable): return builtins.map(f, iterable) def filter(f, iterable): return builtins.filter(f, iterable) # Swapped init and iterable to be curry-friendly def reduce(f, init, iterable): return functools.reduce(f, iterable, init) def pipeline(*items): # Add a currying layer so that we spare the user the need to do it return compose(*(curry(f)(*args) for (f, *args) in items)) # x = filter(even, list) |> map(lambda x: x+1) |> reduce(+) f = pipeline( (filter, even), (map, lambda x: x+1), (reduce, add, 0), ) l = [1,2,3,4] x = f(l) print(x)

  • awesome-functional-python

    A curated list of awesome things related to functional programming in Python.

  • https://github.com/sfermigier/awesome-functional-python#libraries

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • PyFunctional

    Python library for creating data pipelines with chain functional programming

  • proposals

    Tracking ECMAScript Proposals

  • I also think that adding a pipe operator directly in the language would be interesting. Most functional oriented languages have it, and there is an ecmascript proposal with experimental support in firefox.

  • RxPY

    ReactiveX for Python

  • As one of the developers of RxPy, I think this would allow all streaming libraries to cohabit together, like AsyncIO did for asynchronous programming in python.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts