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.

Files for pypework, version 0.8
Filename, size File type Python version Upload date Hashes
Filename, size pypework-0.8.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page