{ "info": { "author": "Marcel Rieger", "author_email": "python-jsonrpyc@googlegroups.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "\"jsonrpyc\n-\n\n[![Build Status](https://travis-ci.org/riga/jsonrpyc.svg?branch=master)](https://travis-ci.org/riga/jsonrpyc) [![Documentation Status](https://readthedocs.org/projects/jsonrpyc/badge/?version=latest)](http://jsonrpyc.readthedocs.org/en/latest/?badge=latest)\n\nMinimal python RPC implementation in a single file based on the [JSON-RPC 2.0 specs](http://www.jsonrpc.org/specification).\n\n\n## Usage\n\n``jsonrpyc.RPC`` instances basically wrap an input stream and an output stream in order to communicate with other *services*. A service is not even forced to be written in Python as long as it strictly implements the JSON-RPC 2.0 specs. A suitable implementation for NodeJs is [node-json-rpc](https://github.com/riga/node-json-rpc). A ``jsonrpyc.RPC`` instance may wrap a *target* object. Incomming requests will be routed to methods of this object whose result might be sent back as a response. Example implementation:\n\n\n##### ``server.py``\n\n```python\nimport jsonrpyc\n\nclass MyTarget(object):\n\n def greet(self, name):\n return \"Hi, %s!\" % name\n\njsonrpyc.RPC(MyTarget())\n```\n\n\n##### ``client.py``\n\n```python\nimport jsonrpyc\nfrom subprocess import Popen, PIPE\n\np = Popen([\"python\", \"server.py\"], stdin=PIPE, stdout=PIPE)\nrpc = jsonrpyc.RPC(stdout=p.stdin, stdin=p.stdout)\n\n#\n# sync usage\n#\n\nprint(rpc(\"greet\", args=(\"John\",), block=0.1))\n# => \"Hi, John!\"\n\n\n#\n# async usage\n#\n\ndef cb(err, res=None):\n if err:\n raise err\n print(\"callback got: \" + res)\n\nrpc(\"greet\", args=(\"John\",), callback=cb)\n\n# cb is called asynchronously which prints\n# => \"callback got: Hi, John!\"\n```\n\n\n## Installation\n\nVia [pip](https://pypi.python.org/pypi/jsonrpyc)\n\n```bash\npip install jsonrpyc\n```\n\nor by simply copying the file into your project.\n\n\n## Contributing\n\nIf you like to contribute to jsonrpyc, I'm happy to receive pull requests. Just make sure to add a new test cases and run them via:\n\n```bash\n> python -m unittest tests\n```\n\n\n## Development\n\n- Source hosted at [GitHub](https://github.com/riga/jsonrpyc)\n- Report issues, questions, feature requests on [GitHub Issues](https://github.com/riga/jsonrpyc/issues)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/riga/jsonrpyc", "keywords": "rpc,json,json-rpc,2.0", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "jsonrpyc", "package_url": "https://pypi.org/project/jsonrpyc/", "platform": "", "project_url": "https://pypi.org/project/jsonrpyc/", "project_urls": { "Homepage": "https://github.com/riga/jsonrpyc" }, "release_url": "https://pypi.org/project/jsonrpyc/1.1.0/", "requires_dist": null, "requires_python": ">=2.7", "summary": "Minimal python RPC implementation in a single file based on the JSON-RPC 2.0 specs from", "version": "1.1.0" }, "last_serial": 5219301, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "57e39b158f63deb84652968bc027edfe", "sha256": "358b1e2de740b345a0999ebec407ebfed34cc70c049e05840ae8544f2d0fa8cb" }, "downloads": -1, "filename": "jsonrpyc-0.0.1.tar.gz", "has_sig": false, "md5_digest": "57e39b158f63deb84652968bc027edfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1884, "upload_time": "2016-04-19T17:56:50", "url": "https://files.pythonhosted.org/packages/75/15/8b12161555e934592192e16eccdd59cedd70e5940f64f1893fd695872432/jsonrpyc-0.0.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "d8df17525f86a140a946b895818a5dc6", "sha256": "927d44e412aea1d2bada205f9b4dbec7ece633c0fbd0172cdc923c40b3bbe193" }, "downloads": -1, "filename": "jsonrpyc-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d8df17525f86a140a946b895818a5dc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7318, "upload_time": "2016-04-23T18:21:16", "url": "https://files.pythonhosted.org/packages/a5/97/573113fbc7b890137d7a2f74ac0a40a2f4b4716ba700413acdd9ab902b88/jsonrpyc-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8546d95bf8fb0fd03b128a8c50567c84", "sha256": "9b0c197e4999f8aba830595618f2fdfa046ebb5e68a4330e6720d93616ee46a1" }, "downloads": -1, "filename": "jsonrpyc-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8546d95bf8fb0fd03b128a8c50567c84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7352, "upload_time": "2016-04-23T18:36:15", "url": "https://files.pythonhosted.org/packages/63/55/e00bb3d7dff0c7e6e9c7a4c1d7a56c9e123333243a54f9d46e23bd5b10e3/jsonrpyc-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3f60ed75580b8a8c38f25c753deeb296", "sha256": "b2a278799a0e8724fe05d9f97eab8a24813b191b868befd1bd290fbd60a9a568" }, "downloads": -1, "filename": "jsonrpyc-1.0.2.tar.gz", "has_sig": false, "md5_digest": "3f60ed75580b8a8c38f25c753deeb296", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7364, "upload_time": "2016-04-24T06:10:29", "url": "https://files.pythonhosted.org/packages/73/13/34106147afb9cc133e7252bf04f2e94734db31686e7d64601ffbb6a329fb/jsonrpyc-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ede7a4d5a232b54567071cdd39eef64e", "sha256": "713a57660489e6c5689d88681542109563e51096cb6776a97dc31b7234e89ea8" }, "downloads": -1, "filename": "jsonrpyc-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ede7a4d5a232b54567071cdd39eef64e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 7948, "upload_time": "2019-05-02T20:54:55", "url": "https://files.pythonhosted.org/packages/73/c6/7c037c179e91a00359daa34fe97695f88540311646c97f484b594d57f8b9/jsonrpyc-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ede7a4d5a232b54567071cdd39eef64e", "sha256": "713a57660489e6c5689d88681542109563e51096cb6776a97dc31b7234e89ea8" }, "downloads": -1, "filename": "jsonrpyc-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ede7a4d5a232b54567071cdd39eef64e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 7948, "upload_time": "2019-05-02T20:54:55", "url": "https://files.pythonhosted.org/packages/73/c6/7c037c179e91a00359daa34fe97695f88540311646c97f484b594d57f8b9/jsonrpyc-1.1.0.tar.gz" } ] }