{ "info": { "author": "Arnaud Coomans", "author_email": "arnaud.coomans@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-Autodoc\n=============\n\nFlask-Autodoc is a Flask extension that automatically creates documentation for your endpoints based on the routes, function arguments and docstrings.\n\n[![Build](https://api.travis-ci.org/acoomans/flask-autodoc.png)](https://travis-ci.org/acoomans/flask-autodoc)\n[![Pypi version](http://img.shields.io/pypi/v/flask-autodoc.svg)](https://pypi.python.org/pypi/Flask-Autodoc)\n[![Pypi license](http://img.shields.io/pypi/l/flask-autodoc.svg)](https://pypi.python.org/pypi/Flask-Autodoc)\n![Python 2](http://img.shields.io/badge/python-2-blue.svg)\n![Python 3](http://img.shields.io/badge/python-3-blue.svg)\n\n\n## Requirements\n\nFlask-Autodoc is compatible with Python versions 2 and 3; and it depends only on Flask.\n\n## Install\n\nTo install Flask-Autodoc, run pip:\n\n\tpip install flask-autodoc\n\t\nor clone this directory and run setup:\n\n python setup.py install\n\n## Usage\n\nStart using Flask-Autodoc by importing it and initializing it:\n\n from flask import Flask\n from flask.ext.autodoc import Autodoc\n\n app = Flask(__name__)\n auto = Autodoc(app)\n\nby default, Flask-Autodoc will only document the routes explicitly decorated with _doc_:\n\n @app.route('/user/')\n @auto.doc()\n def show_user(id):\n return user_from_database(id)\n\nto generate the documentation, use the _html()_ method:\n\n @app.route('/documentation')\n def documentation():\n return auto.html()\n\n## Custom documentation\n\nTo access the documentation without rendering html:\n\n @app.route('/documentation')\n def documentation():\n return auto.generate()\n\nthe documentation will be returned as a list of rules, where each rule is a dictionary containing:\n\n- methods: the set of allowed methods (ie ['GET', 'POST'])\n- rule: relative url (ie '/user/')\n- endpoint: function name (ie 'show_user')\n- doc: docstring of the function\n- args: function arguments\n- defaults: defaults values for the arguments\n\n## Custom template\n\nTo use a custom template for your documentation, give a _template_ argument to the _html_ method. This will use a template from the flask _templates_ directory. \n\nAdditionnal arguments (other than _group_, _groups_, and _template_) will be passed down to the template:\n\n\tauto.html(\n\t\t\n\t\ttemplate='custom_documentation.html'\n\t\t\n\t\ttitle='My Documentation',\n\t\tauthor='John Doe',\n\t)\n\t\n\n_title_ and _author_ will be available in the template:\n\n\t\n\t...\n\t{% if title is defined %}\n\t\t{{title}}\n\t{% endif %}\n\t...\n\n## Documentation sets\n\nEndpoints can be grouped together in different documentation sets. It is possible for instance to show some endpoints to third party developers and have full documentation for primary developers.\n\nTo assign an endpoint to a group, pass the name of the group as argument of the _doc_ decorator:\n\n @app.route('/user/')\n @auto.doc('public')\n def show_user(id):\n\nto assign an endpoint to multiple groups, pass a list of group names as the _groups_ argument to _doc_:\n\n @app.route('/user/')\n @auto.doc(groups=['public','private'])\n def show_user(id):\n\nto generate the documentation for a specific group, pass the name of the group to the _html_ or _generate_ methods:\n\n auto.html('public')\n auto.html(groups=['public','private'])\n auto.generate('public')\n \n## Examples\n\nApps in the _examples_ directory are an api for a blog:\n\n- _simple_ is a simple app\n- _factory_ uses blueprints\n\nRun with\n\n\tpython simple/blog.py\n\t\nand connect to [/doc/public](http://127.0.0.1:5000/doc/public) and [/doc/private](http://127.0.0.1:5000/doc/private) to see public and private documentations.\n\n## Screenshots\n\n![screenshots](screenshots/screenshot00.png)\n\n![screenshots](screenshots/screenshot01.png)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/acoomans/flask-autodoc", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Flask-Autodoc", "package_url": "https://pypi.org/project/Flask-Autodoc/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Autodoc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/acoomans/flask-autodoc" }, "release_url": "https://pypi.org/project/Flask-Autodoc/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Documentation generator for flask", "version": "0.1.2" }, "last_serial": 3876826, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d7c97a0e711a50de8ccf173e6fe7bc8f", "sha256": "9ca598173ec30a82f0adacd5a854dd3ad302f864f09e9ce6d9634b748f795a75" }, "downloads": -1, "filename": "Flask-Autodoc-0.1.tar.gz", "has_sig": false, "md5_digest": "d7c97a0e711a50de8ccf173e6fe7bc8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4557, "upload_time": "2013-10-01T04:27:38", "url": "https://files.pythonhosted.org/packages/28/d2/57a20858da095ae21a974570e56f560d040f595bb1654be0f70e4977d0a8/Flask-Autodoc-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "40d895aa0616ca0a394d7764a1b0ba0a", "sha256": "65936b8157a3e83a9dd74c58919c5df8cb5d240694cff3c8dd81b736dc32abde" }, "downloads": -1, "filename": "Flask-Autodoc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "40d895aa0616ca0a394d7764a1b0ba0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4558, "upload_time": "2013-10-01T05:44:23", "url": "https://files.pythonhosted.org/packages/99/c1/308052984f8a342f8cd6abc6122c5264593224a5910bbd0a22cae97d8a29/Flask-Autodoc-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d08809434c4102ebe7440f5ed75b3279", "sha256": "364468726b8a4579959685d696a078ff59f589ab3963f537427a8400dcddf403" }, "downloads": -1, "filename": "Flask-Autodoc-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d08809434c4102ebe7440f5ed75b3279", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5454, "upload_time": "2015-09-03T18:51:40", "url": "https://files.pythonhosted.org/packages/ec/fd/cba920b70474b236e6033adcd979d04db221b7278cb7c442a867b669596d/Flask-Autodoc-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d08809434c4102ebe7440f5ed75b3279", "sha256": "364468726b8a4579959685d696a078ff59f589ab3963f537427a8400dcddf403" }, "downloads": -1, "filename": "Flask-Autodoc-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d08809434c4102ebe7440f5ed75b3279", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5454, "upload_time": "2015-09-03T18:51:40", "url": "https://files.pythonhosted.org/packages/ec/fd/cba920b70474b236e6033adcd979d04db221b7278cb7c442a867b669596d/Flask-Autodoc-0.1.2.tar.gz" } ] }