Skip to main content

Functional Pipeline

PyPI version pipeline status coverage report PyPI Documentation Status

Functional languages like Haskell, Elixir, and Elm have pipe functions that allow the results of one function to be passed to the next function.

Using functions from functools, we can build composition in python, however it is not nearly as elegant as a well thought out pipeline.

This library is designed to make the creation of a functional pipeline easier in python.

>>> from operator import add, mul

>>> from functional_pipeline import pipeline, tap

>>> result = pipeline(
...     10,
...     [
...         (add, 1),
...         (mul, 2)
...     ]
... )

>>> result
22

This pattern can be extended for easily dealing with lists or generators.

>>> from functional_pipeline import pipeline, String, join

>>> names = [
...     "John",
...     "James",
...     "Bill",
...     "Tiffany",
...     "Jamie",
... ]

>>> result = pipeline(
...     names,
...     [
...         (filter, String.startswith('J')),
...         (map, lambda x: x + " Smith"),
...         join(", "),
...     ]
... )

>>> result
'John Smith, James Smith, Jamie Smith'

Metadata

Release files for functional-pipeline 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for functional-pipeline 0.6.1
File Interpreter ABI Platform Actions
functional_pipeline-0.6.1-py3-none-any.whl Python 3 none any Details for functional_pipeline-0.6.1-py3-none-any.whl

Release files / functional_pipeline-0.6.1-py3-none-any.whl

Download URL functional_pipeline-0.6.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdda3bccfb42cfc6393ae3e895a196e6f7041d80d698748403406a81d70cba22
BLAKE2b-256 checksum
How to use checksums
095c1315e5b1f498c953fbf3c20e17c1bbfb5fefcc648bc46638ef64d58d7f97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Security for functional-pipeline 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page