Skip to main content

Functional pipeline library for Python

Project description

A library to add a neat, readable, functional pipeline syntax to Python.

It allows you to rewrite messy nested function calls such as this:

title_sanitized =
  replace(replace(replace(lowercase("Lorem Ipsum Dolor 2018/02/18"), " ", "_"), "/", "-"), "@", "at")

title_sanitized # -> "lorem_ipsum_dolor_2018-02-18"

In a far more readable format like this:

title_sanitized = (
  "Lorem Ipsum Dolor 2018/02/18"
    >> f.lowercase
    >> f.replace("/", "-")
    >> f.replace(" ", "_")
    >> f.replace("@", "at")

title_sanitized # -> "lorem_ipsum_dolor_2018-02-18"

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

pypework-0.8.tar.gz (2.6 kB view hashes)

Uploaded source

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