**********
apispec-ui
**********
.. image:: https://img.shields.io/pypi/v/apispec-ui
:target: https://pypi.org/project/apispec-ui
:alt: PyPI version
.. image:: https://github.com/codectl/apispec-ui/actions/workflows/ci.yaml/badge.svg
:target: https://github.com/codectl/apispec-ui/actions/workflows/ci.yaml
:alt: CI
.. image:: https://codecov.io/gh/codectl/apispec-ui/branch/master/graph/badge.svg
:target: https://app.codecov.io/gh/codectl/apispec-ui/branch/master
:alt: codecov
.. image:: https://img.shields.io/badge/OAS-2_|_3-14ACBB.svg
:target: https://github.com/OAI/OpenAPI-Specification
:alt: OpenAPI Specification 2/3 compatible
.. image:: https://img.shields.io/pypi/pyversions/apispec-ui
:target: https://pypi.org/project/apispec-ui
:alt: Python compatibility
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: code style: black
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: license: MIT
A library to generate a UI interface from an `APISpec <https://github
.com/marshmallow-code/apispec>`__ specification. As per the APISpec initiative, it
currently supports `OpenAPI Specification <https://github
.com/OAI/OpenAPI-Specification>`__ (aka. Swagger specification) and `SwaggerUI
<https://swagger.io/tools/swagger-ui/>`__.
Features
========
* Support for the OpenAPI Specification (versions 2 and 3)
* Compatibility with SwaggerUI (latest version - 4.18.1)
* Support for frameworks which include:
* `Flask <https://pypi.org/project/Flask>`__
Installation
============
Install the package directly from ``PyPI`` (recommended):
.. code-block:: bash
$ pip install -U apispec-ui
Plugin dependencies like ``apispec`` and ``Flask`` are not installed with the package by default. To
have ``apispec`` and ``Flask`` installed, run:
.. code-block:: bash
$ pip install -U apispec-ui[apispec,flask]
Example usage
=============
A simple example on how to work with a ``Flask`` application:
.. code-block:: python
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec_plugins import FlaskPlugin
from apispec_ui.flask import Swagger
from flask import Flask
app = Flask(__name__)
apispec = APISpec(
title="Pet Store",
version="1.0.0",
openapi_version="3.1.0",
plugins=(FlaskPlugin(), MarshmallowPlugin()), # optional
)
...
Swagger(app=app, apispec=apispec, config={})
With this example, the application contains 2 extra views:
- ``swagger.ui``: endpoint to serve ``SwaggerUI``
- ``swagger.specs``: endpoint to serve ``swagger`` specs, in ``yaml``
With ``configs`` parameter one can tweak some parameters:
.. code-block:: python
config = {
"swaggerui": True, # enable/disable SwaggerUI
"swagger_route": "/api/", # change swagger routes
"swagger_static": "/static/", # change location for static files
"swagger_favicon": "favicon.ico", # change favicon
"swagger_hide_bar": True, # hide SwaggerUI top bar
}
These settings can also be configured through the ``SWAGGER`` config variable that is
part of the app config.
In terms of precedence, the config that takes the most precedence is the ``config``
parameter from ``Swagger`` class, followed by the ``SWAGGER`` app config.
Tests & linting 🚥
==================
Run tests with ``tox``:
.. code-block:: bash
# ensure tox is installed
$ tox
Run linter only:
.. code-block:: bash
$ tox -e lint
Optionally, run coverage as well with:
.. code-block:: bash
$ tox -e coverage
License
=======
MIT licensed. See `LICENSE <LICENSE>`__.
Raw data
{
"_id": null,
"home_page": "https://github.com/codectl/apispec-ui",
"name": "apispec-ui",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "flaskful,swagger,openapi,oas,oas2,oas3,rest,api,web,flask,python,python3",
"author": "Renato Damas",
"author_email": "rena2damas@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/cb/20/0a8dbfc4778787285396595566bb499f4a6b7caa0ddc1bebc3c1ca8394da/apispec_ui-1.0.0.tar.gz",
"platform": null,
"description": "**********\napispec-ui\n**********\n\n.. image:: https://img.shields.io/pypi/v/apispec-ui\n :target: https://pypi.org/project/apispec-ui\n :alt: PyPI version\n.. image:: https://github.com/codectl/apispec-ui/actions/workflows/ci.yaml/badge.svg\n :target: https://github.com/codectl/apispec-ui/actions/workflows/ci.yaml\n :alt: CI\n.. image:: https://codecov.io/gh/codectl/apispec-ui/branch/master/graph/badge.svg\n :target: https://app.codecov.io/gh/codectl/apispec-ui/branch/master\n :alt: codecov\n.. image:: https://img.shields.io/badge/OAS-2_|_3-14ACBB.svg\n :target: https://github.com/OAI/OpenAPI-Specification\n :alt: OpenAPI Specification 2/3 compatible\n.. image:: https://img.shields.io/pypi/pyversions/apispec-ui\n :target: https://pypi.org/project/apispec-ui\n :alt: Python compatibility\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: code style: black\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\n :target: https://opensource.org/licenses/MIT\n :alt: license: MIT\n\nA library to generate a UI interface from an `APISpec <https://github\n.com/marshmallow-code/apispec>`__ specification. As per the APISpec initiative, it\ncurrently supports `OpenAPI Specification <https://github\n.com/OAI/OpenAPI-Specification>`__ (aka. Swagger specification) and `SwaggerUI\n<https://swagger.io/tools/swagger-ui/>`__.\n\nFeatures\n========\n* Support for the OpenAPI Specification (versions 2 and 3)\n* Compatibility with SwaggerUI (latest version - 4.18.1)\n* Support for frameworks which include:\n\n * `Flask <https://pypi.org/project/Flask>`__\n\n\nInstallation\n============\nInstall the package directly from ``PyPI`` (recommended):\n\n.. code-block:: bash\n\n $ pip install -U apispec-ui\n\n\nPlugin dependencies like ``apispec`` and ``Flask`` are not installed with the package by default. To\nhave ``apispec`` and ``Flask`` installed, run:\n\n.. code-block:: bash\n\n $ pip install -U apispec-ui[apispec,flask]\n\nExample usage\n=============\nA simple example on how to work with a ``Flask`` application:\n\n.. code-block:: python\n\n from apispec import APISpec\n from apispec.ext.marshmallow import MarshmallowPlugin\n from apispec_plugins import FlaskPlugin\n from apispec_ui.flask import Swagger\n from flask import Flask\n\n app = Flask(__name__)\n apispec = APISpec(\n title=\"Pet Store\",\n version=\"1.0.0\",\n openapi_version=\"3.1.0\",\n plugins=(FlaskPlugin(), MarshmallowPlugin()), # optional\n )\n ...\n Swagger(app=app, apispec=apispec, config={})\n\nWith this example, the application contains 2 extra views:\n\n- ``swagger.ui``: endpoint to serve ``SwaggerUI``\n- ``swagger.specs``: endpoint to serve ``swagger`` specs, in ``yaml``\n\nWith ``configs`` parameter one can tweak some parameters:\n\n.. code-block:: python\n\n config = {\n \"swaggerui\": True, # enable/disable SwaggerUI\n \"swagger_route\": \"/api/\", # change swagger routes\n \"swagger_static\": \"/static/\", # change location for static files\n \"swagger_favicon\": \"favicon.ico\", # change favicon\n \"swagger_hide_bar\": True, # hide SwaggerUI top bar\n }\n\nThese settings can also be configured through the ``SWAGGER`` config variable that is\npart of the app config.\n\nIn terms of precedence, the config that takes the most precedence is the ``config``\nparameter from ``Swagger`` class, followed by the ``SWAGGER`` app config.\n\nTests & linting \ud83d\udea5\n==================\nRun tests with ``tox``:\n\n.. code-block:: bash\n\n # ensure tox is installed\n $ tox\n\nRun linter only:\n\n.. code-block:: bash\n\n $ tox -e lint\n\nOptionally, run coverage as well with:\n\n.. code-block:: bash\n\n $ tox -e coverage\n\nLicense\n=======\nMIT licensed. See `LICENSE <LICENSE>`__.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Generate UI interactive API's from APISpec specifications.",
"version": "1.0.0",
"split_keywords": [
"flaskful",
"swagger",
"openapi",
"oas",
"oas2",
"oas3",
"rest",
"api",
"web",
"flask",
"python",
"python3"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6d5dcb43a00b08c6b1e70d0f3aa67e3327af4fccf90dd77b350f5faab01eb449",
"md5": "3192cad96245e1c028ef6b9480975ef5",
"sha256": "6759e4cf7c8e91e0f6279a666a48995a943f5c914f7624332710370549b8b595"
},
"downloads": -1,
"filename": "apispec_ui-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3192cad96245e1c028ef6b9480975ef5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 2636636,
"upload_time": "2023-03-15T02:17:52",
"upload_time_iso_8601": "2023-03-15T02:17:52.801971Z",
"url": "https://files.pythonhosted.org/packages/6d/5d/cb43a00b08c6b1e70d0f3aa67e3327af4fccf90dd77b350f5faab01eb449/apispec_ui-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cb200a8dbfc4778787285396595566bb499f4a6b7caa0ddc1bebc3c1ca8394da",
"md5": "85336b922d8cda67fd770cebf4245cbc",
"sha256": "460c116ae91dbbdbc29e49143d015283b296063fe9c52f6326ffe294b9f669cd"
},
"downloads": -1,
"filename": "apispec_ui-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "85336b922d8cda67fd770cebf4245cbc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 2609272,
"upload_time": "2023-03-15T02:17:55",
"upload_time_iso_8601": "2023-03-15T02:17:55.347542Z",
"url": "https://files.pythonhosted.org/packages/cb/20/0a8dbfc4778787285396595566bb499f4a6b7caa0ddc1bebc3c1ca8394da/apispec_ui-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-15 02:17:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "codectl",
"github_project": "apispec-ui",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "apispec-ui"
}