{ "info": { "author": "Tomotaka Ito", "author_email": "tomotaka.ito@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==========\nbottle-api\n==========\n\n\nInstallation\n============\n\n:: \n\n $ pip install bottle-api\n\n\nBasic Usage\n===========\n\njson_endpoint decorator will make a function to JSON WebAPI endpoint.\ndecorated function will return bottle.HTTPResponse.\n\nsee this sample web app:\n\n::\n\n #!python\n from bottleapi import WebApiError\n from bottleapi.jsonapi import json_endpoint\n from bottle import Bottle, request\n \n app = Bottle()\n \n @json_endpoint\n def devide():\n a = int(request.params['a'])\n b = int(request.params['b'])\n if b == 0:\n raise WebApiError('b cannot be zero', status=400)\n \n result = a / b\n return dict(value=result)\n \n app.route('/devide', ['GET'], devide)\n \n\nif you access ``/device?a=1&b=1``, it will return ``200 OK`` response with body:\n\n::\n\n {\"status\": \"ok\", \"result\": {\"value\": 1}}\n\nwith Content-Type ``application/json``\n\nbut when you access ``device?a=1&b=0``, you will get ``400 BAD REQUEST`` response with body:\n\n::\n\n {\"status\": \"error\", \"message\": \"b cannot be zero\", \"result\": null}\n\n\nIf you want to use JSONP, you can specify callback function name with parameter(``j`` by default)\nSo accessing ``/device?a=4&b=2&j=my_callback`` will result:\n\n::\n\n my_callback({\"status\": \"ok\", \"result\": {\"value\": 2}});\n\nIf you dont like parameter or result data format, You can define your own formatters(success/error).\nSee jsonapi.py for customized formatter example.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tomotaka/bottle-api", "keywords": "", "license": "The MIT License (MIT)", "maintainer": "", "maintainer_email": "", "name": "bottle-api", "package_url": "https://pypi.org/project/bottle-api/", "platform": null, "project_url": "https://pypi.org/project/bottle-api/", "project_urls": { "Homepage": "https://github.com/tomotaka/bottle-api" }, "release_url": "https://pypi.org/project/bottle-api/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "useful decorator for building WebAPI on Bottle web framework development", "version": "0.0.4" }, "last_serial": 2527759, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6c531058867da10592cbf17947530ff3", "sha256": "916655e71d58a7eb1e714e7536087c3283be61c074bdb4a525b1f9a9322504f3" }, "downloads": -1, "filename": "bottle-api-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6c531058867da10592cbf17947530ff3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2713, "upload_time": "2014-10-01T02:54:12", "url": "https://files.pythonhosted.org/packages/12/c6/2ac77bf9f3f45f7f5d432d54901cee2bbe736c0832fdd16ed2026ad06761/bottle-api-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "6b064de05dd43c0d2373ea1c4e1355f4", "sha256": "1e8c5a6921d639b376ade65d5d60a173353f8587f5e38a6653b951a413caedf8" }, "downloads": -1, "filename": "bottle-api-0.0.2.tar.gz", "has_sig": false, "md5_digest": "6b064de05dd43c0d2373ea1c4e1355f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3469, "upload_time": "2014-11-18T12:49:27", "url": "https://files.pythonhosted.org/packages/53/ff/394da57eb0d13add8e472535675be9e75b097a14b73044489654cce5cee0/bottle-api-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "d8a15b1b70114b122ff6d3e52d9a62a4", "sha256": "2d019d853894c226ea3227d177ef3ff24ed8083279b3cd3b0f42afef9c16e351" }, "downloads": -1, "filename": "bottle-api-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d8a15b1b70114b122ff6d3e52d9a62a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3494, "upload_time": "2014-12-04T07:54:08", "url": "https://files.pythonhosted.org/packages/2c/42/f97300a93f5809cd771a84d8e22cff3a2a29c93358e8c8f23cc098c55695/bottle-api-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "356e0b02892e68c33b546516738f9255", "sha256": "a97ef0123206e97ff8a07b080a1dfb980bbff7bb4dd6b02f292ac367b40702e4" }, "downloads": -1, "filename": "bottle-api-0.0.4.tar.gz", "has_sig": false, "md5_digest": "356e0b02892e68c33b546516738f9255", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3516, "upload_time": "2016-12-19T08:51:52", "url": "https://files.pythonhosted.org/packages/1e/7f/5cfaabc035417ceed7b720f6bef2cee8bfbc3a79181d1597458943a0670e/bottle-api-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "356e0b02892e68c33b546516738f9255", "sha256": "a97ef0123206e97ff8a07b080a1dfb980bbff7bb4dd6b02f292ac367b40702e4" }, "downloads": -1, "filename": "bottle-api-0.0.4.tar.gz", "has_sig": false, "md5_digest": "356e0b02892e68c33b546516738f9255", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3516, "upload_time": "2016-12-19T08:51:52", "url": "https://files.pythonhosted.org/packages/1e/7f/5cfaabc035417ceed7b720f6bef2cee8bfbc3a79181d1597458943a0670e/bottle-api-0.0.4.tar.gz" } ] }