Skip to main content

Functional piping for Python. ➡️

Project description

➡️ Pipe fp

Functional piping for Python.

Simple ⬦ Clear ⬦ Concise

GitHub Actions Workflow Status PyPI - Version PyPI - Python Version


Background

Piping is a method targeting code composition style, taking input data and passing it through a series of functions to produce a final output data.

Usage

Pipe fp is a tool to compose code in a simple, clear, and concise manner.

Features

  • Composable pipelines; build it.
  • Lazy evaluation; call any time later.
  • Lambda functions with type hinting via generics! ✨

Example

Without Generics

from pipe_fp import pipe


pipe(
  str.lower,
  str.title,
  str.split
)('WHY, HELLO THERE! 🐰')

Returns

['Why,', 'Hello', 'There!', '🐰']

Using Generics

from pipe_fp import pipe


# msg will be of type str; not Any! 😲
pipe[str](
  lambda msg: msg.lower(),
  lambda msg: msg.title(),
  lambda msg: msg.split()
)('WHY, HELLO THERE! 🐰')

Returns

['Why,', 'Hello', 'There!', '🐰']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipe_fp-2.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipe_fp-2.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pipe_fp-2.0.0.tar.gz.

File metadata

  • Download URL: pipe_fp-2.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for pipe_fp-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d635517352022d5601af88db4b51059b1cfa5f7cb3cbaaae508c4a38a8dca45b
MD5 05563d3657c5de67d97394a0947b2899
BLAKE2b-256 90c6b9f0b9c9d49b74b76860daf86404f3b6198af4faf0a103b44d767a57e33b

See more details on using hashes here.

File details

Details for the file pipe_fp-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pipe_fp-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for pipe_fp-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1eee653077d6ff442dfc4b7aecf503edb0ba33a199785d7ab3414531e3b2eb
MD5 3768ab32564b656748433e5e1286fc20
BLAKE2b-256 9542013550aaaded6142e810079178185382461b4863a20603a390bee9d97214

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page