{ "info": { "author": "Moritz Wundke", "author_email": "b.thax.dcg@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable" ], "description": "simplejsonrpc\r\n=============\r\n\r\n|Build Status|\r\n\r\nSimple JSON-RPC 2.0 compilant middleware for python using decorators.\r\nWith just a few lines of code you get a JSONRPC 2.0 compilant web API\r\nrunning and ready for your needs!\r\n\r\nUsage\r\n-----\r\n\r\nJust create a service class to store your API calls and decorate your\r\nmethods:\r\n\r\n.. code:: python\r\n\r\n from simplejsonrpc import *\r\n\r\n loginservice = SimpleJSONRPCService(api_version=1)\r\n\r\n @jsonremote(loginservice, name='login', doc='Method used to log a user in')\r\n def login(request, user_name, user_pass):\r\n (...)\r\n\r\nMore complex example interating it into [Web.py!]\r\n\r\n.. code:: python\r\n\r\n import web\r\n \r\n urls = (\r\n '/', 'index'\r\n , '/api/', 'json_handler'\r\n , '/api', 'json_handler'\r\n )\r\n app = web.application(urls, globals())\r\n\r\n api_service = SimpleJSONRPCService(api_version=1)\r\n\r\n class index: \r\n def GET(self, name):\r\n if not name: \r\n name = 'World'\r\n return 'Hello, ' + name + '!'\r\n\r\n class json_handler: \r\n def POST(self):\r\n return api_service(web.webapi.data())\r\n\r\n @jsonremote(api_service, doc='print api documentation')\r\n def api(request):\r\n return api_service.api()\r\n \r\n @jsonremote(api_service, doc='ping server')\r\n def ping(request):\r\n return \"pong\"\r\n\r\n if __name__ == \"__main__\":\r\n app.run()\r\n\r\nAdding API versioning to the previous example\r\n\r\n.. code:: python\r\n\r\n import web\r\n \r\n urls = (\r\n '/', 'index'\r\n , '/api/1/', 'json_handler_v1'\r\n , '/api/1', 'json_handler_v1'\r\n , '/api/2/', 'json_handler_v2'\r\n , '/api/2', 'json_handler_v2'\r\n )\r\n app = web.application(urls, globals())\r\n\r\n api_service_v1 = SimpleJSONRPCService(api_version=1)\r\n api_service_v2 = SimpleJSONRPCService(api_version=2)\r\n\r\n class index: \r\n def GET(self, name):\r\n if not name: \r\n name = 'World'\r\n return 'Hello, ' + name + '!'\r\n\r\n class json_handler_v1: \r\n def POST(self):\r\n return api_service_v1(web.webapi.data())\r\n\r\n class json_handler_v1: \r\n def POST(self):\r\n return api_service_v2(web.webapi.data())\r\n\r\n @jsonremote(api_service_v1, doc='print api documentation')\r\n def api(request):\r\n return api_service_v1.api()\r\n\r\n @jsonremote(api_service_v1, doc='ping server')\r\n def ping(request):\r\n return \"pong\"\r\n\r\n @jsonremote(api_service_v2, name='api', doc='print api documentation')\r\n def api_v2(request):\r\n return api_service_v2.api()\r\n\r\n @jsonremote(api_service_v2, name='ping', doc='ping server')\r\n def ping_v2(request):\r\n return \"pong\"\r\n\r\n if __name__ == \"__main__\":\r\n app.run()\r\n\r\nLicense\r\n-------\r\n\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2014-2016 Moritz Wundke\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n\r\n.. |Build Status| image:: https://travis-ci.org/moritz-wundke/simplejsonrpc.svg?branch=master\r\n :target: https://travis-ci.org/moritz-wundke/simplejsonrpc", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/moritz-wundke/simplejsonrpc/releases/tag/Release_1.2.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/moritz-wundke/simplejsonrpc", "keywords": "jsonrpc,rpc,json", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "simplejsonrpc", "package_url": "https://pypi.org/project/simplejsonrpc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/simplejsonrpc/", "project_urls": { "Download": "https://github.com/moritz-wundke/simplejsonrpc/releases/tag/Release_1.2.1", "Homepage": "https://github.com/moritz-wundke/simplejsonrpc" }, "release_url": "https://pypi.org/project/simplejsonrpc/1.2.1/", "requires_dist": null, "requires_python": null, "summary": "Simple JSON-RPC 2.0 compilant middleware for python using decorators. With just a few lines of code you get a JSONRPC 2.0 compilant web API running and ready for your needs!", "version": "1.2.1" }, "last_serial": 2260605, "releases": { "1.2.1": [ { "comment_text": "", "digests": { "md5": "bbe043e4c6b4ba10eec1c421faa15bb7", "sha256": "c24949e1093e9f3ce742bf8697175936e07a502048dcf04372779d04f6f44c7c" }, "downloads": -1, "filename": "simplejsonrpc-1.2.1.zip", "has_sig": false, "md5_digest": "bbe043e4c6b4ba10eec1c421faa15bb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2641, "upload_time": "2016-08-03T19:18:54", "url": "https://files.pythonhosted.org/packages/d9/ab/e53bf7be7afa8823a80224afa43a9ff7690037f2b6b716257addae85e135/simplejsonrpc-1.2.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bbe043e4c6b4ba10eec1c421faa15bb7", "sha256": "c24949e1093e9f3ce742bf8697175936e07a502048dcf04372779d04f6f44c7c" }, "downloads": -1, "filename": "simplejsonrpc-1.2.1.zip", "has_sig": false, "md5_digest": "bbe043e4c6b4ba10eec1c421faa15bb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2641, "upload_time": "2016-08-03T19:18:54", "url": "https://files.pythonhosted.org/packages/d9/ab/e53bf7be7afa8823a80224afa43a9ff7690037f2b6b716257addae85e135/simplejsonrpc-1.2.1.zip" } ] }