{"library":"pipe","title":"Python Pipe Library","description":"The `pipe` library enables a shell-like infix syntax in Python, allowing users to chain operations on iterables using the pipe (`|`) operator. It provides a functional programming style for data processing, similar to LINQ in C# or shell pipes. The current stable version is 2.2, and it follows a slow but steady release cadence, focusing on stability given its utility nature.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install pipe"],"cli":null},"imports":["from pipe import select","from pipe import where","from pipe import take"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pipe import select, where, take\n\nl = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n# Chain operations: filter even numbers, double them, take the first 3\nresult = l | where(lambda x: x % 2 == 0) | select(lambda x: x * 2) | take(3)\n\n# The result is a generator; convert to list to see concrete values\nfinal_list = list(result)\n\nprint(final_list)","lang":"python","description":"This quickstart demonstrates chaining `where` (filter), `select` (map), and `take` (limit) operations on a list using the pipe syntax. It highlights that `pipe` operations are lazy and return generators, which must be explicitly consumed (e.g., by `list()`) to obtain concrete results.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}