{ "info": { "author": "thautwarm", "author_email": "twshere@outlook.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "|PyPI version|\n\nInstall\n-------\n\n``pip install pipe-fn``\n\npipe-fn\n=======\n\nFunction transformation purely.\n\n.. code:: python\n\n\n from pipe_fn import e\n\n\n # e is the identity mapping\n\n\n def add(this, other):\n return this + other\n\n\n print([1, 2, 3] | e / sum)\n # sum([1, 2, 3])\n # => 6\n\n print([2, 3, -1] | e ** {'key': lambda x: -x} / sorted) # set kwargs\n # sorted([2, 3, -1], key=lambda x: -x)\n # => [3, 2, -1]\n\n print([[1], [2], [3]] | e / sum * ([],)) # set args\n # sum([[1], [2], [3]], [])\n # => [1, 2, 3]\n\n\n def my_func(self, *args, **kwargs):\n return self, args, kwargs\n\n\n print([1, 2, 3]\n | e\n ** dict(a=1, b=2, c=3) # you should set kwargs first because of the high priority of `**` operator.\n\n * (4, 5, 6) # it'okay to change the order of setting `args` and setting `function`.\n / my_func)\n # => ([1, 2, 3], (4, 5, 6), {'a': 1, 'b': 2, 'c': 3})\n\n\n print(1 | e / add * (1,))\n # add(1, 1)\n # => 2\n\n\n def double(x):\n return 2 * x\n\n\n # and then composition\n print(1 | (e / add * (2,) + double + double))\n # double(double(add(1, 2))\n # => 12 = (1 + 2) * 2 * 2\n\n\n # set single arg\n [['a'], ['b']] | e / sum @ [] \\\n | e / print\n # print(sum([['a'], ['b']], []))\n # => [1, 2]\n\n def double(x):\n return 2 * x\n\n\n [1, 2, 3] | e / std.general.Sum @ double \\\n | e / print\n # print(Sum([1,2,3], double))\n # => 12\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/pipe-fn.svg\n :target: https://pypi.python.org/pypi/pipe-fn\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Xython/pipe-fn", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pipe-fn", "package_url": "https://pypi.org/project/pipe-fn/", "platform": "any", "project_url": "https://pypi.org/project/pipe-fn/", "project_urls": { "Homepage": "https://github.com/Xython/pipe-fn" }, "release_url": "https://pypi.org/project/pipe-fn/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "functional pipeline operation in Python", "version": "0.2.2" }, "last_serial": 3486620, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8c396d28c73a96a24347032d1f5da3fe", "sha256": "687226cdf9a9629207dd95ebc957341897f07d25d4f6359e060afaae0f57f360" }, "downloads": -1, "filename": "pipe_fn-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8c396d28c73a96a24347032d1f5da3fe", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4689, "upload_time": "2017-12-31T04:20:47", "url": "https://files.pythonhosted.org/packages/c8/1d/1a3e65ecd1cb46b80f515d394b59e18753f4c41aacdfd1c75b7e9d4d6b7d/pipe_fn-0.1-py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "0666735822f496c8caedd7cd1c192f8a", "sha256": "83af331d309f1e719d6e93abbebb40eaa08ae786f4c7984b35a315deca594fba" }, "downloads": -1, "filename": "pipe_fn-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0666735822f496c8caedd7cd1c192f8a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4911, "upload_time": "2018-01-01T06:01:05", "url": "https://files.pythonhosted.org/packages/05/33/0d4afd0d76ec0e6b773632050f8f426cae4cee564b55dc7b4034c06053f8/pipe_fn-0.2-py3-none-any.whl" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6ada2b704f2383dae63d3a4ad6de2ee9", "sha256": "ad3ca09b4843999408ba0b55ca0ac7e4ffab930c4735bbab6fa53c8b2e079557" }, "downloads": -1, "filename": "pipe_fn-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6ada2b704f2383dae63d3a4ad6de2ee9", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4945, "upload_time": "2018-01-11T06:49:45", "url": "https://files.pythonhosted.org/packages/19/ec/d731885d2c712c6a94e97d410883bb384c3ed1bbf0dabdfa53dda26bb829/pipe_fn-0.2.1-py3-none-any.whl" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "e101e983befab63dab9dfa645d6f4591", "sha256": "5c9040262d5eb4092d6e16f05f018ac7a9e04a0b3a3d66f709306982b6517971" }, "downloads": -1, "filename": "pipe_fn-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e101e983befab63dab9dfa645d6f4591", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4952, "upload_time": "2018-01-13T11:14:56", "url": "https://files.pythonhosted.org/packages/ab/71/8497dd8cb9e965ba13ce0c16b5db9a7581b73fffa3e7af5dca113410f389/pipe_fn-0.2.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e101e983befab63dab9dfa645d6f4591", "sha256": "5c9040262d5eb4092d6e16f05f018ac7a9e04a0b3a3d66f709306982b6517971" }, "downloads": -1, "filename": "pipe_fn-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e101e983befab63dab9dfa645d6f4591", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4952, "upload_time": "2018-01-13T11:14:56", "url": "https://files.pythonhosted.org/packages/ab/71/8497dd8cb9e965ba13ce0c16b5db9a7581b73fffa3e7af5dca113410f389/pipe_fn-0.2.2-py3-none-any.whl" } ] }