{ "info": { "author": "Dmitry Orlov ", "author_email": "", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only" ], "description": "AIOHTTP JSON RPC\n================\n\n.. image:: https://travis-ci.org/mosquito/aiohttp-jsonrpc.svg\n :target: https://travis-ci.org/mosquito/aiohttp-jsonrpc\n\n.. image:: https://img.shields.io/pypi/v/aiohttp-jsonrpc.svg\n :target: https://pypi.python.org/pypi/aiohttp-jsonrpc/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/wheel/aiohttp-jsonrpc.svg\n :target: https://pypi.python.org/pypi/aiohttp-jsonrpc/\n\n.. image:: https://img.shields.io/pypi/pyversions/aiohttp-jsonrpc.svg\n :target: https://pypi.python.org/pypi/aiohttp-jsonrpc/\n\n.. image:: https://img.shields.io/pypi/l/aiohttp-jsonrpc.svg\n :target: https://pypi.python.org/pypi/aiohttp-jsonrpc/\n\n\nJSON-RPC server and client implementation based on aiohttp.\n\n\nServer example\n---------------\n\n.. code-block:: python\n\n from aiohttp import web\n from aiohttp_jsonrpc import handler\n\n\n class JSONRPCExample(handler.JSONRPCView):\n def rpc_test(self):\n return None\n\n def rpc_args(self, *args):\n return len(args)\n\n def rpc_kwargs(self, **kwargs):\n return len(kwargs)\n\n def rpc_args_kwargs(self, *args, **kwargs):\n return len(args) + len(kwargs)\n\n def rpc_exception(self):\n raise Exception(\"YEEEEEE!!!\")\n\n\n app = web.Application()\n app.router.add_route('*', '/', JSONRPCExample)\n\n if __name__ == \"__main__\":\n import logging\n logging.basicConfig(level=logging.INFO)\n web.run_app(app, print=logging.info)\n\n\n\nClient example\n--------------\n\n.. code-block:: python\n\n import asyncio\n from aiohttp_jsonrpc.client import ServerProxy, batch\n\n\n loop = asyncio.get_event_loop()\n client = ServerProxy(\"http://127.0.0.1:8080/\", loop=loop)\n\n\n async def main():\n print(await client.test())\n\n # Or via __getitem__\n method = client['args']\n print(await method(1, 2, 3))\n\n results = await batch(\n client,\n client['test'],\n client['test'].prepare(),\n client['args'].prepare(1, 2, 3),\n client['not_found'].prepare(1, 2, 3),\n )\n\n print(results)\n\n client.close()\n\n if __name__ == \"__main__\":\n loop.run_until_complete(main())\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aiohttp-jsonrpc", "package_url": "https://pypi.org/project/aiohttp-jsonrpc/", "platform": "all", "project_url": "https://pypi.org/project/aiohttp-jsonrpc/", "project_urls": null, "release_url": "https://pypi.org/project/aiohttp-jsonrpc/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "aiohttp JSON-RPC server handler and client", "version": "0.1.0" }, "last_serial": 3323268, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1fd935c25dae2e5742a7705734a5a561", "sha256": "26ad38f1d48cdbe1e4c3e70e4a345c45e5b559b8c2c31bc87c94b89249930283" }, "downloads": -1, "filename": "aiohttp-jsonrpc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1fd935c25dae2e5742a7705734a5a561", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5724, "upload_time": "2017-11-10T21:07:05", "url": "https://files.pythonhosted.org/packages/6d/58/77e34a043920fa4f51818b0b18ae800ae2cdcbc8993a93d92d5f33898ad1/aiohttp-jsonrpc-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1fd935c25dae2e5742a7705734a5a561", "sha256": "26ad38f1d48cdbe1e4c3e70e4a345c45e5b559b8c2c31bc87c94b89249930283" }, "downloads": -1, "filename": "aiohttp-jsonrpc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1fd935c25dae2e5742a7705734a5a561", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5724, "upload_time": "2017-11-10T21:07:05", "url": "https://files.pythonhosted.org/packages/6d/58/77e34a043920fa4f51818b0b18ae800ae2cdcbc8993a93d92d5f33898ad1/aiohttp-jsonrpc-0.1.0.tar.gz" } ] }