python的函数管道库
pypework的Python项目详细描述
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"