{ "info": { "author": "chris48s", "author_email": "", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# django-apiblueprint-view\n\n[![Build Status](https://travis-ci.org/chris48s/django-apiblueprint-view.svg?branch=master)](https://travis-ci.org/chris48s/django-apiblueprint-view)\n[![Coverage Status](https://coveralls.io/repos/github/chris48s/django-apiblueprint-view/badge.svg?branch=master)](https://coveralls.io/github/chris48s/django-apiblueprint-view?branch=master)\n![PyPI Version](https://img.shields.io/pypi/v/django-apiblueprint-view.svg)\n![License](https://img.shields.io/pypi/l/django-apiblueprint-view.svg)\n![Python Support](https://img.shields.io/pypi/pyversions/django-apiblueprint-view.svg)\n![Django Support](https://img.shields.io/pypi/djversions/django-apiblueprint-view.svg)\n![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)\n\nRender [API Blueprints](https://apiblueprint.org/) on-the-fly using Django templates\n\n## Installation\n\n1. `django-apiblueprint-view` uses the [Drafter](https://github.com/apiaryio/drafter) C library for API Blueprint parsing. Install it using:\n\n```\nwget https://github.com/apiaryio/drafter/releases/download/v3.2.7/drafter-v3.2.7.tar.gz\ntar xvzf drafter-v3.2.7.tar.gz\ncd drafter-v3.2.7\n./configure --shared\nmake libdrafter\nsudo cp build/out/Release/lib.target/libdrafter.so /usr/lib/libdrafter.so\nsudo cp src/drafter.h /usr/include/drafter/drafter.h\n```\n\n2. `pip install django-apiblueprint-view`\n\n3. Add to `INSTALLED_APPS` in django settings:\n\n```python\nINSTALLED_APPS = [\n ...\n 'apiblueprint_view',\n]\n```\n\n## Usage\n\n```python\nfrom apiblueprint_view.views import ApiBlueprintView\n\nurlpatterns = [\n url(r'^docs/$', ApiBlueprintView.as_view(blueprint='/path/to/blueprint.apibp')),\n]\n```\n\n## Styling\n\n### Custom HTML Template\n\nDefine a custom base template. It must include the tag\n\n```\n{% include 'api_docs/docs_parent.html' %}\n```\n\nPass it into `ApiBlueprintView.as_view()` as a parameter.\n\n```python\nfrom apiblueprint_view.views import ApiBlueprintView\n\nurlpatterns = [\n url(r'^docs/$', ApiBlueprintView.as_view(\n blueprint='/path/to/blueprint.apibp',\n template_name='my_base_template.html'\n )),\n]\n```\n\n### Custom CSS\n\n`ApiBlueprintView.as_view()` may accept a `styles` dictionary describing custom CSS classes which should be attached to rendered HTML tags. For example:\n\n```python\nfrom apiblueprint_view.views import ApiBlueprintView\n\nurlpatterns = [\n url(r'^docs/$', ApiBlueprintView.as_view(\n blueprint='/path/to/blueprint.apibp',\n template_name='my_base_template.html',\n styles={\n 'action': {'class': 'foo bar'},\n 'method': {'class': 'baz'}\n }\n )),\n]\n```\n\nThe following keys are valid. All keys are optional:\n\n* `'action'`: Container `
` for an API action\n* `'action_transaction'`: Container `
` for a HTTP transaction (request and response)\n* `'action_request'`: Container `
` for a HTTP request\n* `'action_response'`: Container `
` for a HTTP response\n* `'action_schema'`: Container `
` for a HTTP request or response schema\n* `'action_headers'`: Container `
` for HTTP request or response headers\n* `'action_body'`: Container `
` for a HTTP request or response body\n* `'action_example'`: Container `
` for an API action example URL\n* `'description'`: Container `
` for some text describing an action, resource, request, response, etc\n* `'parameters'`: Container `
` for a list of parameters\n* `'method'`: Generic `` containing an HTTP method\n* `'method_CONNECT'`: `` containing the text `CONNECT`\n* `'method_DELETE'`: `` containing the text `DELETE`\n* `'method_GET'`: `` containing the text `GET`\n* `'method_HEAD'`: `` containing the text `HEAD`\n* `'method_OPTIONS'`: `` containing the text `OPTIONS`\n* `'method_PATCH'`: `` containing the text `PATCH`\n* `'method_POST'`: `` containing the text `POST`\n* `'method_PUT'`: `` containing the text `PUT`\n* `'method_TRACE'`: `` containing the text `TRACE`\n* `'resource'`: Container `
` for an API resource\n* `'resource_group'`: Container `
` for an API resource group\n\n[Highlight.js](https://highlightjs.org/) can be used to add syntax highlighting\n\n### Including Files\n\nYou can include other files in your blueprint by using an include directive with a path to the included file relative to the current file's directory. Included files can include other files, so be careful of circular references.\n\n```\n\n```\n\nThis syntax is not a part of the API Blueprint spec, but is also supported in some other tools e.g: [aglio](https://github.com/danielgtaylor/aglio#including-files).\n\nThe include directive has the potential to introduce remote file inclusion or directory traversal vulnerabilities if your application renders user-supplied content. There are a couple of settings to help mitigate this. Set `APIBP_PROCESS_INCLUDES = False` in your django settings to completely ignore include directives (the default is `True`). There is also a whitelist of allowed file types to include. The default whitelist is `['.md', '.apibp', '.json']` but this can be overridden by setting `APIBP_INCLUDE_WHITELIST` to a list of allowed extensions in your django settings.\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chris48s/django-apiblueprint-view", "keywords": "", "license": "MIT", "maintainer": "chris48s", "maintainer_email": "", "name": "django-apiblueprint-view", "package_url": "https://pypi.org/project/django-apiblueprint-view/", "platform": "", "project_url": "https://pypi.org/project/django-apiblueprint-view/", "project_urls": { "Homepage": "https://github.com/chris48s/django-apiblueprint-view", "Repository": "https://github.com/chris48s/django-apiblueprint-view" }, "release_url": "https://pypi.org/project/django-apiblueprint-view/2.1.1/", "requires_dist": [ "Django (>=1.11,<2.3)", "draughtsman (==0.1.0)", "markdown2 (>=2.0.0,<3.0.0)" ], "requires_python": ">=3.5,<4.0", "summary": "Render API Blueprints on-the-fly using Django templates", "version": "2.1.1" }, "last_serial": 5992135, "releases": { "1.1.1": [ { "comment_text": "", "digests": { "md5": "1b7ccac5bf7cbf2fd5f69a7a4496982a", "sha256": "334a3f0c56aa74516bacf9838cd3e9853428c7da7c296c2773af00d0f3490b34" }, "downloads": -1, "filename": "django-apiblueprint-view-1.1.1.tar.gz", "has_sig": false, "md5_digest": "1b7ccac5bf7cbf2fd5f69a7a4496982a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12138, "upload_time": "2017-10-26T19:20:12", "url": "https://files.pythonhosted.org/packages/78/4b/fe3ac6dd04b1d9093f1b61430dbe5f4669b5ea691252488e3bfdd17d4233/django-apiblueprint-view-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "ec1073943039c27a6ea40100bbcab513", "sha256": "7c65b596d7d61811edcf69035da99197cad062a14034649835064cebf2b56ee8" }, "downloads": -1, "filename": "django-apiblueprint-view-1.1.2.tar.gz", "has_sig": false, "md5_digest": "ec1073943039c27a6ea40100bbcab513", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12651, "upload_time": "2017-12-03T14:42:03", "url": "https://files.pythonhosted.org/packages/21/75/e5c206e3cfee258f481f43d909d11c26afd16eadb65f58221ad88b8cb21d/django-apiblueprint-view-1.1.2.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "9b5509dc19e1629798d7697faf4f7d82", "sha256": "42a4a72ee7a052796f9defce7e28c8bb94a727a5983d2f440d76b855a62e9d34" }, "downloads": -1, "filename": "django-apiblueprint-view-2.0.0.tar.gz", "has_sig": false, "md5_digest": "9b5509dc19e1629798d7697faf4f7d82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8603, "upload_time": "2018-11-04T22:26:46", "url": "https://files.pythonhosted.org/packages/fb/0e/2d3f7a228847ad1e9608bae280af90284de78f64263e7cac040be71c6b48/django-apiblueprint-view-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "2a6efef13f7c54ac440e7a18c2dd1b87", "sha256": "4771bd99208b9ef18a7ae9d0a78f2292ed8c3376a4ff510789321652f692a13e" }, "downloads": -1, "filename": "django-apiblueprint-view-2.0.1.tar.gz", "has_sig": false, "md5_digest": "2a6efef13f7c54ac440e7a18c2dd1b87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8607, "upload_time": "2019-05-13T21:00:06", "url": "https://files.pythonhosted.org/packages/9a/cd/b08480e01b4297205ccb4fff42cdf33b2597e0a0a30f28d7e1b476d87367/django-apiblueprint-view-2.0.1.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "d501a12036d7373c23356d58ab3b440a", "sha256": "b61ada2d8691c6f11901363a58ceb91df91077fd0f9c7d19b94d8998ab2db981" }, "downloads": -1, "filename": "django-apiblueprint-view-2.1.0.tar.gz", "has_sig": false, "md5_digest": "d501a12036d7373c23356d58ab3b440a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8616, "upload_time": "2019-05-31T15:44:24", "url": "https://files.pythonhosted.org/packages/0d/a8/82903cc830086fbb1d9d619063d4d102b46a63c5d3852b9e134cfc043033/django-apiblueprint-view-2.1.0.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "6692cfdc525da898de4e05a54322bcb7", "sha256": "73f75c9a90d82ad1a8aeba14608d9476f65c58619b68765fd81eb9c5afd1cec3" }, "downloads": -1, "filename": "django_apiblueprint_view-2.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6692cfdc525da898de4e05a54322bcb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 11446, "upload_time": "2019-10-17T20:08:17", "url": "https://files.pythonhosted.org/packages/1f/88/841c8b68667e36b9e15a482193ba2deb83c925e023373f8cff6f9c7d0a54/django_apiblueprint_view-2.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cd6a60d3427f4dd982e953c3e723461", "sha256": "4e8edb435eeef76c163d16e91d8efbe987c8b5096d7de3b81730e756dcc7cd2c" }, "downloads": -1, "filename": "django-apiblueprint-view-2.1.1.tar.gz", "has_sig": false, "md5_digest": "2cd6a60d3427f4dd982e953c3e723461", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 9150, "upload_time": "2019-10-17T20:08:15", "url": "https://files.pythonhosted.org/packages/80/70/a4e2a30cc35e652c5d5229c0ce3fe30add0b485bc0778e6c943237c8ecec/django-apiblueprint-view-2.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6692cfdc525da898de4e05a54322bcb7", "sha256": "73f75c9a90d82ad1a8aeba14608d9476f65c58619b68765fd81eb9c5afd1cec3" }, "downloads": -1, "filename": "django_apiblueprint_view-2.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6692cfdc525da898de4e05a54322bcb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 11446, "upload_time": "2019-10-17T20:08:17", "url": "https://files.pythonhosted.org/packages/1f/88/841c8b68667e36b9e15a482193ba2deb83c925e023373f8cff6f9c7d0a54/django_apiblueprint_view-2.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cd6a60d3427f4dd982e953c3e723461", "sha256": "4e8edb435eeef76c163d16e91d8efbe987c8b5096d7de3b81730e756dcc7cd2c" }, "downloads": -1, "filename": "django-apiblueprint-view-2.1.1.tar.gz", "has_sig": false, "md5_digest": "2cd6a60d3427f4dd982e953c3e723461", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 9150, "upload_time": "2019-10-17T20:08:15", "url": "https://files.pythonhosted.org/packages/80/70/a4e2a30cc35e652c5d5229c0ce3fe30add0b485bc0778e6c943237c8ecec/django-apiblueprint-view-2.1.1.tar.gz" } ] }