{"id":21366,"library":"functional-streams","title":"functional-streams","description":"A Python library that provides functional programming stream operations similar to Java streams, enabling declarative, concise data transformations via lazy evaluation, fluent chaining, and common operations like map, filter, reduce, and more. Current version 1.6.4, supports Python >=3.6, with moderate release cadence (minor updates every few months).","status":"active","version":"1.6.4","language":"python","source_language":"en","source_url":"https://github.com/muthuishere/python-streams","tags":["functional-programming","streams","lazy-evaluation","data-pipeline"],"install":[{"cmd":"pip install functional-streams","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"Stream","correct":"from functional.streams import Stream"}],"quickstart":{"code":"from functional.streams import Stream\n\nresult = (Stream([1, 2, 3, 4])\n          .filter(lambda x: x % 2 == 0)\n          .map(lambda x: x * 2)\n          .to_list())\nprint(result)  # [4, 8]","lang":"python","description":"Create a stream from a list, filter even numbers, double them, and collect to list."},"warnings":[{"fix":"Always call a terminal operation (to_list(), first(), reduce(), etc.) at the end of your stream pipeline.","message":"Stream operations are lazy; a 'terminal' operation like to_list() or sum() is required to trigger evaluation. Without a terminal operation, nothing will execute.","severity":"gotcha","affected_versions":"all"},{"fix":"Create a new stream for each pipeline. If you need to reuse data, store intermediate results in a list.","message":"Streams are single-use: once a terminal operation is called, the stream cannot be reused. Attempting to do so will raise a RuntimeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from functional.streams import Stream' instead of 'from streams import Stream'.","message":"The 'streams' module (lower-level) is considered deprecated in favor of 'functional.streams' (higher-level). Using old imports may lead to compatibility issues in future versions.","severity":"deprecated","affected_versions":"< 1.6"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from functional.streams import Stream'.","cause":"Incorrect import: trying to import 'functional.streams' directly via 'import functional.streams' and then using functional.streams.Stream.","error":"AttributeError: module 'functional' has no attribute 'streams'"},{"fix":"Add a terminal operation like .to_list() or .reduce() at the end of the chain.","cause":"Forgetting to call a terminal operation. The stream is lazy and only returns the stream object until a terminal operation is invoked.","error":"Stream(...).filter(...) returns <functional.streams.Stream object at 0x...> instead of the expected result"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}