Skip to main content

Simple pipelines for python functions and methods

Project description

Cool Pipelines Library

A simple pipeline library for chaining methods and functions.

Installation

pip install cool_pipe

Usage

For functions:

from cool_pipe import pipe_fun

@pipe_fun
def a(a_):
    return a_ + 1

@pipe_fun
def b(b_):
    return b_ + 2

@pipe_fun
def c(c_, t=7):
    return c_ + 3 + t

result = 1 | a | b | c
print(result)

For methods:

from cool_pipe import PipeItem, PipeFinish, pipe_met

class A:
    def __init__(self, num: int):
        self.sum = PipeItem(num) | self.a | self.b | self.c | PipeFinish()

    @pipe_met
    def a(self, a_):
        return a_ + 1

    @pipe_met
    def b(self, b_):
        return b_ + 2

    @pipe_met
    def c(self, c_, t=5):
        return c_ + 3 + t

Aobj = A(5)
print(Aobj.sum)

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

cool_pipe-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

cool_pipe-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file cool_pipe-0.1.0.tar.gz.

File metadata

  • Download URL: cool_pipe-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for cool_pipe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4d0f887ed6d174b3cfc4878e9373b7d762f9a3ca54c5c5965ddabe2c53fc009
MD5 9796d28c1e9d3be8f5e444a95345adbc
BLAKE2b-256 96cbdd601953ce64086e94984485864f5a9364f6218054f3d7b3057733b9d89f

See more details on using hashes here.

File details

Details for the file cool_pipe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cool_pipe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for cool_pipe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 515d26709ea6e658f5c79eb21a563b5f27a4924a7792224a6f73ffc518d90870
MD5 d178a2b67b0a7a0ec65cef2d783cabe7
BLAKE2b-256 c3ebe1d2ee4c6c5d18980ca5a8cb348cca8b00b8671483d52c2873d4787ab0c0

See more details on using hashes here.

Supported by

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