Skip to main content

Extended pipes for functional programming

Project description

morepipes

Based on the pipe library, adding more utilities and pipes to it

Some pipes are inspired by other programming languages (eg Rust)

Installation

pip install morepipes

Examples

Consume iterable

range(9) | where(lambda x: x % 2) | collect(list)
# List of odd numbers

Side effects

range(9) | ... | inspect | ...
# Prints out each object received on evaluation

Or, more generally

range(9) | ... | foreach(print) | ...

New: Partial Pipes

Creating a partial pipe

reverse_sort = P | reverse | sort
# P is a special object placeholder

Using a partial pipe

[1, 3, 4, 2] | reverse_sort
# Just like any other pipe

Have fun!

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

morepipes-1.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

morepipes-1.0.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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