{ "info": { "author": "DboyLiao ", "author_email": "qmalliao@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# pypeup - Piping Up with Python\n\n[![Build Status](https://travis-ci.org/dboyliao/pypeup.svg?branch=master)](https://travis-ci.org/dboyliao/pypeup)\n\nThis is a simple python module to help you to build a data pipe in python.\n\n## First Glance\n\nSuppose you have a bunch of functions dealing with data of the same structure (e.g they are all `array`, `integer`, ...etc) and you want to pipe them up for complex computations, `pypeup` is here at your service.\n\nWith `pypeup`, you can write something like this:\n\n```{python}\nfrom pypeup import DataPipe\n\n# Note that these two funtion all return the same data structure and their\n# first arguments are all data.\n# In this example, the data are all of type list.\n\ndef fun1(data, x):\n \"\"\"\n x: \n data: \n \"\"\"\n return [a + x for a in data]\n\ndef fun2(data, ind):\n \"\"\"\n ind: \n data: \n \"\"\"\n return data[:min(ind, len(data) - 1)]\n\nclass MyPipe(DataPipe):\n pass\n\nmy_pipe = MyPipe([1, 2, 3, 4, 5])\nmy_pipe.register(fun1) # Use register method to add any method you like \nmy_pipe.register(fun2) # for your data.\n\nmy_pipe.fun1(1).fun2(3).fun2(2).fun1(3) # Pipe the function up at your wish\nmy_pipe.data # Access the data by the `data` attribute\n# >>> [5, 6]\n```\n\nAlso, you can build up the pipe by one class declairation:\n\n```{python}\nfrom pypeup import DataPipe\nimport numpy as np\n\nclass MyPipe2(DataPipe):\n\n def add(self, x):\n return self.data + x\n\n def sub(self, x):\n return self.data - x\n\n def mul(self, x):\n return self.data * x\n\npipe2 = MyPipe2(np.array([1, 2, 3]))\npipe2.add(3).sub(2).mul(4)\npipe2.data\n# >>> np.array([8, 12, 16])\n```\n\nYou can use private method as normal python:\n\n```{python}\nfrom pypeup import DataPipe\nimport math\n\nclass MyPipe(DataPipe):\n\n def fun(self, x):\n return self._magic(x)\n\n def _magic(self, x):\n print \"Where the magic happens!\"\n return self.data + math.sin(x)\n\npipe = MyPipe(0.)\nprint pipe.fun(math.pi / 2).data\n# >>> Where the magic happens!\n# >>> 1.\n```\n\nIn order to protect the data inside the pipe, any modification to the `data` which is outside of the execution context of the methods of the pipe is not allowed and an `ExecutionContextError` will be raised.\n\n```{python}\nfrom pypeup import DataPipe\n\nclass MyPipe(DataPipe):\n\n def addOne(self):\n return self.data + 1\n\npipe = MyPipe(10)\npipe.addOne(1) # OK.\npipe.data = 11 # Not OK.\n```\n\nThere are some limits on the functions which can be applied to `pypeup`.\nSee [Limits](https://github.com/dboyliao/pypipe#limits) for detail.\n\n## Limits\n\nAs mentioned above, there are few limits on the functions that can be used with `pypeup`:\n\n- The current data can be access through `self.data`.\n - `self.data` is a `property` defined in `DataPipe`, which means that if you want to overwrite it, you must be sure your implementation is OK.\n- All the functions' first argument must be `data`. (But not method, see below)\n - It doesn't mean you have to name it as `data`, but you have to be sure that all the functions' first argument will hold the data you want to process.\n - If the function is defined as an instance method, you only need to pass all the parameters needed to work with the data which can be access through `self.data`.\n - If the instance method is private method (method with the name start with `_` or `__`) will work just like normal instance method.\n- All the `data` must be of the same (or compatible) data structure or type.\n - for example, they must be all `list`, `number`, `numpy.array`...etc.\n- All the function must return the data which will be passed through the pipe.\n\n## Installation\n\n- Install through `pip`:\n - Just run `pip install pypeup`\n- Install from source:\n - run `git clone https://github.com/dboyliao/pypeup.git && cd pypeup`\n - run `python setup.py install` to install the package.\n\n## Tests\n\n- If you haven't installed `nose` yet, run `pip install -r requirements.txt` first.\n- run `nosetests`", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dboyliao/pypeup", "keywords": "python data pipeline", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pypeup", "package_url": "https://pypi.org/project/pypeup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pypeup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dboyliao/pypeup" }, "release_url": "https://pypi.org/project/pypeup/0.9.5/", "requires_dist": null, "requires_python": null, "summary": "An easy module for building data pipe in python.", "version": "0.9.5" }, "last_serial": 2145166, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "40b5cc6504883200c994ef92ecff5856", "sha256": "f1e8a3ef0d6c731fc5d9263c451e9a45bda6d6c24a833a7c43dc880f8dfc4e74" }, "downloads": -1, "filename": "pypeup-0.2.tar.gz", "has_sig": false, "md5_digest": "40b5cc6504883200c994ef92ecff5856", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2758, "upload_time": "2015-11-02T15:25:47", "url": "https://files.pythonhosted.org/packages/36/6c/4fe63430ad7711032752be9c9e6dd54cdd448869d660e26146eeb1630712/pypeup-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2c6de449b77129fa6fead8974ce7bf1d", "sha256": "a4a3989be37d9dc28f5b1fa5d7f17b3d7e5b16e2ec98a446c07bd2c6355a34b7" }, "downloads": -1, "filename": "pypeup-0.3.tar.gz", "has_sig": false, "md5_digest": "2c6de449b77129fa6fead8974ce7bf1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2749, "upload_time": "2015-11-02T15:33:15", "url": "https://files.pythonhosted.org/packages/03/e9/202590479835aa439b95c2f52ca69eb5f665c14569512fb5261a574546a4/pypeup-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "ced5f1283a41aed1ca7922a7667d1a5b", "sha256": "b7dd78c9596ad978136fd30748711a8d684ccee5ef31483245ea04275ffee403" }, "downloads": -1, "filename": "pypeup-0.4.tar.gz", "has_sig": false, "md5_digest": "ced5f1283a41aed1ca7922a7667d1a5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2826, "upload_time": "2015-11-03T01:00:37", "url": "https://files.pythonhosted.org/packages/cf/33/02135b22e7951d8aa9caa91379353b3fe51fe960e14569202db36739f68a/pypeup-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "0618da5465cf4d13df2ba74e4c4bfb00", "sha256": "0c32a1f8d941709927263f7b46efc200a41f8057d3236dce2c9f0c5c8b2fb756" }, "downloads": -1, "filename": "pypeup-0.5.tar.gz", "has_sig": false, "md5_digest": "0618da5465cf4d13df2ba74e4c4bfb00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3530, "upload_time": "2015-11-03T01:22:45", "url": "https://files.pythonhosted.org/packages/76/a9/48889425a3450275c777b0352fd08121170d98c785d7b0bd302035987ae9/pypeup-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "6c0938520f6c9c7601de71dff371b43f", "sha256": "7709ad1b01034457ed1f0355d6713fc609dc2f92089d4775eb6d57f959d983c4" }, "downloads": -1, "filename": "pypeup-0.6.tar.gz", "has_sig": false, "md5_digest": "6c0938520f6c9c7601de71dff371b43f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3758, "upload_time": "2015-11-03T02:17:28", "url": "https://files.pythonhosted.org/packages/ba/70/420467f8ab096f6a0b3551c61ff6c6a687b135e6f473415949dfa646ec6d/pypeup-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "1475d93e7e1d17550cdd964a7c4a24be", "sha256": "8fce7dc5d47d2d1b7afe982ab41746f3a490993588295fcd170deea2ffb063f7" }, "downloads": -1, "filename": "pypeup-0.7.tar.gz", "has_sig": false, "md5_digest": "1475d93e7e1d17550cdd964a7c4a24be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3800, "upload_time": "2015-11-03T02:19:56", "url": "https://files.pythonhosted.org/packages/48/14/3e0c0796e0e6a2484aff17b754611aa780ec8928f2f7c1e88a8448509f8f/pypeup-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "92e3caf903925098158f3b5a2b749283", "sha256": "80b5027abd40af41874d5a39d24350f48d7dc1a40fa0ee4bc59e2698ac3706a7" }, "downloads": -1, "filename": "pypeup-0.8.tar.gz", "has_sig": false, "md5_digest": "92e3caf903925098158f3b5a2b749283", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4303, "upload_time": "2015-11-04T03:26:43", "url": "https://files.pythonhosted.org/packages/2c/7b/54f1f057e9da48037c09a23068112e16ec5bdaf4ccfcf43b8116763a7409/pypeup-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "1ea37d8329fc39513715869e00977e80", "sha256": "237f31145254b42874f4b27bd67ea2cbda91a37b2811672637a48ef1dfdb601a" }, "downloads": -1, "filename": "pypeup-0.9.tar.gz", "has_sig": false, "md5_digest": "1ea37d8329fc39513715869e00977e80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48373, "upload_time": "2015-11-04T08:46:06", "url": "https://files.pythonhosted.org/packages/e0/8d/40a4ae5ec90edb4b43ee40a3e261e210b3958074c9ac51b4daa7d4c6cd5f/pypeup-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "aa1c4502301512b97e299f2603847c14", "sha256": "ac5e87dc8eab1e709404855fa0662f2609c795f47f117c2a72a8285a2be4cec5" }, "downloads": -1, "filename": "pypeup-0.9.1.tar.gz", "has_sig": false, "md5_digest": "aa1c4502301512b97e299f2603847c14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4594, "upload_time": "2015-11-04T08:47:19", "url": "https://files.pythonhosted.org/packages/8f/17/9286fb9603a9667e732a8775c4e8e47b3b6756404682783075fffd15c4db/pypeup-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "577cd86bf9f9754f6017ddc92b840036", "sha256": "61355dec05ddf646262821f4ceb42342c136f06db049c7e68c1a1f1066fc7feb" }, "downloads": -1, "filename": "pypeup-0.9.2.tar.gz", "has_sig": false, "md5_digest": "577cd86bf9f9754f6017ddc92b840036", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4629, "upload_time": "2015-11-04T12:48:12", "url": "https://files.pythonhosted.org/packages/f1/a9/8fe39fbcfa6e2d81906726138df86457c963a4cf3b883b60800f77ba180a/pypeup-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "b7810b9ba87d67abbe612fb22154a560", "sha256": "dbd628dc08f3bc5b3815733b0cb0011e169a5ffdb9a8b08d02e39c637c19c127" }, "downloads": -1, "filename": "pypeup-0.9.3.tar.gz", "has_sig": false, "md5_digest": "b7810b9ba87d67abbe612fb22154a560", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4670, "upload_time": "2015-11-04T13:57:23", "url": "https://files.pythonhosted.org/packages/9e/06/49ef2a861c8e8a93da273bf6523be27e33833c5ba748f095c090962d5f72/pypeup-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "f71e2550b10e75d71d72e12936807b9f", "sha256": "95d5d8ac0844fe8a8bcdded160d2e31eead1ba4731c05d57a68e02340533b3e9" }, "downloads": -1, "filename": "pypeup-0.9.4.tar.gz", "has_sig": false, "md5_digest": "f71e2550b10e75d71d72e12936807b9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4696, "upload_time": "2016-05-31T16:43:38", "url": "https://files.pythonhosted.org/packages/aa/07/a731a46f343e85e0372cc038001429d93bd4fc411205f5a043ec2092fbcd/pypeup-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "d97761e7cd3736a4931b9afb5ea09663", "sha256": "da2a389f17e56b133da3927700156355c79c00c2488982c26a75d34e091c5ac2" }, "downloads": -1, "filename": "pypeup-0.9.5.tar.gz", "has_sig": false, "md5_digest": "d97761e7cd3736a4931b9afb5ea09663", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4703, "upload_time": "2016-06-01T14:14:52", "url": "https://files.pythonhosted.org/packages/f6/f4/9ab7d41aa5dc83d3efb277f8837ffca9d068bd2d88e60b62ce94429ee701/pypeup-0.9.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d97761e7cd3736a4931b9afb5ea09663", "sha256": "da2a389f17e56b133da3927700156355c79c00c2488982c26a75d34e091c5ac2" }, "downloads": -1, "filename": "pypeup-0.9.5.tar.gz", "has_sig": false, "md5_digest": "d97761e7cd3736a4931b9afb5ea09663", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4703, "upload_time": "2016-06-01T14:14:52", "url": "https://files.pythonhosted.org/packages/f6/f4/9ab7d41aa5dc83d3efb277f8837ffca9d068bd2d88e60b62ce94429ee701/pypeup-0.9.5.tar.gz" } ] }