{"id":30737459,"url":"https://github.com/chriso345/pipette","last_synced_at":"2025-09-03T21:16:26.339Z","repository":{"id":309029533,"uuid":"1033127416","full_name":"ChrisO345/pipette","owner":"ChrisO345","description":"Functional programming for Python","archived":false,"fork":false,"pushed_at":"2025-08-09T10:08:34.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-09T12:09:52.762Z","etag":null,"topics":["currying","functional-programming","monads","pipeline","pipette","pipette-fp","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pipette-fp/","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/ChrisO345.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-06T10:40:37.000Z","updated_at":"2025-08-09T10:09:49.000Z","dependencies_parsed_at":"2025-08-09T12:10:13.467Z","dependency_job_id":"b0f8cf30-5133-4b3b-b0c7-b03225f1ae1c","html_url":"https://github.com/ChrisO345/pipette","commit_stats":null,"previous_names":["chriso345/pipette"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ChrisO345/pipette","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisO345%2Fpipette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisO345%2Fpipette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisO345%2Fpipette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisO345%2Fpipette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChrisO345","download_url":"https://codeload.github.com/ChrisO345/pipette/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisO345%2Fpipette/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273511109,"owners_count":25118661,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["currying","functional-programming","monads","pipeline","pipette","pipette-fp","python"],"created_at":"2025-09-03T21:16:24.908Z","updated_at":"2025-09-03T21:16:26.322Z","avatar_url":"https://github.com/ChrisO345.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pipette\n\n`pipette` is a lightweight, expressive Python library designed to enable clean, functional-style data processing pipelines with intuitive syntax and powerful composition.\n\nNote that due to the limitations of Python's static typing, some features may not provide type hints as expected. However, the library is designed to be flexible and easy to use, even without strict type enforcement.\n\n---\n\n## Features\n\n`pipette` is currently in early development, but it already includes:\n- Lazy evaluation for efficient data processing.\n- Support for custom transformations using the `@pipette` decorator.\n- Core functional utilities like `select`, `where`, `reduce`, `sort_by`, and more.\n- Currying support for partial function application.\n- Basic monad implementation for chaining operations with error handling.\n\n---\n\n## Installation\n\n`pipette` can be installed via pip from the Python Package Index (PyPI):\n\n```bash\npip install pipette-fp\n```\n\nAlternatively, you can install the latest development version of `pipette` directly from GitHub:\n\n```bash\npip install git+https://github.com/chriso345/pipette\n```\n\n## Usage\n\n`pipette` aims to make functional pipelines clear and concise.\n```python\nfrom pipette import where, select, into\n\ndata = [\n    {\"active\": True, \"value\": 10},\n    {\"active\": False, \"value\": 5},\n    {\"active\": True, \"value\": 7},\n]\n\nresult = (\n    data\n    | where(lambda x: x[\"active\"])\n    | select(lambda x: x[\"value\"])\n    | into(list)\n)\n\nprint(result)  # Output: [10, 7]\n```\n\nCustom transformations can easily be added to extend functionality:\n```python\nfrom pipette import pipette\n\n@pipette\ndef double(x):\n    return builtins.map(lambda n: n * 2, x)\n\nresult = (\n    [1, 2, 3, 4]\n    | double\n    | into(list)\n)\n\nprint(result)  # Output: [2, 4, 6, 8]\n```\n\n### Curry\n\n`pipette` provides a submodule for easy currying of functions:\n```python\nfrom pipette.curry import curry\n\n@curry\ndef add(x: int, y: int) -\u003e int:\n    return x + y\n\nresult = add(2)(3)\nprint(result) # Output: 5\n\nresult = add(2)\nprint(result(3)) # Output: 5\n```\n\nNote, however, that python's static typing does not support currying and the type hints will error.\n\n### Monads\n\n`pipette` also includes a simple monad implementation for chaining operations:\n```python\nfrom pipette.monad import Maybe, Some, Nothing\n\ndef safe_divide(x, y) -\u003e Maybe[float]:\n    if y == 0:\n        return Nothing()\n    else:\n        return Some(x / y)\n\ns = Some(10) \u003e\u003e (lambda x: safe_divide(x, 2)) | (lambda x: x + 1)\nprint(s) # Output: Some(6.0)\n\nn = Some(10) \u003e\u003e (lambda x: safe_divide(x, 0)) | (lambda x: x + 1)\nprint(n) # Output: Nothing\n```\n\nHere `\u003e\u003e` binds the monad value to the function, and `|` provides a simple way to map the result to another function.\n\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriso345%2Fpipette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchriso345%2Fpipette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriso345%2Fpipette/lists"}