{ "info": { "author": "Fran\u00e7ois-Xavier Bourlet .", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4" ], "description": "zerorpc\n=======\n\n.. image:: https://travis-ci.org/0rpc/zerorpc-python.svg?branch=master\n :target: https://travis-ci.org/0rpc/zerorpc-python\n\nMailing list: zerorpc@googlegroups.com (https://groups.google.com/d/forum/zerorpc)\n\n\nzerorpc is a flexible RPC implementation based on zeromq and messagepack. \nService APIs exposed with zerorpc are called \"zeroservices\".\n\nzerorpc can be used programmatically or from the command-line. It comes\nwith a convenient script, \"zerorpc\", allowing to:\n\n* expose Python modules without modifying a single line of code,\n* call those modules remotely through the command line.\n\nInstallation\n------------\n\nOn most systems, its a matter of::\n\n $ pip install zerorpc\n\nDepending of the support from Gevent and PyZMQ on your system, you might need to install `libev` (for gevent) and `libzmq` (for pyzmq) with the development files.\n\nCreate a server with a one-liner\n--------------------------------\n\nLet's see zerorpc in action with a simple example. In a first terminal,\nwe will expose the Python \"time\" module::\n\n $ zerorpc --server --bind tcp://*:1234 time\n\n.. note::\n The bind address uses the zeromq address format. You are not limited\n to TCP transport: you could as well specify ipc:///tmp/time to use\n host-local sockets, for instance. \"tcp://\\*:1234\" is a short-hand to\n \"tcp://0.0.0.0:1234\" and means \"listen on TCP port 1234, accepting \n connections on all IP addresses\".\n\n\nCall the server from the command-line\n-------------------------------------\n\nNow, in another terminal, call the exposed module::\n\n $ zerorpc --client --connect tcp://127.0.0.1:1234 strftime %Y/%m/%d\n Connecting to \"tcp://127.0.0.1:1234\"\n \"2011/03/07\"\n\nSince the client usecase is the most common one, \"--client\" is the default\nparameter, and you can remove it safely::\n\n $ zerorpc --connect tcp://127.0.0.1:1234 strftime %Y/%m/%d\n Connecting to \"tcp://127.0.0.1:1234\"\n \"2011/03/07\"\n\nMoreover, since the most common usecase is to *connect* (as opposed to *bind*)\nyou can also omit \"--connect\"::\n\n $ zerorpc tcp://127.0.0.1:1234 strftime %Y/%m/%d\n Connecting to \"tcp://127.0.0.1:1234\"\n \"2011/03/07\"\n\n\nSee remote service documentation\n--------------------------------\n\nYou can introspect the remote service; it happens automatically if you don't\nspecify the name of the function you want to call::\n\n $ zerorpc tcp://127.0.0.1:1234\n Connecting to \"tcp://127.0.0.1:1234\"\n tzset tzset(zone)\n ctime ctime(seconds) -> string\n clock clock() -> floating point number\n struct_time \n time time() -> floating point number\n strptime strptime(string, format) -> struct_time\n gmtime gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n mktime mktime(tuple) -> floating point number\n sleep sleep(seconds)\n asctime asctime([tuple]) -> string\n strftime strftime(format[, tuple]) -> string\n localtime localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n\n\nSpecifying non-string arguments\n-------------------------------\n\nNow, see what happens if we try to call a function expecting a non-string\nargument::\n\n $ zerorpc tcp://127.0.0.1:1234 sleep 3\n Connecting to \"tcp://127.0.0.1:1234\"\n Traceback (most recent call last):\n [...]\n TypeError: a float is required\n\nThat's because all command-line arguments are handled as strings. Don't worry,\nwe can specify any kind of argument using JSON encoding::\n\n $ zerorpc --json tcp://127.0.0.1:1234 sleep 3\n Connecting to \"tcp://127.0.0.1:1234\"\n [wait for 3 seconds...]\n null\n\n\nzeroworkers: reversing bind and connect\n---------------------------------------\n\nSometimes, you don't want your client to connect to the server; you want\nyour server to act as a kind of worker, and connect to a hub or queue which\nwill dispatch requests. You can achieve this by swapping \"--bind\" and\n\"--connect\"::\n\n $ zerorpc --bind tcp://*:1234 strftime %Y/%m/%d\n\nWe now have \"something\" wanting to call the \"strftime\" function, and waiting\nfor a worker to connect to it. Let's start the worker::\n\n $ zerorpc --server tcp://127.0.0.1:1234 time\n\nThe worker will connect to the listening client and ask him \"what should I \ndo?\"; the client will send the \"strftime\" function call; the worker will\nexecute it and return the result. The first program will display the\nlocal time and exit. The worker will remain running.\n\n\nListening on multiple addresses\n-------------------------------\n\nWhat if you want to run the same server on multiple addresses? Just repeat\nthe \"--bind\" option::\n\n $ zerorpc --server --bind tcp://*:1234 --bind ipc:///tmp/time time\n\nYou can then connect to it using either \"zerorpc tcp://\\*:1234\" or\n\"zerorpc ipc:///tmp/time\".\n\nWait, there is more! You can even mix \"--bind\" and \"--connect\". That means\nthat your server will wait for requests on a given address, *and* connect\nas a worker on another. Likewise, you can specify \"--connect\" multiple times,\nso your worker will connect to multiple queues. If a queue is not running,\nit won't affect the worker (that's the magic of zeromq).\n\n.. warning:: A client should probably not connect to multiple addresses!\n\n Almost all other scenarios will work; but if you ask a client to connect\n to multiple addresses, and at least one of them has no server at the end,\n the client will ultimately block. A client can, however, bind multiple\n addresses, and will dispatch requests to available workers. If you want\n to connect to multiple remote servers for high availability purposes,\n you insert something like HAProxy in the middle.\n\n\nExposing a zeroservice programmatically\n---------------------------------------\n\nOf course, the command-line is simply a convenience wrapper for the zerorpc\npython API. Below are a few examples.\n\nHere's how to expose an object of your choice as a zeroservice::\n\n class Cooler(object):\n \"\"\" Various convenience methods to make things cooler. \"\"\"\n\n def add_man(self, sentence):\n \"\"\" End a sentence with \", man!\" to make it sound cooler, and\n return the result. \"\"\"\n return sentence + \", man!\"\n\n def add_42(self, n):\n \"\"\" Add 42 to an integer argument to make it cooler, and return the\n result. \"\"\"\n return n + 42\n\n def boat(self, sentence):\n \"\"\" Replace a sentence with \"I'm on a boat!\", and return that,\n because it's cooler. \"\"\"\n return \"I'm on a boat!\"\n\n import zerorpc\n\n s = zerorpc.Server(Cooler())\n s.bind(\"tcp://0.0.0.0:4242\")\n s.run()\n\nLet's save this code to *cooler.py* and run it::\n\n $ python cooler.py\n\nNow, in another terminal, let's try connecting to our awesome zeroservice::\n\n $ zerorpc -j tcp://localhost:4242 add_42 1\n 43\n $ zerorpc tcp://localhost:4242 add_man 'I own a mint-condition Volkswagen Golf'\n \"I own a mint-condition Volkswagen Golf, man!\"\n $ zerorpc tcp://localhost:4242 boat 'I own a mint-condition Volkswagen Golf, man!'\n \"I'm on a boat!\"\n\n\nCongratulations! You have just made the World a little cooler with your first\nzeroservice, man!\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/0rpc/zerorpc-python", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zerorpc", "package_url": "https://pypi.org/project/zerorpc/", "platform": "", "project_url": "https://pypi.org/project/zerorpc/", "project_urls": { "Homepage": "https://github.com/0rpc/zerorpc-python" }, "release_url": "https://pypi.org/project/zerorpc/0.6.3/", "requires_dist": [ "msgpack (>=0.5.2)", "pyzmq (>=13.1.0)", "future", "gevent (>=1.1)" ], "requires_python": "", "summary": "zerorpc is a flexible RPC based on zeromq.", "version": "0.6.3" }, "last_serial": 5450482, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8d831159390c8b65597382fbb5a78b04", "sha256": "b8c4683253c24837e9a3e12530e856189f65fb19813ee892f86fde894c73f23f" }, "downloads": -1, "filename": "zerorpc-0.1.0.tar.gz", "has_sig": true, "md5_digest": "8d831159390c8b65597382fbb5a78b04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11991, "upload_time": "2012-03-30T21:25:26", "url": "https://files.pythonhosted.org/packages/72/84/5f783e9248743b6fbb130f615e1fcd877938993900affbcae108d126b08d/zerorpc-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2618f0e7661729e94267ca8a4c716654", "sha256": "625d017986d1b038235667729f27048f190b03d38fbd187f9eefd61ba7fd088f" }, "downloads": -1, "filename": "zerorpc-0.1.1.tar.gz", "has_sig": true, "md5_digest": "2618f0e7661729e94267ca8a4c716654", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12324, "upload_time": "2012-04-22T05:48:55", "url": "https://files.pythonhosted.org/packages/10/41/d8cd41d1a488a8f65d0977c63485b78573ba518d17b93d7f0f080b3605b2/zerorpc-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "66ad4ee93bba3db708fa30c373e51009", "sha256": "8be1a0e0b4cb8c1efc4e1fbbfcee54374e61dad7fc4ed91f8fb48ca68b8268fd" }, "downloads": -1, "filename": "zerorpc-0.2.0.tar.gz", "has_sig": true, "md5_digest": "66ad4ee93bba3db708fa30c373e51009", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12377, "upload_time": "2012-05-12T07:35:19", "url": "https://files.pythonhosted.org/packages/ad/c0/81c707669f78e0009d3aafa6e9292a78c399e4267ffde881ccdc0237ae7b/zerorpc-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b61f2ee14fe09a693f0dea9ae1749af8", "sha256": "a122a24d1779543f2a24ec95fd801573010f7980dd6c6dfc24fc8e45fbaff512" }, "downloads": -1, "filename": "zerorpc-0.2.1.tar.gz", "has_sig": true, "md5_digest": "b61f2ee14fe09a693f0dea9ae1749af8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12969, "upload_time": "2012-06-06T08:01:37", "url": "https://files.pythonhosted.org/packages/6c/c1/f7564cb237001455084ac0d0f59f9bc0c478a40d4cb8d706ff5f88ed9037/zerorpc-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "85d576cd96274a6e8c738c60ff50e09c", "sha256": "096e199e0d0c1cc49a3215e8e18166c1168e41d93f5cdc318583d61648ed3e44" }, "downloads": -1, "filename": "zerorpc-0.3.0.tar.gz", "has_sig": true, "md5_digest": "85d576cd96274a6e8c738c60ff50e09c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13461, "upload_time": "2012-06-28T04:32:35", "url": "https://files.pythonhosted.org/packages/ac/7a/ea9a0516e87d6c960d0ecdb5b7d75c3c0e78654e70085f1db7b17cabc5bd/zerorpc-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a5b3d43565ebefded645c58e1ed45e2e", "sha256": "599870ef3c6d7656afd07bfff9f87fe5775e2ae2f6eb3a2974d12419f99160d0" }, "downloads": -1, "filename": "zerorpc-0.3.1.tar.gz", "has_sig": true, "md5_digest": "a5b3d43565ebefded645c58e1ed45e2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13442, "upload_time": "2012-12-02T04:50:36", "url": "https://files.pythonhosted.org/packages/b3/bb/c2c27a2ed068c5cfbe9a89803339886bc2f52e8d0142d7c4b1b38a17deb0/zerorpc-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "a6d7edaf8b4bd9f0ec5cf7788d575410", "sha256": "02911f687272d2a8ed5f125339878b03eb9dcae2a889818d659a5f9c1cbeaef8" }, "downloads": -1, "filename": "zerorpc-0.4.0.tar.gz", "has_sig": true, "md5_digest": "a6d7edaf8b4bd9f0ec5cf7788d575410", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14985, "upload_time": "2013-01-07T04:04:00", "url": "https://files.pythonhosted.org/packages/ae/b8/9cbda330bbbd46b574ce8e222b73d9c11c6e96974dc12a9d95e7960b2861/zerorpc-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "e1135a38ba6c4ee3d77e9d197afa7755", "sha256": "1940851ac5f2ea07a111e3422681074c4eb9863835c0561a9b0a1a1ffa996616" }, "downloads": -1, "filename": "zerorpc-0.4.1.tar.gz", "has_sig": true, "md5_digest": "e1135a38ba6c4ee3d77e9d197afa7755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14999, "upload_time": "2013-01-27T02:11:08", "url": "https://files.pythonhosted.org/packages/ca/b4/abc68024ee9dde4147451f7d66a4c86734bc03cb99a8bb30a26a5d6f1237/zerorpc-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "9a7d3dbb9f138d61d4327d0fe9426458", "sha256": "4bec7d29633593978e6be2435e0b61b0cdad7f659bf23d487c4db13c5ab93f68" }, "downloads": -1, "filename": "zerorpc-0.4.2.tar.gz", "has_sig": true, "md5_digest": "9a7d3dbb9f138d61d4327d0fe9426458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15454, "upload_time": "2013-06-10T04:35:12", "url": "https://files.pythonhosted.org/packages/ef/d4/8c05e42f4311604be0521a2bad0741bb0c8c35e10ab3951a21975d432b52/zerorpc-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "aeab807eb630c15cf2ea79adeeebc0a1", "sha256": "2991d909bcf09f9a3cc6ba1a0004882585c29180d778d05409b3999afec84d44" }, "downloads": -1, "filename": "zerorpc-0.4.3.tar.gz", "has_sig": true, "md5_digest": "aeab807eb630c15cf2ea79adeeebc0a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15479, "upload_time": "2013-06-11T03:25:18", "url": "https://files.pythonhosted.org/packages/97/c1/a6e482f2de5e98df2d1a5cd84ca7529e9cc528a0cc5108ab061f143808fc/zerorpc-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "cb54bfbc3c3068dab482e95c543c6e03", "sha256": "df17abe701f77385dd7d63814a6b79d8b8683a5acc3a1475e4047c16d33cd7e2" }, "downloads": -1, "filename": "zerorpc-0.4.4.tar.gz", "has_sig": false, "md5_digest": "cb54bfbc3c3068dab482e95c543c6e03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17810, "upload_time": "2013-10-30T22:44:03", "url": "https://files.pythonhosted.org/packages/6b/09/38b0e73200f674c9bbf88b91cf658928e6eb76382a285c0a5aea019a9375/zerorpc-0.4.4.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "cd6b94bc59fb8a088fd3ad3f063a4029", "sha256": "507668144f4e2d6f0112b79079a6122b022a0e71dee8bcbf117355592569afd1" }, "downloads": -1, "filename": "zerorpc-0.5.1.tar.gz", "has_sig": true, "md5_digest": "cd6b94bc59fb8a088fd3ad3f063a4029", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15997, "upload_time": "2015-06-16T09:54:47", "url": "https://files.pythonhosted.org/packages/f6/43/024b530c81dc1a042a0b5f07c07313b58227b6614087d8f2e0c27015b8e0/zerorpc-0.5.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "8ad71acc838b0345f2a679b638fc40b5", "sha256": "2b356d439be19c5e6b8176239f7653a47afe4d2a92a7fea4483a7a979a0814af" }, "downloads": -1, "filename": "zerorpc-0.5.2.tar.gz", "has_sig": true, "md5_digest": "8ad71acc838b0345f2a679b638fc40b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18588, "upload_time": "2015-09-13T00:06:00", "url": "https://files.pythonhosted.org/packages/1e/6a/087d458ecfaa9c700463ba7df43303fe2359f5cdeeb9b3efb685e461a329/zerorpc-0.5.2.tar.gz" } ], "0.5.2": [], "0.6.0": [ { "comment_text": "", "digests": { "md5": "2457a145293431dd20da6be8f8ece7fe", "sha256": "a33796af8f48d8ec443d878a0a1dd7ae82d037cfaf34c28f053c3370465e9839" }, "downloads": -1, "filename": "zerorpc-0.6.0.tar.gz", "has_sig": true, "md5_digest": "2457a145293431dd20da6be8f8ece7fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19752, "upload_time": "2016-09-04T15:59:57", "url": "https://files.pythonhosted.org/packages/54/8d/50da67685ee4ed028895ca1dbdf6b9b7b378a43fae20856164e4144bab95/zerorpc-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "fed09781036c13810959dc037937ba8a", "sha256": "10a6696f3d927a661f664c57d5083b1d454d153e4ebc89da09d5029d6fb5a091" }, "downloads": -1, "filename": "zerorpc-0.6.1.tar.gz", "has_sig": true, "md5_digest": "fed09781036c13810959dc037937ba8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19961, "upload_time": "2017-04-14T03:47:18", "url": "https://files.pythonhosted.org/packages/35/47/ff12dc8225cfd3334209bae2cc320c67f3e045c88c23436e364bea924092/zerorpc-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "5a050d770e7c0533f61cf0b821e22ecb", "sha256": "9e6e89a162eb294b1e955590412180b79d26ec3a95c59f4b4f6292b86b532a7e" }, "downloads": -1, "filename": "zerorpc-0.6.2-py3-none-any.whl", "has_sig": true, "md5_digest": "5a050d770e7c0533f61cf0b821e22ecb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31964, "upload_time": "2019-06-26T08:35:38", "url": "https://files.pythonhosted.org/packages/8f/a6/21b9e08be2764f28d94c8cfd0164eea0e88d96c72a3adbeb430276827070/zerorpc-0.6.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddca7dac5bc54ead66fb513c445176fe", "sha256": "a2cc7fdb196f55b5714f1d227d42d3fd434c7401009b97505b1bfa938826b8de" }, "downloads": -1, "filename": "zerorpc-0.6.2.tar.gz", "has_sig": false, "md5_digest": "ddca7dac5bc54ead66fb513c445176fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20430, "upload_time": "2019-06-26T08:28:01", "url": "https://files.pythonhosted.org/packages/8a/df/0fb7df038ed9c07082a160e4c1d85e5af27fbb78572f7cce61823c5902c4/zerorpc-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "ce0b97ee692067d49ac1a263b8379207", "sha256": "0a91ab78db756aec25d5c7c326f8d0dcdf852144acba2cced2cfb2e736c51628" }, "downloads": -1, "filename": "zerorpc-0.6.3-py3-none-any.whl", "has_sig": true, "md5_digest": "ce0b97ee692067d49ac1a263b8379207", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 37232, "upload_time": "2019-06-26T09:02:36", "url": "https://files.pythonhosted.org/packages/c5/f9/2ada1ffbc1f89708fbbebd67806417d7ada0262484b743345289e6d4c637/zerorpc-0.6.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa4c82a7fd99707aab3296b891ca50b1", "sha256": "d2ee247a566fc703f29c277d767f6f61f1e12f76d0402faea4bd815f32cbf37f" }, "downloads": -1, "filename": "zerorpc-0.6.3.tar.gz", "has_sig": true, "md5_digest": "fa4c82a7fd99707aab3296b891ca50b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21381, "upload_time": "2019-06-26T09:02:38", "url": "https://files.pythonhosted.org/packages/73/ff/d61ef9f5d10e671421d1368e87d3525325483ebd7da262b1d3087443662b/zerorpc-0.6.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce0b97ee692067d49ac1a263b8379207", "sha256": "0a91ab78db756aec25d5c7c326f8d0dcdf852144acba2cced2cfb2e736c51628" }, "downloads": -1, "filename": "zerorpc-0.6.3-py3-none-any.whl", "has_sig": true, "md5_digest": "ce0b97ee692067d49ac1a263b8379207", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 37232, "upload_time": "2019-06-26T09:02:36", "url": "https://files.pythonhosted.org/packages/c5/f9/2ada1ffbc1f89708fbbebd67806417d7ada0262484b743345289e6d4c637/zerorpc-0.6.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa4c82a7fd99707aab3296b891ca50b1", "sha256": "d2ee247a566fc703f29c277d767f6f61f1e12f76d0402faea4bd815f32cbf37f" }, "downloads": -1, "filename": "zerorpc-0.6.3.tar.gz", "has_sig": true, "md5_digest": "fa4c82a7fd99707aab3296b891ca50b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21381, "upload_time": "2019-06-26T09:02:38", "url": "https://files.pythonhosted.org/packages/73/ff/d61ef9f5d10e671421d1368e87d3525325483ebd7da262b1d3087443662b/zerorpc-0.6.3.tar.gz" } ] }