{ "info": { "author": "Tim McNamara", "author_email": "code@timmcnamara.co.nz", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries" ], "description": "==> COP\r\n coroutines for dataflow pipelines\r\n\r\n\r\n==> ABOUT\r\n Cop is designed to make it easy\r\n to write readable dataflow programs.\r\n Speed is important, but probably\r\n isn't there yet.\r\n\r\n This library is a learning exercise.\r\n At this stage, it should really be\r\n seen as a source for you to see\r\n how to implement your own coroutines.\r\n\r\n The primary motivation for cop is\r\n to facilitate readable and flexible\r\n dataflow programming. Once the \r\n project is more mature, its focus\r\n could shift to enhancing performance.\r\n\r\n\r\n==> TERMINOLOGY\r\n There are three basic terms that are\r\n used within cop: sources, steps and\r\n sinks.\r\n\r\n /sources/ Feed data to steps.\r\n (cop.file, cop.web)\r\n\r\n /steps/ Process data, then\r\n feed it to a target.\r\n\r\n /sinks/ Process data.\r\n\r\n\r\n==> USAGE\r\n Using cop is straight forward. Examples\r\n generally follow the following pattern:\r\n\r\n from cop.sources import source\r\n from cop.steps import step1, step2\r\n from cop.sinks import sink\r\n \r\n source(step1(step2(sink()))))\r\n\r\n /examples/\r\n\r\n >>> from cop.sources import web\r\n >>> from cop.steps import delimit \r\n >>> from cop.stops import grep\r\n >>> from cop.steps import transform\r\n >>> from cop.sinks import printer\r\n\r\n >>> url = 'http://python.org'\r\n >>> web(url,\r\n ... delimit('\\n',\r\n ... transform(lambda l: l.lower(),\r\n ... grep('monty', \r\n ... printer())))\r\n \r\n In this case, nothing comes out. That's\r\n basically because there's very little\r\n about Monty Python at python.org.\r\n\r\n /non-linear pipelines/\r\n Sometimes, a linear pathway isn't enough.\r\n Perhaps we would like to do something\r\n with intermediate results.\r\n\r\n Enter `cop.flow`. It provides `broadcast`\r\n for sending data to multiple steps, and\r\n `loadbalance`, which implements a round-\r\n robin load balancing system between steps.\r\n\r\n\r\n==> BACK STORY\r\n The start of this whole thing is from \r\n code written by David Beazley, especially\r\n his tutorial on coroutines[0]. That\r\n work is excellent and should basically\r\n be considered the manual for this library. \r\n\r\n I read the PDF of the tutorial in the\r\n morning. By the end of the evening I had\r\n a few dozen workable functions that could\r\n be strung together in an almost arbitary\r\n function.\r\n\r\n\r\n==> FUTURE PLANS\r\n I would really like to see interacting\r\n with multiple cores and hosts become\r\n trivally easy. \r\n\r\n\r\n==> HACKING\r\n If you would like to contribute to cop, \r\n that's great. It's easy to do and will\r\n help people. At the moment, test \r\n coverage is at a healthy 0%.\r\n\r\n The plan is to use heavy use of doctests. \r\n `cop.printer` should be quite useful:\r\n\r\n >> source(sink(printer())) \r\n result\r\n\r\n [sidenote]\r\n I use >> as prompt when I don't want \r\n doctest to claim it. I find this \r\n preferable to using the skip directive.\r\n\r\n\r\n==> LEGAL\r\n /code/\r\n Apart from code written by David Beazley,\r\n which is used with with permission, the\r\n code the copyright of Tim McNamara[1].\r\n \r\n The code is released under the Apache 2\r\n license[2].\r\n\r\n /docs/\r\n All documentation is the copyright of \r\n Tim McNamara. All docs are released under\r\n the \"Creative Commons Attribution 3.0\r\n New Zealand (CC BY 3.0)\" licence[3], in\r\n addition to the Apache 2 licence where it\r\n applies. \r\n \r\n /trade marks/\r\n \"cop\" is an unregistered trade mark of\r\n Tim McNamara under New Zealand law.\r\n \r\n /Consumer Guarantees Act 1993/ \r\n If you use this software for personal use,\r\n you have certain rights under the Consumer\r\n Guarantees Act 1993. They are explained by\r\n the Ministry of Consumer Affairs[4].\r\n \r\n Generally speaking, cop must be of \r\n \"acceptable\" quality and be fit for the \r\n purposes described.\r\n \r\n However, when judging acceptable quality, \r\n please consider that you are downloading\r\n free software from the Internet. \r\n \r\n [sidenote]\r\n I'm not entirely certain whether\r\n software code counts as a good or a \r\n service for the purpose of the Act\r\n \r\n [sidenote]\r\n No, we can't opt out of these provisions.\r\n Irrespective of the terms of the licence. \r\n\r\n==> FURTHER READING\r\n\r\n \"Structure and Interpretation of Computer Programs\"*\r\n Chaper 5: Sequences and Coroutines (esp. 5.3 \"Coroutines\")\r\n\r\n http://wla.berkeley.edu/~cs61a/fa11/lectures/streams.html\r\n\r\n This is not the original SICP, written in Scheme, but\r\n a version which is Python specific.\r\n\r\n==> REFERENCES\r\n\r\n [0] http://dabeaz.com/coroutines\r\n [1] @timClicks\r\n \r\n [2] http://www.apache.org/licenses/LICENSE-2.0\r\n [3] http://creativecommons.org/licenses/by/3.0/nz/\r\n [4] http://www.consumer.org.nz/reports/consumer-guarantees-act/the-guarantees", "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/timClicks/cop", "keywords": "", "license": "Apache 2", "maintainer": "", "maintainer_email": "", "name": "cop", "package_url": "https://pypi.org/project/cop/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/timClicks/cop" }, "release_url": "https://pypi.org/project/cop/0.2/", "requires_dist": null, "requires_python": null, "summary": "Coroutines for dataflow pipelines", "version": "0.2" }, "last_serial": 788444, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "182a98cfbfbf00ebbea26c1300d493f4", "sha256": "688c7173c43cbcf2703b3c513817722f1b00dc34535d42b349fc67cb75a81d99" }, "downloads": -1, "filename": "cop-0.2.tar.gz", "has_sig": false, "md5_digest": "182a98cfbfbf00ebbea26c1300d493f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6155, "upload_time": "2012-09-27T23:06:39", "url": "https://files.pythonhosted.org/packages/ca/e9/95b391dfa32cea170f0a3df91d082bc00083ae5e5365df75f0e960bd8006/cop-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "182a98cfbfbf00ebbea26c1300d493f4", "sha256": "688c7173c43cbcf2703b3c513817722f1b00dc34535d42b349fc67cb75a81d99" }, "downloads": -1, "filename": "cop-0.2.tar.gz", "has_sig": false, "md5_digest": "182a98cfbfbf00ebbea26c1300d493f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6155, "upload_time": "2012-09-27T23:06:39", "url": "https://files.pythonhosted.org/packages/ca/e9/95b391dfa32cea170f0a3df91d082bc00083ae5e5365df75f0e960bd8006/cop-0.2.tar.gz" } ] }