{ "info": { "author": "Venkatesh-Prasad Ranganath", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "funcipy\n=======\n\nA library to inject common functional programming operations as methods\ninto iterable objects. Currently, it injects\n``filter, flat_map, foldl, foldr, map,`` and ``reduce`` operations along\nwith ``sum, count, any, all, max, min,`` and ``zip`` operations.\n\nGetting the library\n-------------------\n\nThe library can be installed via ``pip install funcipy``. Similarly, it\ncan be uninstalled via ``pip uninstall funcipy``.\n\nUsage\n-----\n\nWhen you want to inject common functional programming operations as\nmethods into an object *Obj*, invoke ``funcipy.funcify`` function with\n*Obj* as the argument. If *Obj* is iterable, then the function will\nreturn an object that\n\n1. provides the same interface as the input object and\n2. has functional programming operations as methods.\n\nOtherwise, *Obj* is returned as is.\n\nHere are few example invocations.\n\n.. code:: python\n\n from funcipy import funcify\n import functools\n import itertools\n import operator\n\n i = range(5, 15)\n print(\"Map function: \" + ' '.join(map(str, i)))\n tmp1 = funcify(i)\n print(\"Map function applied to funcified object: \" + ' '.join(map(str, tmp1)))\n print(\"Map method: \" + ' '.join(tmp1.map(str)))\n print(\"Map and Filter Method chaining: \" +\n ' '.join(tmp1.filter(lambda x: x % 2).map(str)))\n\n print(\"Reduce function: \" + str(functools.reduce(operator.add, i, 5)))\n print(\"Reduce method: \" + str(tmp1.reduce(operator.add, 5)))\n print(\"Reduce function: \" + str(functools.reduce(operator.sub, i)))\n print(\"Foldl method: \" + str(tmp1.foldl(operator.sub)))\n print(\"Foldr method: \" + str(tmp1.foldr(operator.sub)))\n print(\"Flat-map operation: \" + ' '.join(itertools.chain.from_iterable(\n map(str, i))))\n print(\"Flat-map method: \" + ' '.join(funcify(i).flat_map(str)))\n print(\"Sum function: \" + str(sum(i)))\n print(\"Sum method: \" + str(tmp1.sum()))\n print(\"Count function: \" + str(sum(1 for _ in filter(lambda x: x > 10, i))))\n print(\"Count method: \" + str(tmp1.count(lambda x: x > 10)))\n print(\"Max function: \" + str(max(i)))\n print(\"Max method: \" + str(tmp1.max()))\n print(\"Min function: \" + str(min(i)))\n print(\"Min method: \" + str(tmp1.min()))\n print(\"Any function: \" + str(any(map(lambda x: x > 10, i))))\n print(\"Any method: \" + str(tmp1.map(lambda x: x > 10).any()))\n print(\"All function: \" + str(all(map(lambda x: x > 10, i))))\n print(\"All method: \" + str(tmp1.map(lambda x: x > 10).all()))\n j = range(0, 7)\n print(\"Zip function: \" + ' '.join(map(str, zip(i, j))))\n print(\"Zip method: \" + ' '.join(tmp1.zip(j).map(str)))\n\nAttribution\n-----------\n\nCopyright (c) 2017, Venkatesh-Prasad Ranganath\n\nLicensed under BSD 3-clause \"New\" or \"Revised\" License\n(https://choosealicense.com/licenses/bsd-3-clause/)\n\n**Authors:** Venkatesh-Prasad Ranganath\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/rvprasad/funcipy/downloads/?tab=tags", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/rvprasad/funcipy", "keywords": "functional,programming", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "funcipy", "package_url": "https://pypi.org/project/funcipy/", "platform": "unix", "project_url": "https://pypi.org/project/funcipy/", "project_urls": { "Download": "https://bitbucket.org/rvprasad/funcipy/downloads/?tab=tags", "Homepage": "https://bitbucket.org/rvprasad/funcipy" }, "release_url": "https://pypi.org/project/funcipy/0.5/", "requires_dist": null, "requires_python": "", "summary": "A library to inject common functional programming operations as methods into iterable objects.", "version": "0.5" }, "last_serial": 3444184, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f1f0c0f71556f4ae55e7c65609102d9a", "sha256": "372a4091ad96394ac988f83a508a418f912720b82dcb2bcfc0f1b6f64f99a8e3" }, "downloads": -1, "filename": "funcipy-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f1f0c0f71556f4ae55e7c65609102d9a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4057, "upload_time": "2017-10-29T08:04:30", "url": "https://files.pythonhosted.org/packages/aa/ad/7193603604c4c9014b1f092f1156e98f790031f08b70778215942bb8063c/funcipy-0.1-py2.py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "953fee9801e6f97e6b306a95a4cab43e", "sha256": "d4d2f1b2c72f45ea156896191bf2164e454433dc28d5c20324c6a2c5c2dd7ba1" }, "downloads": -1, "filename": "funcipy-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "953fee9801e6f97e6b306a95a4cab43e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4089, "upload_time": "2017-10-29T18:38:35", "url": "https://files.pythonhosted.org/packages/5b/0d/8c60ebb31e5a0745eaedd06bf397eaeee0dd686671d76cde5d208dd757a1/funcipy-0.2-py2.py3-none-any.whl" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "8e64ccac2815766162d08d21cf565b26", "sha256": "3bd31046f85f53c7b7b81e12324ea219f1f36accf205c2432daa3579a86ea91e" }, "downloads": -1, "filename": "funcipy-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8e64ccac2815766162d08d21cf565b26", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4599, "upload_time": "2017-10-30T01:23:28", "url": "https://files.pythonhosted.org/packages/76/f2/4eb008ac75c2bba80e5f1eb38b622f03ff112b94d96917ca9a1ad3d6a3ae/funcipy-0.3-py2.py3-none-any.whl" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "39fdcc5f4e9e4f96425b2baa53a5f45a", "sha256": "4e1ffe5fce79abbac76ca575ad9128fe80b2890916aed3297e8155f003a0106e" }, "downloads": -1, "filename": "funcipy-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "39fdcc5f4e9e4f96425b2baa53a5f45a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4746, "upload_time": "2017-10-30T04:23:38", "url": "https://files.pythonhosted.org/packages/e2/eb/5d529cb26105dd838bbf88388faa9da910da18090e08f2ba93336806eace/funcipy-0.4-py2.py3-none-any.whl" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "20c03c1817bb94225d27cd9f3b435cfe", "sha256": "4cbf0d1375aa90c2804c09ec0a8ef1d442105deedc1883022ffa706335167e4b" }, "downloads": -1, "filename": "funcipy-0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "20c03c1817bb94225d27cd9f3b435cfe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5875, "upload_time": "2017-12-27T00:25:27", "url": "https://files.pythonhosted.org/packages/46/31/be018a6c7f22e2ee7393fcda321e3b0d1bfb49c40761efaacdd339f067b0/funcipy-0.5-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "20c03c1817bb94225d27cd9f3b435cfe", "sha256": "4cbf0d1375aa90c2804c09ec0a8ef1d442105deedc1883022ffa706335167e4b" }, "downloads": -1, "filename": "funcipy-0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "20c03c1817bb94225d27cd9f3b435cfe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5875, "upload_time": "2017-12-27T00:25:27", "url": "https://files.pythonhosted.org/packages/46/31/be018a6c7f22e2ee7393fcda321e3b0d1bfb49c40761efaacdd339f067b0/funcipy-0.5-py2.py3-none-any.whl" } ] }