{ "info": { "author": "Dan Brown", "author_email": "dan@stompydan.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "========================\nJSON-RPC 2.0 Over ZeroMQ\n========================\n\n.. image:: https://travis-ci.org/dwb/jsonrpc2-zeromq-python.svg?branch=master\n :alt: Travis build status\n :target: https://travis-ci.org/dwb/jsonrpc2-zeromq-python\n\nWritten by `Dan Brown `_. See the the LICENSE file for licensing information.\n\nThis is a library in Python enabling `JSON-RPC 2.0 `_ over `ZeroMQ `_. It includes support for both clients and servers.\n\nThis is packaged as a standard Python project, so just install using ``python setup.py install``, or with `pip `_.\n\nSupports Python 2.7 and 3.3+.\n\nServers\n-------\n\n::\n\n from jsonrpc2_zeromq import RPCServer\n\n class EchoServer(RPCServer):\n \n def handle_echo_method(self, msg):\n return msg\n\n s = EchoServer(\"tcp://127.0.0.1:57570\")\n s.run()\n\nThis creates a server listening on a ZeroMQ REP socket \u2013 so only methods are allowed, not notifications. See the ``RPCNotificationServer`` as well, which will listen on a ROUTER socket and allow notifications.\n\nEach server is a Python ``Thread``, so the call to ``run()`` can be replaced by ``start()`` to have it running in a background thread.\n\nClients\n-------\n\n::\n\n from jsonrpc2_zeromq import RPCClient\n\n c = RPCClient(\"tcp://127.0.0.1:57570\")\n print c.echo(\"Echo?\")\n\n # Assuming the above compliant server, should print \"Echo?\"\n\nThere are various classes, assuming different JSON-RPC 2.0 and ZeroMQ characteristics. The above, for example, will connect a REQ socket to the given endpoint.\n\nNotifications\n-------------\n\nGiven a server that accepts notifications::\n\n from jsonrpc2_zeromq import RPCNotificationServer\n\n class EventReceiver(RPCNotificationServer):\n \n def handle_event_method(self, event_type, event_data):\n print \"Got event!\\nType: {0}\\nData: {1}\\n\".format(event_type, event_data)\n\n s = EventReceiver(\"tcp://127.0.0.1:60666\")\n s.run()\n\nYou can then send notifications thus::\n\n from jsonrpc2_zeromq import RPCNotifierClient\n\n c = RPCNotifierClient(\"tcp://127.0.0.1:60666\")\n c.notify.event('birthday!', 'yours!')\n\nAlso included are ``NotificationOnlyPullServer`` and ``NotifierOnlyPushClient`` which are designed for sending only notifications one-way over PUSH and PULL sockets.\n\nThere is also a client, ``NotificationReceiverClient``, that is able to handle notifications returned back to it from a server. This is useful for situations where you \"subscribe\", via a standard RPC call, to events from the server, and they are returned back to the client as notifications when they occur. There is not currently a corresponding server class for this pattern. Here is a (one-sided) example::\n\n from jsonrpc2_zeromq import NotificationReceiverClient\n\n class EventSubscriber(NotificationReceiverClient):\n\n def handle_event_notification(self, event_type, event_data):\n print \"Got event!\\nType: {0}\\nData: {1}\\n\".format(event_type, event_data)\n\n c = EventSubscriber(\"tcp://127.0.0.1:60666\")\n c.subscribe()\n c.wait_for_notifications()\n\nLogging\n-------\n\nThe `standard Python logging module `_ is used for logging. It doesn't output anything by default. Either retrieve the built-in library logger with ``logging.getLogger('jsonrpc2_zeromq')`` or pass your own ``Logger`` instance into a client or server's ``__init__`` with the ``logger`` keyword argument.\n\nCurrently there are some helpful messages outputted at the ``DEBUG`` level, server exceptions on ``ERROR``, and a server start message on ``INFO``.\n\nTesting\n-------\n\nTests are included. Run ``python setup.py test`` in the project root.\n\nHistory\n-------\n\n2.0\n * Python 3.3+ support\n1.1.2\n * Allow newer (v14) pyzmq.\n * Don't raise EINTR in server recv loop.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/dwb/jsonrpc2-zeromq-python/archive/v2.0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dwb/python-jsonrpc2-zeromq", "keywords": null, "license": "License :: OSI Approved :: BSD License", "maintainer": null, "maintainer_email": null, "name": "jsonrpc2-zeromq", "package_url": "https://pypi.org/project/jsonrpc2-zeromq/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonrpc2-zeromq/", "project_urls": { "Download": "https://github.com/dwb/jsonrpc2-zeromq-python/archive/v2.0.1.tar.gz", "Homepage": "https://github.com/dwb/python-jsonrpc2-zeromq" }, "release_url": "https://pypi.org/project/jsonrpc2-zeromq/2.0.1/", "requires_dist": null, "requires_python": null, "summary": "Library for JSON-RPC 2.0 over ZeroMQ", "version": "2.0.1" }, "last_serial": 1499437, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "554111a2a647bdccfbdb8c0d9367c1d7", "sha256": "1de419c637ba77c98aafd98f496c95000643d17787c5898a465c4b21a64b404c" }, "downloads": -1, "filename": "jsonrpc2-zeromq-1.0.0.tar.gz", "has_sig": false, "md5_digest": "554111a2a647bdccfbdb8c0d9367c1d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7299, "upload_time": "2012-01-17T11:12:12", "url": "https://files.pythonhosted.org/packages/ca/85/625969adabd6ec652e2f6d016b9ad6bb141924b0bd964603ea5fc76db82d/jsonrpc2-zeromq-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3dabe9dfb618b4ba247031e3f32431b3", "sha256": "be7a3799e0110783d7390f493503f02fdd288bc726343399ce937b4a6b8831d2" }, "downloads": -1, "filename": "jsonrpc2-zeromq-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3dabe9dfb618b4ba247031e3f32431b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8119, "upload_time": "2012-01-18T18:24:14", "url": "https://files.pythonhosted.org/packages/13/e9/abb0834f7b99c2b3d7d6c132a884b434106871574d3aa2be953a42f3d25d/jsonrpc2-zeromq-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "2983e2a99bea9d944696226781f7bd11", "sha256": "5401ae4fc9604a94ce4cce5c2155b624011e79ab7934ea543003175a7aa0836a" }, "downloads": -1, "filename": "jsonrpc2-zeromq-1.1.1.tar.gz", "has_sig": false, "md5_digest": "2983e2a99bea9d944696226781f7bd11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8480, "upload_time": "2012-01-19T16:58:20", "url": "https://files.pythonhosted.org/packages/8c/6f/ef6c012452ec5dc040c3896417a8e15b02cabaf5a9495c683096551c9b89/jsonrpc2-zeromq-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "117d3b37a874caf958312a9dc9cfd472", "sha256": "39cd7975e30fc49a11bd04fd2a7a90c529b864e24b6ed089816700b27d7c66c7" }, "downloads": -1, "filename": "jsonrpc2_zeromq-1.1.2-py2.7.egg", "has_sig": false, "md5_digest": "117d3b37a874caf958312a9dc9cfd472", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 19065, "upload_time": "2015-03-04T14:57:25", "url": "https://files.pythonhosted.org/packages/4b/eb/92c2a09cbf8f3e5acc4113f2e0608b986033af35e09b0f94c94179a5e378/jsonrpc2_zeromq-1.1.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "a88993beb4098d745dd572a8ccf59aed", "sha256": "392f9757d1e032a08eeef5136d784d3931770a97724d435c78a04aff7abd54db" }, "downloads": -1, "filename": "jsonrpc2-zeromq-1.1.2.tar.gz", "has_sig": false, "md5_digest": "a88993beb4098d745dd572a8ccf59aed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8591, "upload_time": "2015-03-04T14:57:23", "url": "https://files.pythonhosted.org/packages/53/8a/90cde9a2b3c56f998196ca4b41410188670ad64ee7d15b3cbad6bf0d69fa/jsonrpc2-zeromq-1.1.2.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "7a77bd2588606293155c1149d77305b9", "sha256": "db513355446d309dfa37933be16b087a983d213295cd1564d96d15f66e6663a4" }, "downloads": -1, "filename": "jsonrpc2-zeromq-2.0.0.tar.gz", "has_sig": false, "md5_digest": "7a77bd2588606293155c1149d77305b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8885, "upload_time": "2015-04-08T13:05:48", "url": "https://files.pythonhosted.org/packages/90/3f/3fdc95721f02a41255ce5300795fa0ed1646c0719580e710bf2bbbed72a8/jsonrpc2-zeromq-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "fcee069accdcb2f78b2f830a9e2a6b95", "sha256": "f866bcb0eda4351c4bb3ed2fb72e335f0ee40ded41bd073502ee4855f75620d6" }, "downloads": -1, "filename": "jsonrpc2-zeromq-2.0.1.tar.gz", "has_sig": false, "md5_digest": "fcee069accdcb2f78b2f830a9e2a6b95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8996, "upload_time": "2015-04-10T17:07:55", "url": "https://files.pythonhosted.org/packages/ab/cd/861899cc5e5554a65699f3d44933ef3f4b4bd7b11b5cc3ceca6607781449/jsonrpc2-zeromq-2.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fcee069accdcb2f78b2f830a9e2a6b95", "sha256": "f866bcb0eda4351c4bb3ed2fb72e335f0ee40ded41bd073502ee4855f75620d6" }, "downloads": -1, "filename": "jsonrpc2-zeromq-2.0.1.tar.gz", "has_sig": false, "md5_digest": "fcee069accdcb2f78b2f830a9e2a6b95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8996, "upload_time": "2015-04-10T17:07:55", "url": "https://files.pythonhosted.org/packages/ab/cd/861899cc5e5554a65699f3d44933ef3f4b4bd7b11b5cc3ceca6607781449/jsonrpc2-zeromq-2.0.1.tar.gz" } ] }