{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python" ], "description": "Introduction\n============\n\nPyF.Station is a protocol with client and server to transfer python generators accross tcp networks. Items in the generator must be pyf.transport.Packet instances.\n\nBest practice is to provide information about the flow in the first packet, identified as an header (containing for example authentication data, method, target, and so on).\n\nErrors are passed on both ends.\n\nServer\n------\n\nPlease note that the server requires tgscheduler (to spawn tasks, passing generators) and twisted.\n\nAn example::\n\n from twisted.internet import reactor\n from pyf.station import FlowServer\n\n def sample_handler(flow, client=None):\n header = flow.next()\n print header\n for i, item in enumerate(flow):\n if not i%50:\n print i, item\n print \"end of flow...\"\n client.success(\"Done\")\n\n factory = FlowServer(sample_handler)\n reactor.listenTCP(8000,factory)\n reactor.run()\n\nThe handler can be a simple callable, as in the example above, or a user defined class:\n\n from twisted.internet import reactor\n from pyf.station import FlowServer\n\n class SampleHandler(object):\n\n def __init__(self, flow, client):\n # The __init__ method must accept 'flow' and 'client' params\n self.flow = flow\n self.client = client\n\n def handle_data(self):\n # This method will be called by the FlowServer\n header = self.flow.next()\n print header \n for i, item in enumerate(self.flow):\n if not i%50:\n print i, item\n print \"end of flow...\"\n self.client.success(\"Done\")\n \n factory = FlowServer(SampleHandler)\n reactor.listenTCP(8000,factory)\n reactor.run()\n\nAnother example, if you are in an already threaded env (like a wsgi server)::\n\n from tgscheduler import scheduler\n from twisted.internet import reactor\n from pyf.station import FlowServer\n from pyf.transport import Packet\n\n def sample_handler(flow, client=None):\n header = flow.next()\n print header\n\n for i, item in enumerate(flow):\n # every 50 items...\n if not i%50:\n print i, item\n # we send a message to the client\n client.message(Packet({'type': 'info',\n 'message': 'hello ! (%s)' % i}))\n\n print \"end of flow...\"\n client.success(\"Done\") \n\n factory = FlowServer(sample_handler)\n reactor.listenTCP(8000,factory)\n scheduler.add_single_task(reactor.run,\n kw=dict(installSignalHandlers=0),\n initialdelay=0)\n\n # You cloud comment these lines if you were in wsgi application\n scheduler.start_scheduler() \n while True:\n pass\n\nClient\n------\n\nExample of client::\n \n from pyf.station import StationClient\n from pyf.transport import Packet\n\n client = StationClient('127.0.0.1', 8000, True)\n\n def message_handler(message_packet):\n # the handler for messages that come back from the server\n print \"Message handler triggered: %s\" % message_packet\n \n # we register our callback\n client.add_listener('message_received', message_handler)\n \n # we generate sample packets\n flow = (Packet(dict(Field1=i+1,\n Field2=('titi', 'tata')[i%2], num=i+1,\n Field3=(i+1)*10))\n for i in range(10000))\n\n values = client.call(\n flow,\n header=dict(authtkt='my false auth token :)',\n action='my_action'))\n # here values is either \"True\" (saying that message has passed well) or a packet, comming back from the server.\n for i, value in enumerate(values):\n if not i % 5000:\n print i\n\n if isinstance(value, Packet):\n print value", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pyfproject.org", "keywords": "python generator tcp/ip", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyf.station", "package_url": "https://pypi.org/project/pyf.station/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyf.station/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pyfproject.org" }, "release_url": "https://pypi.org/project/pyf.station/2.0.5/", "requires_dist": null, "requires_python": null, "summary": "PyF.Station is a protocol with client and server implementation to transfer python generators accross tcp networks.", "version": "2.0.5" }, "last_serial": 1607419, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cb50210bc11fc3127acae09d01a6d0fe", "sha256": "1522c340191e14206477814bbcd4157cbea0908387344186343b146e4204edf7" }, "downloads": -1, "filename": "pyf.station-0.1-py2.6.egg", "has_sig": false, "md5_digest": "cb50210bc11fc3127acae09d01a6d0fe", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 12210, "upload_time": "2010-08-26T16:46:33", "url": "https://files.pythonhosted.org/packages/a7/41/4a54b90ed80b243978d77e638785f166b1604fa7f851f0f1afd085418f67/pyf.station-0.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "2fd28e0607bc3b615d84a5467ec61696", "sha256": "05795bc64c52504a11fa69c32308a169872f7868a3e957f050f0b76fc7986fa3" }, "downloads": -1, "filename": "pyf.station-0.1.tar.gz", "has_sig": false, "md5_digest": "2fd28e0607bc3b615d84a5467ec61696", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5188, "upload_time": "2010-08-26T16:46:18", "url": "https://files.pythonhosted.org/packages/a7/e9/c5334d2e7aa3d5bd067168e4018f6abad0e83c4a49091814e76cc4037759/pyf.station-0.1.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "c3f9cee7b378c9743e340d9f9a650f3d", "sha256": "09d9ccaa611fc79045033f2dd8abb756a8ef443af66fe4a2a8f227be32f9b178" }, "downloads": -1, "filename": "pyf.station-2.0-py2.6.egg", "has_sig": false, "md5_digest": "c3f9cee7b378c9743e340d9f9a650f3d", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 14611, "upload_time": "2010-12-14T22:55:16", "url": "https://files.pythonhosted.org/packages/0d/0d/58db09dbdfe55758f5733fcf25821b62b9e696d99253cd880423bf591d31/pyf.station-2.0-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "7286c373bcfd616180e6e8e113df7c75", "sha256": "0ff289d8e3eb2b7e35490769d5ca7513d10a6a6f46459725df4e19b7815f45d5" }, "downloads": -1, "filename": "pyf.station-2.0.tar.gz", "has_sig": false, "md5_digest": "7286c373bcfd616180e6e8e113df7c75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5930, "upload_time": "2010-12-14T22:55:15", "url": "https://files.pythonhosted.org/packages/29/43/f398b09a67d12c15a51c252b88bf6712b18c2f635b2d696e9b83972870af/pyf.station-2.0.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "a46501754c10c1dc106ef946e23b2e38", "sha256": "cc819d074716dba126f88f0d27d48b604840a6eb470824d5cdda5b86fe1a39ae" }, "downloads": -1, "filename": "pyf.station-2.0.2-py2.6.egg", "has_sig": false, "md5_digest": "a46501754c10c1dc106ef946e23b2e38", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 15459, "upload_time": "2011-06-23T09:32:38", "url": "https://files.pythonhosted.org/packages/63/2f/a7b194677617cc1b400fdb7928c7b52cc9a2930d8240ba4403f7d8ef7519/pyf.station-2.0.2-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "474da3abb092c80cf0d432b8f660a0ac", "sha256": "26785f1ce37abc8cb66b5cd0ffa900b0815a4499a6be08c8c1152cfba329434c" }, "downloads": -1, "filename": "pyf.station-2.0.2.tar.gz", "has_sig": false, "md5_digest": "474da3abb092c80cf0d432b8f660a0ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6475, "upload_time": "2011-06-23T09:32:36", "url": "https://files.pythonhosted.org/packages/ec/5b/c5bc9857c01cb3842e278c85eb862c4da8ff3bf014b52f86963e50d4cab3/pyf.station-2.0.2.tar.gz" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "1e4928bda322a5a2c88a1c230f49db20", "sha256": "1a1102e469cfd63488bdd07597f965cdd4fcbb3115ca84e11b4ef5c212e297bc" }, "downloads": -1, "filename": "pyf.station-2.0.4-py2.7.egg", "has_sig": false, "md5_digest": "1e4928bda322a5a2c88a1c230f49db20", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15567, "upload_time": "2014-09-08T15:01:04", "url": "https://files.pythonhosted.org/packages/fe/8f/99f5edf11d32df42116fef3e6c510565d9e384030f5988875eac84aba1bf/pyf.station-2.0.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "3d777655023faedfd1959b8ef2038bcb", "sha256": "d24d693773473a75a2e569b6c1c72983808683adf5cdb9be7d3efe6614e47516" }, "downloads": -1, "filename": "pyf.station-2.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "3d777655023faedfd1959b8ef2038bcb", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10217, "upload_time": "2014-09-08T15:01:06", "url": "https://files.pythonhosted.org/packages/dc/b2/1a23ac2a68bbc625e770220969bb00cf2033cd689fc97dfb1b94be946715/pyf.station-2.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7bd43ddea671f3bb323f448fea66a9e3", "sha256": "95a66747e249f63d8ff666f9cbe2147f8cdd4f7d02da58bcfdbc15e74de8a29c" }, "downloads": -1, "filename": "pyf.station-2.0.4.tar.gz", "has_sig": false, "md5_digest": "7bd43ddea671f3bb323f448fea66a9e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6699, "upload_time": "2014-09-08T15:00:58", "url": "https://files.pythonhosted.org/packages/00/58/fb763a14e358bd55c843234d33300316acbc2c8e6ab4d5be7249ce2e5103/pyf.station-2.0.4.tar.gz" }, { "comment_text": "", "digests": { "md5": "753a7842478d0b6de579685f52a66679", "sha256": "4d6fe224e4bacf4547844f4502844991dcbcb3a242536d1fec5f5cc209e7ecba" }, "downloads": -1, "filename": "pyf.station-2.0.4.zip", "has_sig": false, "md5_digest": "753a7842478d0b6de579685f52a66679", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12500, "upload_time": "2014-09-08T15:01:01", "url": "https://files.pythonhosted.org/packages/76/38/3bd0c846b81d47a5fa06fc5ca63221f0bfb6d825374ae1fb05d433af2e07/pyf.station-2.0.4.zip" } ], "2.0.5": [ { "comment_text": "", "digests": { "md5": "05a686ed6f1dbcd85e139cef8a40a868", "sha256": "d7b24072e4c039f04b81d9ee4760b25eff865cceaa7ca3d4537fb1c617f6b700" }, "downloads": -1, "filename": "pyf.station-2.0.5-py2.7.egg", "has_sig": false, "md5_digest": "05a686ed6f1dbcd85e139cef8a40a868", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 16171, "upload_time": "2015-06-26T06:09:54", "url": "https://files.pythonhosted.org/packages/31/cd/ee17926013009df75ff773d34c295231375cb5a233ca3e48dd536367fca3/pyf.station-2.0.5-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "abf88c0897b9067c7df47210bfa8dcc6", "sha256": "f3f68fc5cbd1db0bbea57757a1878f2f56f8ce258df48ac386c86904a8ac7dc5" }, "downloads": -1, "filename": "pyf.station-2.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "abf88c0897b9067c7df47210bfa8dcc6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10552, "upload_time": "2015-06-26T06:09:57", "url": "https://files.pythonhosted.org/packages/08/28/0606e634906cc8da9f2ae7522a61f3fd73dd4b155af338a554b469fdd19f/pyf.station-2.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "740d2be28ff8363d095c246831b6e4e3", "sha256": "45a255bc4815fb15eeac2261fc86d7163f6adb720e0d9975c4637d3f2bd06225" }, "downloads": -1, "filename": "pyf.station-2.0.5.tar.gz", "has_sig": false, "md5_digest": "740d2be28ff8363d095c246831b6e4e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7024, "upload_time": "2015-06-26T06:09:47", "url": "https://files.pythonhosted.org/packages/96/ee/3fda27340faf5cd86c5765aabf9320678833e21aa6d255e83052ec6a4fa3/pyf.station-2.0.5.tar.gz" }, { "comment_text": "", "digests": { "md5": "fce9f22a31f765f1126270265cc877a9", "sha256": "21a326a37c1e04513fef4773d29b9f401e286c5eb9de0219a58c087ef7c2186d" }, "downloads": -1, "filename": "pyf.station-2.0.5.zip", "has_sig": false, "md5_digest": "fce9f22a31f765f1126270265cc877a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12838, "upload_time": "2015-06-26T06:09:50", "url": "https://files.pythonhosted.org/packages/24/a6/7e73955e9ed085d17b4470e7682e99501c166d0536a660c6f25780a65780/pyf.station-2.0.5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "05a686ed6f1dbcd85e139cef8a40a868", "sha256": "d7b24072e4c039f04b81d9ee4760b25eff865cceaa7ca3d4537fb1c617f6b700" }, "downloads": -1, "filename": "pyf.station-2.0.5-py2.7.egg", "has_sig": false, "md5_digest": "05a686ed6f1dbcd85e139cef8a40a868", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 16171, "upload_time": "2015-06-26T06:09:54", "url": "https://files.pythonhosted.org/packages/31/cd/ee17926013009df75ff773d34c295231375cb5a233ca3e48dd536367fca3/pyf.station-2.0.5-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "abf88c0897b9067c7df47210bfa8dcc6", "sha256": "f3f68fc5cbd1db0bbea57757a1878f2f56f8ce258df48ac386c86904a8ac7dc5" }, "downloads": -1, "filename": "pyf.station-2.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "abf88c0897b9067c7df47210bfa8dcc6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10552, "upload_time": "2015-06-26T06:09:57", "url": "https://files.pythonhosted.org/packages/08/28/0606e634906cc8da9f2ae7522a61f3fd73dd4b155af338a554b469fdd19f/pyf.station-2.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "740d2be28ff8363d095c246831b6e4e3", "sha256": "45a255bc4815fb15eeac2261fc86d7163f6adb720e0d9975c4637d3f2bd06225" }, "downloads": -1, "filename": "pyf.station-2.0.5.tar.gz", "has_sig": false, "md5_digest": "740d2be28ff8363d095c246831b6e4e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7024, "upload_time": "2015-06-26T06:09:47", "url": "https://files.pythonhosted.org/packages/96/ee/3fda27340faf5cd86c5765aabf9320678833e21aa6d255e83052ec6a4fa3/pyf.station-2.0.5.tar.gz" }, { "comment_text": "", "digests": { "md5": "fce9f22a31f765f1126270265cc877a9", "sha256": "21a326a37c1e04513fef4773d29b9f401e286c5eb9de0219a58c087ef7c2186d" }, "downloads": -1, "filename": "pyf.station-2.0.5.zip", "has_sig": false, "md5_digest": "fce9f22a31f765f1126270265cc877a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12838, "upload_time": "2015-06-26T06:09:50", "url": "https://files.pythonhosted.org/packages/24/a6/7e73955e9ed085d17b4470e7682e99501c166d0536a660c6f25780a65780/pyf.station-2.0.5.zip" } ] }