{"id":17972402,"url":"https://github.com/andybrice/pypework","last_synced_at":"2025-10-08T06:03:20.731Z","repository":{"id":62582551,"uuid":"123143902","full_name":"andybrice/pypework","owner":"andybrice","description":"Functional pipeline library for Python","archived":false,"fork":false,"pushed_at":"2018-03-22T14:10:39.000Z","size":33,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T07:44:22.957Z","etag":null,"topics":["functional","functional-programming","pipeline","pipeline-framework","pipelines","pipes","python","syntactic-sugar"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andybrice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T14:52:42.000Z","updated_at":"2023-03-14T16:55:37.000Z","dependencies_parsed_at":"2022-11-03T21:57:10.848Z","dependency_job_id":null,"html_url":"https://github.com/andybrice/pypework","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrice%2Fpypework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrice%2Fpypework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrice%2Fpypework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrice%2Fpypework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andybrice","download_url":"https://codeload.github.com/andybrice/pypework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245462966,"owners_count":20619586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional","functional-programming","pipeline","pipeline-framework","pipelines","pipes","python","syntactic-sugar"],"created_at":"2024-10-29T16:14:35.599Z","updated_at":"2025-10-08T06:03:20.684Z","avatar_url":"https://github.com/andybrice.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pypework #\n\nPypework is a functional pipeline library for Python.\n\nIt allows you to rewrite messy nested function calls such as this:\n\n```python\ntitle_sanitized =\n  replace(replace(replace(lowercase(\"Lorem Ipsum Dolor 2018/02/18\"), \" \", \"_\"), \"/\", \"-\"), \"@\", \"at\")\n\ntitle_sanitized # -\u003e \"lorem_ipsum_dolor_2018-02-18\"\n```\n\nIn a far more readable format like this:\n\n```python\ntitle_sanitized = (\n  \"Lorem Ipsum Dolor 2018/02/18\"\n    \u003e\u003e f.lowercase\n    \u003e\u003e f.replace(\"/\", \"-\")\n    \u003e\u003e f.replace(\" \", \"_\")\n    \u003e\u003e f.replace(\"@\", \"at\")\n)\n\ntitle_sanitized # -\u003e \"lorem_ipsum_dolor_2018-02-18\"\n```\n\n## Installation ##\n\nInstall using PIP by running:\n\n```console\npip install pypework\n```\n\n## Usage ##\n\nImport using:\n\n```python\nimport pypework\n```\n\nInitialize by instantiating a Function Catcher with the current module's scope:\n\n```python\nf = pypework.FunctionCatcher(scope = __name__)\n```\n\nYou can now make any function call pipeable by adding `f.` before it. For example `lowercase()` becomes `f.lowercase`.\nTrailing parentheses are optional if the function has only one argument.\n\nUse the `\u003e\u003e` operator to pipe into the function like so:\n\n```python\n\"Lorem Ipsum\" \u003e\u003e f.lowercase # -\u003e \"lorem ipsum\"\n```\n\nOr chain together multiple functions into a pipeline:\n\n```python\n\"Lorem Ipsum\" \u003e\u003e f.lowercase \u003e\u003e f.replace(\" \", \"_\") # -\u003e \"lorem_ipsum\"\n```\n\nYou can also split a pipeline across multiple lines if you wrap it in parentheses:\n```python\n(\n  \"Lorem Ipsum\"\n    \u003e\u003e f.lowercase\n    \u003e\u003e f.replace(\" \", \"_\")\n)\n\n # -\u003e \"lorem_ipsum\"\n```\n\nOr by adding trailing backslashes:\n\n```python\n\"Lorem Ipsum\" \\\n  \u003e\u003e f.lowercase \\\n  \u003e\u003e f.replace(\" \", \"_\")\n\n # -\u003e \"lorem_ipsum\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybrice%2Fpypework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandybrice%2Fpypework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybrice%2Fpypework/lists"}