{ "info": { "author": "nate skulic", "author_email": "nate.skulic@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "webapi\n######\n\nA framework to build web (json-rpc) APIs.\n\n\nQuick Start\n###########\n\nDefining messages and a service::\n \n class TestRequest(messages.Message):\n string = messages.StringField(1)\n\n class TestResponse(messages.Message):\n string = messages.StringField(1)\n \n @webapi.package('examplepackage')\n class ExampleService(object):\n \n @webapi.method(TestRequest, TestResponse, 'examplemethod')\n def test(self, request):\n \"\"\" an identity function\"\"\"\n assert isinstance(request, TestRequest)\n return TestResponse(string=request.string)\n \n \nBuilding a wsgi application::\n\n\n API = webapi.api([ExampleService], 'exampleapi', 'v1')\n \n routes = [\n webapp2.Route('/rpc', webapi.rpc_handler(API))\n ]\n app = webapp2.WSGIApplication(routes)\n \n \nThe api should be available at /rpc. \n\nA method exampleapi.examplepackage.examplemethod should be available to callers.\n\n\nExporting a discovery application\n#################################\n\n\nDefine in python::\n\n API = webapi.api([TestService], 'testapi', 'v1')\n \n api_directory_app = webapi.APIDirectory([API])\n\nRegister with app.yaml to match the path /discovery/.*.\n\nUsing the javascript client.\n############################\n\nUsing the basic client\n######################\n\nInclude the compiled script.\n\n\nInstalling::\n\n var RPC_URL = '/rpc';\n \n webapi.client.install(new webapi.RpcClient(RPC_URL));\n\n\nCalling a method::\n\n var METHOD = 'exampleapi.examplepackage.examplemethod'\n \n var req = webapi.client.rpc(METHOD, {'string': 'test'});\n \n req.addCallback(function(resp){\n // this should return \"test\"\n console.log(resp)\n }); \n \n req.addErrback(function(resp){\n // jsonrpc error objects can be handled here\n console.error(resp)\n });\n\n\nUsing the directory client\n##########################\n\nInclude the compiled script.\n\n\nInstalling::\n\n var RPC_URL = '/rpc';\n \n webapi.client.install(new webapi.DiscoveryClient());\n\n\nLoading an api (from a directory)::\n\n webapi.client.load(apiName, apiVersion, root)\n\nLoading a rest description (from a json object)::\n\n webapi.client.loadDescription(rawRestDescription)\n \nAfter loading an api its methods will be exported to the webapi namespace. For example::\n\n var request = webapi.apiname.package.method();\n \nExecuting an rpc method (manually)::\n\n var request = webapi.client.rpc(methodId, params);\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://code.google.com/p/webapi", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "webapi", "package_url": "https://pypi.org/project/webapi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/webapi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://code.google.com/p/webapi" }, "release_url": "https://pypi.org/project/webapi/0.1/", "requires_dist": null, "requires_python": null, "summary": "A framework to build web (json-rpc) APIs.", "version": "0.1" }, "last_serial": 866531, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8feb45cbc4e3c82d77c93deb1b6cbd96", "sha256": "3c489bd26d3d0b14cf1ffa5eac4cfd86c3a1b839b767cdc72913365f493317d8" }, "downloads": -1, "filename": "webapi-0.1.tar.gz", "has_sig": false, "md5_digest": "8feb45cbc4e3c82d77c93deb1b6cbd96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19967, "upload_time": "2013-09-16T05:56:40", "url": "https://files.pythonhosted.org/packages/7f/82/5357a60827f21b4aa4ec28f97397bcb408910a3ab4f3312b0a3306aa372f/webapi-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8feb45cbc4e3c82d77c93deb1b6cbd96", "sha256": "3c489bd26d3d0b14cf1ffa5eac4cfd86c3a1b839b767cdc72913365f493317d8" }, "downloads": -1, "filename": "webapi-0.1.tar.gz", "has_sig": false, "md5_digest": "8feb45cbc4e3c82d77c93deb1b6cbd96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19967, "upload_time": "2013-09-16T05:56:40", "url": "https://files.pythonhosted.org/packages/7f/82/5357a60827f21b4aa4ec28f97397bcb408910a3ab4f3312b0a3306aa372f/webapi-0.1.tar.gz" } ] }