{ "info": { "author": "Robin Walsh & Harvey Rogers", "author_email": "rob.walsh@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "flask-sillywalk\n===============\n\nA Flask extension that implements Swagger support (http://swagger.wordnik.com/)\n\nWhat's Swagger?\n---------------\n\nSwagger is a spec to help you document your APIs. It's flexible and\nproduces beautiful API documentation that can then be used to build\nAPI-explorer-type sites, much like the one at\nhttp://developer.wordnik.com/docs -- To read more about the Swagger\nspec, head over to https://github.com/wordnik/swagger-core/wiki or\nhttp://swagger.wordnik.com\n\nGit Repository and issue tracker: https://github.com/hobbeswalsh/flask-sillywalk\nDocumentation: http://flask-sillywalk.readthedocs.org/en/latest/\n\n.. |travisci| image:: https://travis-ci.org/hobbeswalsh/flask-sillywalk.png\n.. _travisci: https://travis-ci.org/hobbeswalsh/flask-sillywalk\n\n|travisci|_\n\nWhy do I want it?\n-----------------\n\n* You want your API to be easy to read.\n* You want other people to be able to use your API easily.\n* You'd like to build a really cool API explorer.\n* It's Friday night and your friend just ditched on milkshakes.\n\n\nHow do I get it?\n----------------\n\nFrom your favorit shell:: \n\n $ pip install flask-sillywalk\n\n\nHow do I use it?\n----------------\n\nI'm glad you asked. In order to use this code, you need to first\ninstantiate a SwaggerApiRegistry, which will keep track of all your API\nendpoints and documentation.\n\nUsage::\n \n from flask import Flask\n from flask.ext.sillywalk import SwaggerApiRegistry, ApiParameter, ApiErrorResponse\n\n app = Flask(\"my_api\")\n registry = SwaggerApiRegistry(\n app,\n baseurl=\"http://localhost:5000/api/v1\",\n api_version=\"1.0\",\n api_descriptions={\"cheese\": \"Operations with cheese.\"})\n register = registry.register\n registerModel = registry.registerModel\n\nThen, instead of using the \"@app.route\" decorator that you're used to\nusing with Flask, you use the \"register\" decorator you defined above (or\n\"registerModel\" if you're registering a class that describes a possible\nAPI return value).\n\nNow that we've got an API registry, we can register some functions. The\n@register decorator, when just given a path (like @app.route), will\nregister a GET mthod with no possible parameters. In order to document a\nmethod with parameters, we can feed the @register function some\nparameters.\n\nUsage::\n\n @register(\"/api/v1/cheese/random\")\n def get_random_cheese():\n \"\"\"Fetch a random Cheese from the database.\n Throws OutOfCheeseException if this is not a cheese shop.\"\"\"\n return htmlify(db.cheeses.random())\n\n @register(\"/api/v1/cheese/\",\n parameters=[\n ApiParameter(\n name=\"cheeseName\",\n description=\"The name of the cheese to fetch\",\n required=True,\n dataType=\"str\",\n paramType=\"path\",\n allowMultiple=False)\n ],\n responseMessages=[\n ApiErrorResponse(400, \"Sorry, we're fresh out of that cheese.\")\n ])\n def get_cheese(cheeseName):\n \"\"\"Gets a single cheese from the database.\"\"\"\n return htmlify(db.cheeses.fetch(name=cheeseName))\n\nNow, if you navigate to http://localhost:5000/api/v1/resources.json you\nshould see the automatic API documentation. See documentation for all the\ncheese endpoints at http://localhost:5000/api/v1/cheese.json\n\n\nWhat's left to do?\n------------------\n\nWell, lots, actually. This release:\n\n* Doesn't support XML (but do we really want to?)\n* Doesn't support the full swagger spec (e.g. \"type\" in data models\n* Lots more. Let me know!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hobbeswalsh/flask-sillywalk", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "Flask-Sillywalk", "package_url": "https://pypi.org/project/Flask-Sillywalk/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Sillywalk/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hobbeswalsh/flask-sillywalk" }, "release_url": "https://pypi.org/project/Flask-Sillywalk/2.1/", "requires_dist": null, "requires_python": null, "summary": "So you want to implement an auto-documenting API?", "version": "2.1" }, "last_serial": 1448116, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "8d73e3c024548b43a9522e0f3ce31eab", "sha256": "934582f60da7409191ad0f52ade12bf1facc235ee855252376685fc4e844a252" }, "downloads": -1, "filename": "Flask-Sillywalk-1.0.tar.gz", "has_sig": false, "md5_digest": "8d73e3c024548b43a9522e0f3ce31eab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1164, "upload_time": "2015-02-03T16:54:57", "url": "https://files.pythonhosted.org/packages/7a/39/7882f58bf0c21b669c305babf3b8d22ceaebcfc4c92d7877f96076488655/Flask-Sillywalk-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "de407b26ae4863a97ecb38cc141ce1c7", "sha256": "d79ce72097dccc85ae81540d8706808ddcf228cb20a7777b7cbd87d661113d15" }, "downloads": -1, "filename": "Flask-Sillywalk-1.0.1.tar.gz", "has_sig": false, "md5_digest": "de407b26ae4863a97ecb38cc141ce1c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3925, "upload_time": "2015-02-03T16:59:06", "url": "https://files.pythonhosted.org/packages/80/53/a91e82dd3737be5230b9192048715abf19fe18323b3885ed51cb42ff9bca/Flask-Sillywalk-1.0.1.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "8e8af1b9281df825b91e4f1c803d96a6", "sha256": "0fcaa1f031c0f188f04b86c670b7bf90369c54a3862a2cf32ca54a945a607c03" }, "downloads": -1, "filename": "Flask-Sillywalk-2.1.zip", "has_sig": false, "md5_digest": "8e8af1b9281df825b91e4f1c803d96a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16324, "upload_time": "2015-03-04T18:22:44", "url": "https://files.pythonhosted.org/packages/dc/b5/c365535be0d9232143e9d359417c8a44ad7d410c2bb4762c2ccca81aee05/Flask-Sillywalk-2.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e8af1b9281df825b91e4f1c803d96a6", "sha256": "0fcaa1f031c0f188f04b86c670b7bf90369c54a3862a2cf32ca54a945a607c03" }, "downloads": -1, "filename": "Flask-Sillywalk-2.1.zip", "has_sig": false, "md5_digest": "8e8af1b9281df825b91e4f1c803d96a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16324, "upload_time": "2015-03-04T18:22:44", "url": "https://files.pythonhosted.org/packages/dc/b5/c365535be0d9232143e9d359417c8a44ad7d410c2bb4762c2ccca81aee05/Flask-Sillywalk-2.1.zip" } ] }