{ "info": { "author": "isConic", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# MR Streams\n\nMR Streams is a python utility for composing iterable map reduce filter chains \n\n### Goals: \nThe goals of this library are relatively simple: \n- provide a stream composition syntax that supports chaining map,reduce,filter operations \n- a stream object should still look and feel like a list/iterable \n- a stream should have options for delayed evaluation of the stream \n- to support future changes regarding how composition \n\n### Pronunciation: \n\n- \"Mister Streams\" for fun\n- \"M-R-Streams\" to sound professional \n\n### Supported operations \n\n- `map` - applies functions to values in iterable with a built-in option for partial evaluation. \n ```python\n from operator import add\n\n [*mr(range(10)).map(add, 1)] \n\n >>[1,2,3,4,5,6,7,8,9,10]\n ```\n- `filter` - applies a boolean function to values emitted in the chain. If the condition is true, the values are emitted further down the chain. \n ```python\n is_even = lambda x: x % 2 == 0 \n\n [*mr(range(10)).filter(is_even)] \n\n >>[0, 2,4,6,8]\n ``` \n\n- `reduce` - reduce iterates through all objects and reduces them using a reduction function. \n ```python\n mr(range(10)).reduce(sum) \n\n >> 45\n ```\n\n- `take` - limits the number of values emitted in the stream. \n ```python\n [*mr(range(10)).take(3)] \n\n >>[0,1,2] \n ```\n\n- `tap` - applies a function passively to the stream without altering emitted values. \n ```python\n mr(range(4)).tap(print).reduce(sum)\n\n >> 0\n >> 1\n >> 2\n >> 3\n >> 6\n ``` \n\n- `drain` - runs a no-op iteration that depletes the stream. \n ```python\n mr(range(4)).tap(print).drain() \n\n >> 0\n >> 1\n >> 2\n >> 3 \n ``` \n\n- `chunk` - groups items in a stream into groups of size `n`\n\n ```python\n mr(range(4)).chunk(2).tap(print).drain() \n\n >> [0,1]\n >> [2,3]\n\n ```\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pypa/sampleproject", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mr-streams", "package_url": "https://pypi.org/project/mr-streams/", "platform": "", "project_url": "https://pypi.org/project/mr-streams/", "project_urls": { "Homepage": "https://github.com/pypa/sampleproject" }, "release_url": "https://pypi.org/project/mr-streams/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "an anti-pythonic map reduce utility", "version": "0.0.1" }, "last_serial": 5462274, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b0a16bb6e3acaf307658d47bbdedf201", "sha256": "a687c0af2a97ba065805d379f2536d5c8e2e1ed8161f7e662432de6a652d5812" }, "downloads": -1, "filename": "mr_streams-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b0a16bb6e3acaf307658d47bbdedf201", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8472, "upload_time": "2019-06-28T15:31:45", "url": "https://files.pythonhosted.org/packages/be/80/cf610b10816a62c65a31862a6fb32323fdd86c7a65042f56c838f9e77099/mr_streams-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6996fac0f37987ac1969dd62ace8f727", "sha256": "c49947d61059e04c0f07c9e68f26cf47d5ba98d3f44548606f6892245d7c3f04" }, "downloads": -1, "filename": "mr_streams-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6996fac0f37987ac1969dd62ace8f727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3553, "upload_time": "2019-06-28T15:31:48", "url": "https://files.pythonhosted.org/packages/05/96/827611af0d7c5153247d24da447bc8e5299559088c3a8c9121b55b6db1b7/mr_streams-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b0a16bb6e3acaf307658d47bbdedf201", "sha256": "a687c0af2a97ba065805d379f2536d5c8e2e1ed8161f7e662432de6a652d5812" }, "downloads": -1, "filename": "mr_streams-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b0a16bb6e3acaf307658d47bbdedf201", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8472, "upload_time": "2019-06-28T15:31:45", "url": "https://files.pythonhosted.org/packages/be/80/cf610b10816a62c65a31862a6fb32323fdd86c7a65042f56c838f9e77099/mr_streams-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6996fac0f37987ac1969dd62ace8f727", "sha256": "c49947d61059e04c0f07c9e68f26cf47d5ba98d3f44548606f6892245d7c3f04" }, "downloads": -1, "filename": "mr_streams-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6996fac0f37987ac1969dd62ace8f727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3553, "upload_time": "2019-06-28T15:31:48", "url": "https://files.pythonhosted.org/packages/05/96/827611af0d7c5153247d24da447bc8e5299559088c3a8c9121b55b6db1b7/mr_streams-0.0.1.tar.gz" } ] }